* @param {Boolean} [options.validate=true] Should each row be subject to validation before it is inserted. The whole insert will fail if one row fails validation
* @param {Boolean} [options.validate=true] Should each row be subject to validation before it is inserted. The whole insert will fail if one row fails validation
* @param {Boolean} [options.hooks=true] Run before / after bulk update hooks?
* @param {Boolean} [options.hooks=true] Run before / after bulk update hooks?
* @param {Boolean} [options.individualHooks=false] Run before / after update hooks?
* @param {Boolean} [options.individualHooks=false] Run before / after update hooks?
* @param {Boolean} [options.returning=false] Return the affected rows (only for postgres)
* @param {Number} [options.limit] How many rows to update (only for mysql and mariadb)
* @param {Number} [options.limit] How many rows to update (only for mysql and mariadb)
* @deprecated The syntax is due for change, in order to make `where` more consistent with the rest of the API
* @deprecated The syntax is due for change, in order to make `where` more consistent with the rest of the API
expectation:"INSERT INTO \"mySchema\".\"myTable\" (\"name\") VALUES ('foo'),('bar') RETURNING *;"
expectation:"INSERT INTO \"mySchema\".\"myTable\" (\"name\") VALUES ('foo'),('bar');"
},{
},{
arguments:[{schema:'mySchema',tableName:'myTable'},[{name:JSON.stringify({info:'Look ma a " quote'})},{name:JSON.stringify({info:'Look ma another " quote'})}]],
arguments:[{schema:'mySchema',tableName:'myTable'},[{name:JSON.stringify({info:'Look ma a " quote'})},{name:JSON.stringify({info:'Look ma another " quote'})}]],
expectation:"INSERT INTO \"mySchema\".\"myTable\" (\"name\") VALUES ('{\"info\":\"Look ma a \\\" quote\"}'),('{\"info\":\"Look ma another \\\" quote\"}') RETURNING *;"
expectation:"INSERT INTO \"mySchema\".\"myTable\" (\"name\") VALUES ('{\"info\":\"Look ma a \\\" quote\"}'),('{\"info\":\"Look ma another \\\" quote\"}');"
expectation:"INSERT INTO myTable (name,nullValue) VALUES ('foo',NULL),('bar',NULL) RETURNING *;",
expectation:"INSERT INTO myTable (name,nullValue) VALUES ('foo',NULL),('bar',NULL);",
context:{options:{omitNull:true,quoteIdentifiers:false}}// Note: We don't honour this because it makes little sense when some rows may have nulls and others not
context:{options:{omitNull:true,quoteIdentifiers:false}}// Note: We don't honour this because it makes little sense when some rows may have nulls and others not
expectation:"INSERT INTO mySchema.myTable (name) VALUES ('foo'),('bar') RETURNING *;",
expectation:"INSERT INTO mySchema.myTable (name) VALUES ('foo'),('bar');",
context:{options:{quoteIdentifiers:false}}
context:{options:{quoteIdentifiers:false}}
},{
},{
arguments:[{schema:'mySchema',tableName:'myTable'},[{name:JSON.stringify({info:'Look ma a " quote'})},{name:JSON.stringify({info:'Look ma another " quote'})}]],
arguments:[{schema:'mySchema',tableName:'myTable'},[{name:JSON.stringify({info:'Look ma a " quote'})},{name:JSON.stringify({info:'Look ma another " quote'})}]],
expectation:"INSERT INTO mySchema.myTable (name) VALUES ('{\"info\":\"Look ma a \\\" quote\"}'),('{\"info\":\"Look ma another \\\" quote\"}') RETURNING *;",
expectation:"INSERT INTO mySchema.myTable (name) VALUES ('{\"info\":\"Look ma a \\\" quote\"}'),('{\"info\":\"Look ma another \\\" quote\"}');",