Closed rentalhost closed 3 months ago
Thanks. I will look into it.
I found the bug and deploying the fix now.
Please try again :)
@invisal Impressively fast! It's working perfectly now. Thanks!!!
I noticed that the same problem happens for INTEGER
fields that receive TEXT
or BLOB
values.
CREATE TABLE IF NOT EXISTS "types" (
"integer" INTEGER NOT NULL,
"real" REAL NOT NULL,
"text" TEXT NOT NULL,
"blob" BLOB NOT NULL,
"description" TEXT NOT NULL
);
INSERT INTO types VALUES(123,1.23,'a.bc',X'616263','Respecting all column types');
INSERT INTO types VALUES(123,123,'123',123,'Forcing INTEGER to all'); # OK
INSERT INTO types VALUES(1.23,1.23,'1.23',1.23,'Forcing REAL to all'); # OK
INSERT INTO types VALUES('abc','abc','abc','abc','Forcing TEXT to all'); # Fail 1, 2
INSERT INTO types VALUES(X'616263',X'616263',X'616263',X'616263','Forcing BLOB to all'); # Fail 1, 2
I noticed that the same problem happens for
INTEGER
fields that receiveTEXT
orBLOB
values.CREATE TABLE IF NOT EXISTS "types" ( "integer" INTEGER NOT NULL, "real" REAL NOT NULL, "text" TEXT NOT NULL, "blob" BLOB NOT NULL, "description" TEXT NOT NULL ); INSERT INTO types VALUES(123,1.23,'a.bc',X'616263','Respecting all column types'); INSERT INTO types VALUES(123,123,'123',123,'Forcing INTEGER to all'); # OK INSERT INTO types VALUES(1.23,1.23,'1.23',1.23,'Forcing REAL to all'); # OK INSERT INTO types VALUES('abc','abc','abc','abc','Forcing TEXT to all'); # Fail 1, 2 INSERT INTO types VALUES(X'616263',X'616263',X'616263',X'616263','Forcing BLOB to all'); # Fail 1, 2
Interesting. I guess I need to check value type instead of the column type and decide which cell type it should it use. Thanks for reporting.
Merged and deployed to production. Thanks for helping out. You are amazing :)
SQLite is flexible with the data type stored in a field. Even if a column is specified as
INTEGER
, you can still store different types of values, such asREAL
. In a real scenario, I mistakenly created a table that was supposed to storeREAL
values but configured it asINTEGER
. This works in practice because SQLite is flexible, and the data can be easily interpreted in a JS environment. However, LibSQL Studio displaysNULL
, even though the data is loaded into the pipeline asfloat
.