Add API for generated columns
With generated columns, SQLite can be used as a document database.
https://dgl.cx/2020/06/sqlite-json-support
Just did a little digging into this to understand it a bit further, I think I identified the places we need to change
- a) we need to have either a Special Column Type like
AlwaysGeneratedAs(TheTypeToBeUsedInEvoluLifeTime, 'the additional sqlite add/update column code')b) or some kind of other place to declare those columns during Schema Creation - in
validEvoluSchemaToDbSchemathis needs to fill the sqlite column types / text currently in the Db we only use Blobs so this place should fill an array of "Type Of Column" , 95% will beblob, the rest is the AlwaysGeneratedAs Text - in
ensureDbSchemathis Type Of Column needs to be used instead ofblob
Whats also great about this kind of feature , this could also finally solve long going issue with a need of Union Types in Tables
Currently:
- a union of types as a table is not possible in Evolu and Kysely (typing)
But, with this feature, I can have a payload json Union of 2 object types, each with its own type property and then I can have that type property be used as a top-level column using the generated column
So really a win/win here, one feature to solve a bunch of issues ^^
Closing as this is no longer relevant—the new Evolu launches tomorrow. Feel free to reopen if it becomes relevant with the new Evolu.