How could I extend this method?
https://github.com/sparklemotion/sqlite3-ruby/blob/b6a9d731c2004d96e6b458c661d156b6a94a4f58/lib/sqlite3/translator.rb#L94-L104
I'd like to be able to add new synonyms for "false" here, so that I could support a legacy data structure that insists on using 'Y' and 'N'.
The code as written should work for your use case: "N" will match the last comparison so the result will be false, "Y" won't match anything so will be true. Have you tried it?
Yes, I can see that would work. But in my case, I really need the result (in the database) to be capital Y or capital N, because the SQLite version is just a test double for an Oracle version, where those two characters are the only allowed values at the SQL level. I've had to settle for a one-character string field without any sort of type-mapping (it doesn't "know" it's a boolean) and that means that any of my affordances for asserting that it's true or false have to be hand-built.
Hi @walterdavis, sorry I haven't commented on this. We actually removed the translator code in preparation for the 2.0.0 release, so my recommendation to you is to make a proxy object for the result set that does any translation you need.
Sorry about that, and thanks for understanding 🙇