BlinkDB Logo blinkDB

insert()

Inserts a new entity into a table, and returns the primary key of the inserted entity.

An exception is thrown if the given primary key already exists within the table.

const aliceId = await insert(userTable, { id: uuid(), name: "Alice", age: 23 });
ParameterDescription
tableThe table created by createTable() .
itemThe item to insert into the table.

Consider insertMany() if you want to insert many items in parallel.