Skip to content

TableRunner.insert() method

Home > @direct-sqlite/core > TableRunner > insert

Runs an atomic single-record write payload tracking metadata state alterations.

Signature:

insert(data: Partial<TRow>): {
changes: any;
lastInsertRowId: number;
};

Parameter

Type

Description

data

Partial<TRow>

An object containing the columns and their values to be inserted.

Returns:

{ changes: any; lastInsertRowId: number; }

The result of the insert operation, which typically includes the number of changes made and the last inserted row ID. The exact structure of the result may depend on the underlying SQLite client being used.