MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / get

Method get

lib/sqlalchemy/sql/compiler.py:2309–2333  ·  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

2307 row_fn = result.result_tuple([col.key for col in table.primary_key])
2308
2309 def get(lastrowid, parameters):
2310 """given cursor.lastrowid value and the parameters used for INSERT,
2311 return a "row" that represents the primary key, either by
2312 using the "lastrowid" or by extracting values from the parameters
2313 that were sent along with the INSERT.
2314
2315 """
2316 if lastrowid_processor is not None:
2317 lastrowid = lastrowid_processor(lastrowid)
2318
2319 if lastrowid is None:
2320 return row_fn(getter(parameters) for getter, col in getters)
2321 else:
2322 return row_fn(
2323 (
2324 (
2325 autoinc_getter(lastrowid, parameters)
2326 if autoinc_getter is not None
2327 else lastrowid
2328 )
2329 if col is autoinc_col
2330 else getter(parameters)
2331 )
2332 for getter, col in getters
2333 )
2334
2335 return get
2336

Callers 15

_newMethod · 0.45
_make_proxyMethod · 0.45
_cloneMethod · 0.45
traverse_usingFunction · 0.45
cloned_traverseFunction · 0.45
cloneFunction · 0.45
replacement_traverseFunction · 0.45
_static_cache_keyMethod · 0.45
_compile_w_cacheMethod · 0.45
_make_proxyMethod · 0.45
_gen_cache_keyMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected