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)
| 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 |
no outgoing calls
no test coverage detected