(core) return to using meaningful SQL types for columns

Summary:
Previously in {{D1053}} we switched to using BLOB as the "type" for all columns, to prevent SQLite from casting data unexpectedly.  This diff now returns to more meaningful types.  We apply marshalling to values when being placed in a column where a cast might occur, to inhibit such casting.

The benefit is that Grist documents become easier to interact with via regular database clients/libraries, which often rely on the column type more than a purely SQLite tool would.

On column type conversion, we run all blobs in the column through a decode/encode cycle so if they no longer need to be marshalled they revert to native type.  This could be optimized further, it is somewhat brute force.

Test Plan: Updated tests and reference document

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2755
This commit is contained in:
Paul Fitzpatrick
2021-03-24 17:48:31 -04:00
parent 34f8078ead
commit d8df2404c2
2 changed files with 144 additions and 17 deletions

View File

@@ -54,7 +54,7 @@
"@gristlabs/connect-sqlite3": "0.9.11",
"@gristlabs/express-session": "1.17.0",
"@gristlabs/pidusage": "2.0.17",
"@gristlabs/sqlite3": "4.0.6-grist.1",
"@gristlabs/sqlite3": "4.0.6-grist.2",
"@popperjs/core": "2.3.3",
"async-mutex": "0.2.4",
"axios": "0.18.0",