From 4a74ab78f34bafcb1525ddcbc5604b108c0bbe10 Mon Sep 17 00:00:00 2001 From: Alex Vershinin Date: Sat, 18 Nov 2023 04:56:12 +0400 Subject: [PATCH] docs: added info about mysql implementation for upsert --- src/guide/query-builder.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/query-builder.md b/src/guide/query-builder.md index 4329d194..e62b4215 100644 --- a/src/guide/query-builder.md +++ b/src/guide/query-builder.md @@ -949,7 +949,7 @@ knex('tableName') **.upsert(data, [returning], [options])** -Implemented for the CockroachDB. Creates an upsert query, taking either a hash of properties to be inserted into the row, or an array of upserts, to be executed as a single upsert command. If returning array is passed e.g. \['id', 'title'\], it resolves the promise / fulfills the callback with an array of all the added rows with specified columns. It's a shortcut for [returning method](#returning) +Implemented for the CockroachDB and MySQL. Creates an upsert query, taking either a hash of properties to be inserted into the row, or an array of upserts, to be executed as a single upsert command. If returning array is passed e.g. \['id', 'title'\], it resolves the promise / fulfills the callback with an array of all the added rows with specified columns. It's a shortcut for [returning method](#returning). Please be cautious because the returning option is not supported by MySQL. ```js // insert new row with unique index on title column