tinyplex / tinybase

The reactive data store for local‑first apps.
https://tinybase.org
MIT License
3.39k stars 67 forks source link

Allow null values in cells #70

Open yan-yanishevsky opened 1 year ago

yan-yanishevsky commented 1 year ago

When creating a new row it is impossible to store null values in a cell. It will be just dropped. In my app, I need to check specifically for nulls

    store.setRow('files', 'test_id', {
      name: 'Test file',
      folder_id: null,
    })

    console.log(store.getRow('files', 'test_id')) // {name: 'Test file'}
jamesgpearce commented 11 months ago

Unfortunately, null currently has a special meaning for a cell in several places (eg it means 'delete' in the transaction logs).

It would be a big breaking change but I could consider this for, say a v5.0 release.

Are you able to work around it for now?

yan-yanishevsky commented 11 months ago

Yes, sure. Thank you