Closed miellaby closed 7 years ago
why do you send undefined in the first place? what's your use case?
For example. The 'default' keyword of SQL consists in setting a default value for an INSERT when the user doesn't provide an input value, right? So, if a given value is undefined (that is missing) in a JS user-input object for such an INSERT statement, it would be nice if it works accordingly to the underlying principle, that is like a SQL 'null'.
Practically, managing undefined values in dbLite will allow us to write a very light REST API where we may directly give the request parameters object to dbLite. We consequently relay on SQL to check the request input and enforce type consistency. SQL does it for us, by refusing non-compatible or missing data values.
By the way, the "throw new Error()" breaks dbLite's resilience. It is not caught by the calling function, so the "SELECT secret_stuff" doesn't occur and the query queue gets definitely broken.
not sure you're still interested in this bug but I've pushed 0.8
to fix it.
Everything is in the title.
I had to edit
escape(what)
function to manage undefinedwhat.
Without this patch, a missing parameter hangs the query queue because of