On Dec 12, 4:02 pm, entropy <[email protected]> wrote:
> Hi,
>
> I'm using Sequel directly from Jeremy Evan's github repository (as at
> 2.8.0) and
>
> I have the following code:
>
>       Model::Note.create(
>         :creator => person,
>         :created => 'NOW()'.lit,
>         :content => "I'm broken" )
>
> Shouldn't the apostrophe be escaped?

Looks like going to standard strings doesn't work with postgres-pr, as
it tries to escape apostrophes with backslashes.  That's a bug that
should be fixed in postgres-pr (postgres-compat.rb, line 40).
postgres-pr even has a "TODO: correct?" comment directly above that
line, so they obviously weren't sure.  Please report this bug to the
postgres-pr maintainer.

You could try turning standard strings off as a work around.
Alternatively, override the escape method to double the apostrophe
instead of escaping it with a backslash.  If you want to work on a
patch that does this automatically (and doesn't negatively affect the
use with ruby-postgres or ruby-pg), I'd be interested in applying it.
You also could upgrade to ruby-pg, that's the best supported postgres
driver with Sequel, as that's the one I run my applications with.  I
do test with postgres-pr on JRuby with the postgres spec and
integration tests, but I guess we don't have a test case that covers
this.  If you want to add an integration test case that uses an
apostrophe, I'd apply it.

Thanks,
Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to