siuying / NanoStoreInMotion

RubyMotion wrapper for NanoStore, a lightweight schema-less key-value document database based on sqlite.
Other
103 stars 24 forks source link

Single quotes not escaped properly in .find #20

Closed djcp closed 11 years ago

djcp commented 11 years ago

Nice work! We're running into an issue, though, where it appears that single quotes aren't being escaped properly when passed to Model.find.

   Model.find(name: "I don't work properly")

throws an error that ultimately results in a SQLite error code 1.

   Model.find(name: "I don''t work properly")

Works properly, note the second single quote escaping the first.

djcp commented 11 years ago

Interestingly, we could insert names with a single quote without issue, it was just querying for them afterwards that blew up.

siuying commented 11 years ago

Confirmed the issue. I created an issue on NanoStore (https://github.com/tciuro/NanoStore/issues/45)

siuying commented 11 years ago

Thanks for report. NanoStore 2.1.8 + latest nano-store gem fix the issue.

https://github.com/siuying/NanoStoreInMotion/compare/v0.5.0%E2%80%A6v0.5.1