init commit
This commit is contained in:
parent
ae639426d0
commit
7a491681cc
257 changed files with 95524 additions and 80 deletions
7
src/util/on-duplicate-key-update.js
Normal file
7
src/util/on-duplicate-key-update.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export function createMySQLDuplicateKeyUpdate(columns) {
|
||||
const prefix = ' on duplicate key update ';
|
||||
const updates = columns.map(col => `\`${col}\` = values(\`${col}\`)`)
|
||||
.join(', ');
|
||||
|
||||
return prefix + updates;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue