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

In reference to issue #276 on dm-core - untested #87

Closed
wants to merge 1 commit into from
Closed

In reference to issue #276 on dm-core - untested #87

wants to merge 1 commit into from

Conversation

boazsegev
Copy link

in this issue "Booleans are always stored as false in SQLite", FeeJai stated that:

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.

I have no idea if this statement is correct, it could be a specific installation or environment issue that only applies to FeeJai... I'm just forwarding his request for a fix and fulfilling his request that I try and help.

This proposed pull request is a GUESS about the source of the issue (assuming it isn't an issue with FeeJai's specific environment), I can't test it on my machine.

Please have a look.

in this issue ["Booleans are always stored as false in SQLite"](datamapper/dm-core#276), FeeJai stated that:

>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.

I have no idea if this statement is correct, it could be a specific installation or environment issue that only applies to FeeJai... I'm just forwarding his request for a fix and fulfilling his request that I try and help.

This proposed pull request is a GUESS about the source of the issue (assuming it isn't an issue with FeeJai's specific environment), I can't test it on my machine.

Please have a look.
@dbussink
Copy link
Contributor

First of all thanks for the contribution, but I'm going to have to reject it. SQLite has no concept of a boolean type, so the only way is to pick a convention. Right now that convention is a t or f. The quotes removed here are not the right approach, since the explicit goal of this method is to return a quoted string. As you can also see in the tests, this breaks the designed behavior.

There are tests that verify that a t comes back as boolean so the problem is not likely to be inside DO. The problem in datamapper/dm-core#276 is likely somewhere in DataMapper, but it's hard to identify it without a script that reproduces the problem.

@dbussink dbussink closed this Nov 17, 2015
@boazsegev
Copy link
Author

Thanks for the detailed response and for taking the time to review the issue.

I hope someone manages to track down the issue, as DM is a great library.

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

Successfully merging this pull request may close these issues.

2 participants