brianc/node-sql

Setting DEFAULT value on UPDATE

Opened this issue · 1 comments

I don't seem to be able to figure out how to do this. I've checked the tests and didn't find anything. Is it just not a possibility? Thanks!

Assets.update({removed_timestamp: 'DEFAULT', removed_user_id: userId})

I would like to chip in 👍. When inserting I would like a field to have 'DEFAULT' as value, such that I can use it in a returning-statement. Empty field values generate 'NULL', which is no good when inserting to a Postgres non-null field :-(

I see that https://github.com/brianc/node-sql/blob/master/test/dialects/insert-tests.js#L226 has something looking like what is needed, but it doesn't seem to be publicly exposed.