Work on knexifying password resets

This commit is contained in:
Calvin Montgomery 2017-08-16 23:28:29 -07:00
parent 791a712a68
commit ae7098085c
4 changed files with 203 additions and 16 deletions

View 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;
}