MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _append_param_update

Function _append_param_update

lib/sqlalchemy/sql/crud.py:1283–1326  ·  view source on GitHub ↗
(
    compiler, compile_state, stmt, c, implicit_return_defaults, values, kw
)

Source from the content-addressed store, hash-verified

1281
1282
1283def _append_param_update(
1284 compiler, compile_state, stmt, c, implicit_return_defaults, values, kw
1285):
1286 include_table = compile_state.include_table_with_column_exprs
1287 if c.onupdate is not None and not c.onupdate.is_sequence:
1288 if c.onupdate.is_clause_element:
1289 values.append(
1290 (
1291 c,
1292 compiler.preparer.format_column(
1293 c,
1294 use_table=include_table,
1295 ),
1296 compiler.process(c.onupdate.arg.self_group(), **kw),
1297 (),
1298 )
1299 )
1300 if implicit_return_defaults and c in implicit_return_defaults:
1301 compiler.implicit_returning.append(c)
1302 else:
1303 compiler.postfetch.append(c)
1304 else:
1305 values.append(
1306 (
1307 c,
1308 compiler.preparer.format_column(
1309 c,
1310 use_table=include_table,
1311 ),
1312 _create_update_prefetch_bind_param(compiler, c, **kw),
1313 (c.key,),
1314 )
1315 )
1316 elif c.server_onupdate is not None:
1317 if implicit_return_defaults and c in implicit_return_defaults:
1318 compiler.implicit_returning.append(c)
1319 else:
1320 compiler.postfetch.append(c)
1321 elif (
1322 implicit_return_defaults
1323 and (stmt._return_defaults_columns or not stmt._return_defaults)
1324 and c in implicit_return_defaults
1325 ):
1326 compiler.implicit_returning.append(c)
1327
1328
1329@overload

Callers 1

_scan_colsFunction · 0.85

Calls 5

format_columnMethod · 0.80
appendMethod · 0.45
processMethod · 0.45
self_groupMethod · 0.45

Tested by

no test coverage detected