I get this error: `... don't have client default v...
# exposed
o
I get this error:
... don't have client default values. DB defaults don't support in batch inserts
why is that not supported?
t
Could you provide full sample to test it?
o
in my case
create_date
is timestamp (mysql db) with default of current_timestamp
t
with default of current_timestamp
this
default
is available only in database nor code?
o
There is a default in the database, if I put default in the code it caused it to have my service startup time as default
so I have to omit that
t
You can use
defaultExpression(CurrentDateTime)
function on column
🎉 1
o
so in such case in any update to the row it will update the
create_date
? if that is the case it is not a good solution because I want the row to have the initial value when it was inserted.
t
I wrote simple test and looks like update ignores
defaultExpression
if that column is absent from update: https://gist.github.com/Tapac/2518c19cbeefc6be6e56cfa850ed18db
o
Thanks, is there any rule when exactly is it added so I can see in the code and document it?
t
Looks like defaultExpression never used in updates. In inserts it used when defaultExpression placed on non nullable column which absent from insert statement.