Closed MadCatX closed 7 months ago
There's a Discussions tab for these type of questions now.
Any ideas?
Provide a minimal repro that we can run.
I did check that the
name
property of thetable
object is sensible and that the actual query looks like, say,DELETE FROM users
I don't quite believe that, it looks like you are interpolating an object somewhere, producing DELETE FROM [object Object];
sqlite> DELETE FROM [object Object];
Parse error: no such table: object Object
I can't seem to repro this with a trivial case so providing an actual MWE will be tricky.
I did check that the
name
property of thetable
object is sensible and that the actual query looks like, say,DELETE FROM users
I don't quite believe that, it looks like you are interpolating an object somewhere, producing
DELETE FROM [object Object];
sqlite> DELETE FROM [object Object]; Parse error: no such table: object Object
That is not the error message I'm getting. main.object Object
is not the same thing as object Object
. Furthermore, I get the same error even if I hardcode the name of the table into the statement.
In fact, if I execute DELETE FROM non_existent_table
I get a correct error message. If I replace non_existent_table
with a table that actually exists, I get main.object Object
in the error string.
As far as I can tell, the source of the error is somewhere in the sqlite3Parser()
function when sqlite3 reaches the null terminator of the query string. AFAICT, something odd happens in sqlite3GenerateRowDelete()
function so it might actually be a sqlite3 issue.
Never mind, I traced the problem to an awkward foreign key issue in my code for which SQLite does not provide very good error message. Closing.
This is a bizarre one.
My application suddenly stopped working, throwing an SqliteError. Further inspection told me that the exception with
no such table: main.object Object
message get thrown when my code tries to prepare aDELETE
statement.The simplest code that can produce the error is this:
I did check that the
name
property of thetable
object is sensible and that the actual query looks like, say,DELETE FROM users
The last place I can get with node debugger before the
SqliteError
gets thrown in theprepare
function fromwrappers.js
AFAICT, everything looks perfectly reasonable when the internal
prepare
function gets called.I am using similar code to execute
SELECT
s andINSERT
s with no issues. I did rebuildbetter_sqlite3.node
manually to make sure I was not seeing any odd incompatibility issues.Any ideas?