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