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
Thanks in advance for checking out.
I've asked this on the turso discord as well, and if you've come across it as a duplicate spam, apologies. Wanted to reach out to a larger audience about this.
Problem
db.Exec won't return an error when there are sqlite constraint errors. (SQLITE_CONSTRAINT_CHECK to be specific, but I've checked that it's the same for SQLITE_CONSTRAINT_PRIMARYKEY errors as well)
(I'm not an advanced and developer, and I'm not sure if this is a go-libsql issue or database/sql issue. Please let me know if someone knows.)
Environment
local, using a local .db file created with turso dev --db-file local.db
Manual Query
If I run a SQL query directly, as below, it fails due to CONSTRAINTS.
(It fails for the 3rd column since I gave a string with length of 3 EMDNumber TEXT NOT NULL CHECK (length(EMDNumber) = 5),)
Just for reference, I'm currently using a workaround to throw an error when sql.Db.RowsAffected() returns 0, but this is just a workaround since there are non error situations included.
Hi,
Thanks in advance for checking out.
I've asked this on the turso discord as well, and if you've come across it as a duplicate spam, apologies. Wanted to reach out to a larger audience about this.
Problem
db.Exec
won't return an error when there are sqlite constraint errors. (SQLITE_CONSTRAINT_CHECK
to be specific, but I've checked that it's the same forSQLITE_CONSTRAINT_PRIMARYKEY
errors as well)go-libsql
issue ordatabase/sql
issue. Please let me know if someone knows.)Environment
.db
file created withturso dev --db-file local.db
Manual Query
If I run a SQL query directly, as below, it fails due to CONSTRAINTS.
(It fails for the 3rd column since I gave a string with length of 3
EMDNumber TEXT NOT NULL CHECK (length(EMDNumber) = 5),
)Using
database/sql
However, if i use
database/sql
'sdb.Exec
, no error occurs.Also,
sql.Result
returns 0 rows affected, meaning that theINSERT
operation failed.The text was updated successfully, but these errors were encountered: