[API reference](https://evolu.dev/docs/api-reference) › [@evolu/sqlite-wasm](https://evolu.dev/docs/api-reference/sqlite-wasm) › [c-api](https://evolu.dev/docs/api-reference/sqlite-wasm/c-api) › sqlite3\_last\_insert\_rowid

```ts
function sqlite3_last_insert_rowid(
  deps: SqliteWasmDep,
): (db: SqliteDbPtr) => bigint;
```

Defined in: [packages/sqlite-wasm/src/CApi.ts:1411](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/sqlite-wasm/src/CApi.ts#L1411)

Returns the rowid of the connection's most recent successful INSERT into a
rowid table, or 0 if there was none. Inside a trigger it returns the
trigger's insert until the trigger ends, and a failed INSERT leaves it
unchanged.

Wasm type `j(i)`. Signature `["sqlite3_last_insert_rowid", "i64",
"sqlite3*"]` from SQLite's table.

See https://sqlite.org/c3ref/last_insert_rowid.html.