Factory function that creates an instance of a statement for inserting
rows into a table.
- See:
Methods
-
values(literal)
-
Adds one or more values, given the corresponding list of columns, which the statement will insert in the table.
Parameters:
Name Type Argument Description literal
* <repeatable>
One or more values to insert in the corresponding columns. Returns:
The Instance of the statement itself following a fluent API convention.- Type
- module:TableInsert
Example
// arguments as column values table.insert('foo', 'bar').values('baz', 'qux') table.insert(['foo', 'bar']).values('baz', 'qux') // array of column values table.insert('foo', 'bar').values(['baz', 'qux']) table.insert(['foo', 'bar']).values(['baz', 'qux']) // comma-separated string with column values table.insert('foo', 'bar').values('baz, qux']) table.insert(['foo', 'bar']).values('baz, qux') // chaining multiple inserts table.insert('foo', 'bar') .values(['baz', 'qux']) .values(['quux', 'biz']) .values('foo, bar')