danielmhanover / typeorm-upsert

37 stars 2 forks source link

Can't support camelCase columns - wrong build of setter_string #2

Closed mkobi closed 4 years ago

mkobi commented 5 years ago

I'm using postgres, which uses lowercase on statements which will cause an error while trying to update if using camel-case column names. To solve this simply replace this line: const setter_string = keys.map(k => `${opts ? opts.key_naming_transform(k) : k} = :${k}`)

With this line: const setter_string = keys.map(k => `"${opts ? opts.key_naming_transform(k) : k}" = :${k}`)

brianschardt commented 5 years ago

@mkobi have you gotten this to work in typescript?