Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Booleans are always stored as false in SQLite #276

Open
FeeJai opened this issue Jan 16, 2015 · 4 comments
Open

Booleans are always stored as false in SQLite #276

FeeJai opened this issue Jan 16, 2015 · 4 comments

Comments

@FeeJai
Copy link

FeeJai commented Jan 16, 2015

Hey there!
I am sorry that I can not offer a pull request, I just don't understand data mapper well enough.
With the SQLite adapter, Booleans are transformed to 't' and 'f' in the queries. These string values are typecasted to false by sqlite. So datamapper persists the wrong values.
Please help me fix that.

@boazsegev
Copy link

Seems to me that would be an adapter issue and should be moved to the adapter's repository.

@FeeJai
Copy link
Author

FeeJai commented Oct 26, 2015

That makes sense to me. Unfortunately I have no idea how to fix it in the adapter code. Do you think you could help me with it?

@boazsegev
Copy link

I have no idea what adapter you're using for Sqlite... but, searching around I found this repository, which is actually an FFI (foreign language interface) with both C and Java code behind it.

It seems the code in question might be here... there are single quotes inside the double quotes and that might (or might not) be the issue... but I'm just passing by and I know nothing about any of this.

Anyway, I opened a pull request to suggest someone looks this over.

I hope this helps and that I did;t make a mess of things. If the issue is something specific on your machine or in your code (like you manually using 't' and 'f' instead of true and false) than I hope this will get things rolling.

@tpitale
Copy link
Member

tpitale commented May 24, 2016

@FeeJai I'd need more information about which gems you're using, and on which version of Ruby. I can't seem to reproduce this behavior. Can you provide more information about what you're doing?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants