function insertedRowId
insertedRowId(
result: ResultSet,
primaryKey?: string,
): number

The key of the row an INSERT … RETURNING wrote, read from the row itself rather than from the driver's optional lastInsertRowid. Every generated key is a positive integer, so anything else means nothing downstream can be keyed on this row and the write must fail here.

Parameters

result: ResultSet
optional
primaryKey: string = id

Return Type

number

Usage

import { insertedRowId } from "docs/database.ts";