-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with booleans #45
Comments
@rulatir I added a check for boolean but i am not sure if this is handled properly at the sqlite level. From what I see there is no boolean type column... Anyway ... try it and let me know what you find... |
I don't think there's anything left to be done with Blob other than an existence check to avoid exception. If there is no Blob on the platform then the app won't be storing Blobs, period. |
SQLite does not distinguish booleans from ints. So you can just use bind_int. The only real storage classes are NULL, INTEGER, REAL, TEXT, and BLOB. So I suppose the option would be to convert a JS boolean type to int and use 0/1 in the database...you would get 0/1 in result set as well... |
At line 421:
If it is neither
null
nor0
nornumber
norstring
butboolean
, then thev instanceof Blob
condition is evaluated. There is no Blob in React Native (at least on Android), so this throws, but the exception is caught somewhere down the stack and converted to console warning (took a while to notice!) w/o fixing the problem.Shimming Blob = function(){} seems to quickfix the exception but doesn't really help handle booleans. WebSQL is supposed to be able to store booleans but the code above will probably end up storing strings
"true"
and"false"
, which will both evaluate to true to an application that expects actual booleans returned from the database.The text was updated successfully, but these errors were encountered: