MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / get

Method get

lib/sqlalchemy/sql/compiler.py:2369–2393  ·  view source on GitHub ↗

given cursor.lastrowid value and the parameters used for INSERT, return a "row" that represents the primary key, either by using the "lastrowid" or by extracting values from the parameters that were sent along with the INSERT.

(lastrowid, parameters)

Source from the content-addressed store, hash-verified

2367 row_fn = result.result_tuple([col.key for col in table.primary_key])
2368
2369 def get(lastrowid, parameters):
2370 """given cursor.lastrowid value and the parameters used for INSERT,
2371 return a "row" that represents the primary key, either by
2372 using the "lastrowid" or by extracting values from the parameters
2373 that were sent along with the INSERT.
2374
2375 """
2376 if lastrowid_processor is not None:
2377 lastrowid = lastrowid_processor(lastrowid)
2378
2379 if lastrowid is None:
2380 return row_fn(getter(parameters) for getter, col in getters)
2381 else:
2382 return row_fn(
2383 (
2384 (
2385 autoinc_getter(lastrowid, parameters)
2386 if autoinc_getter is not None
2387 else lastrowid
2388 )
2389 if col is autoinc_col
2390 else getter(parameters)
2391 )
2392 for getter, col in getters
2393 )
2394
2395 return get
2396

Callers 15

_newMethod · 0.45
_make_proxyMethod · 0.45
orderMethod · 0.45
__setstate__Method · 0.45
on_nullMethod · 0.45
_cloneMethod · 0.45
__missing__Method · 0.45
traverse_usingFunction · 0.45
cloned_traverseFunction · 0.45
cloneFunction · 0.45
replacement_traverseFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected