When setting a json column to {{null}} with an update step:
It doesn’t actually set it to null, instead it sets a null
string:
As you can see the other columns which are just var_chars did get set to NULL
Mysql8 database, wappler 5.8.2.
When setting a json column to {{null}} with an update step:
It doesn’t actually set it to null, instead it sets a null
string:
As you can see the other columns which are just var_chars did get set to NULL
Mysql8 database, wappler 5.8.2.
Using a custom query like column = null
works fine.
Which server model do you use (NodeJS, PHP)?
He’s using NodeJS
I’ve tested it myself with SQLite and MySQL8, in SQLite I get a string "null"
back which is normal since SQLite doesn’t support JSON fields. In MySQL8 I get a null
object back in my test.
What happens if you set an actual object like {{{a:null}}}
?
With {{{a:null}}}
it updates as expected
With {{null}}
it becomes a string again
With capital letters: {{NULL}}
it throws:
"Empty .update() call detected! Update data does not contain any values to update. This will result in a faulty query. Table: school_bookkeeping_integrations. Columns: moneybird_setup_error."
I can only set it to null using a custom query:
update `school_bookkeeping_integrations` set `moneybird_setup_error` = NULL where `id` = 92
Results in: