Module: TableInsert

TableInsert factory.
Mixes In:
Source:

Methods

execute() → {Promise.<Result>}

Execute the insert query.
Source:
Returns:
Type
Promise.<Result>

(inner) module:TableInsert:values(ExprOrLiteral) → {TableInsert}

Set row values.
Parameters:
Name Type Description
ExprOrLiteral string | Array.<string> column values
Source:
Throws:
When there is a mismatch with the number columns in the query.
Type
Error
Returns:
The query instance
Type
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')