I’m looking to use Grist Desktop as a table editor for local projects, and I noticed that the .grist
file uses BLOB
for most of the SQLite column types. I’m curious, therefore, if there is a way to programmatically extract these tables in a way that maps Grist’s type information onto them. The grist_api
Python package would be one possible solution, but I haven’t been able to ascertain whether it works with Grist Desktop.
If you set types for your columns, the types will be reflected in the SQLite table. For example, for my own document, I see
sqlite> .schema NES_shopping_list
CREATE TABLE IF NOT EXISTS "NES_shopping_list" (
id INTEGER PRIMARY KEY,
"manualSort" NUMERIC DEFAULT 1e999,
"Title" TEXT DEFAULT '',
"URL" TEXT DEFAULT '',
"Price" NUMERIC DEFAULT 0,
"Purchase_status" TEXT DEFAULT '',
"Price_CAD_" NUMERIC DEFAULT 0,
"Currency" TEXT DEFAULT '',
"Play_status" TEXT DEFAULT '',
"Box_art" TEXT DEFAULT NULL,
"text" TEXT DEFAULT '');
You are correct that the default type is blob
, but that only happens if you don’t give the column a type in Grist.
1 Like