Setting JSON column to {{null}} doesn't set it to NULL

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

1 Like

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}}}?

  1. With {{{a:null}}} it updates as expected
    CleanShot 2023-11-27 at 13.17.50@2x

  2. With {{null}} it becomes a string again
    CleanShot 2023-11-27 at 13.18.55@2x

  3. 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:
CleanShot 2023-11-27 at 13.22.09@2x