You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
, the SQL column gets truncated to (table, create) on the output.
Whereas if i were to run
(sqlite-select (eieio-oref db 'handle)
"select name, sql from sqlite_schema where type like \"table\"")
;=>
(("EXPENSE_TYPES""CREATE TABLE EXPENSE_TYPES (id INT PRIMARY KEY, expense TEXT)")
("TRANSACTIONS""CREATE TABLE TRANSACTIONS ( id INT PRIMARY KEY, amount INT, debit INT CHECK (debit = 0 OR debit = 1), type INT, FOREIGN KEY (type) REFERENCES EXPENSE_TYPES (id), name TEXT )"))
I get the full output of the table definition.
The text was updated successfully, but these errors were encountered:
Since the metadata you are requesting here was not explicitly stored by EmacSQL itself, it wasn't printed, so when EmacSQL uses read on what it got from SQLite, then this happens: (read "CREATE TABLE EXPENSE_TYPES ...") => CREATE. EmacSQL cannot easily know that in that one case, it should not do that.
For the backend that uses built-in sqlite support, this happens in emacsql-send-message, for most other backends it happens in emacsql-parse.
I recommend, that for this one query, you fall back to a direct call to sqlite-select. Of course if you do not exclusively use the builtin backend, this will be more complicated.
I knew it had to be a consequence of it mainly storing emacs pretty-printable values, but forgot about how READ truncates data. theres probably some way to wrap it as a "(list ...)" before passing it to READ but i fear that overcomplicates things further than trying to re-architect based on storing elisp values as a proper serialized object and supporting normal SQL data types.
From executing an expression such as
, the SQL column gets truncated to (table, create) on the output.
Whereas if i were to run
I get the full output of the table definition.
The text was updated successfully, but these errors were encountered: