On Sep 16, 4:02 pm, Jeremy Evans <[email protected]> wrote: > On Sep 16, 3:06 pm, Joe Van Dyk <[email protected]> wrote: > > > Fromhttp://sequel.rubyforge.org/rdoc/files/doc/prepared_statements_rdoc.html > > > "PostgreSQL > > If you are using the ruby-postgres or postgres-pr driver, PostgreSQL > > uses the default emulated support. If you are using ruby-pg, there is > > native support, but it may require type specifiers. This is easy if > > you have direct control over the SQL string, but since Sequel > > abstracts that, the types can be specified another way. This is done > > by adding a __* suffix to the placeholder symbol (e.g. :$name__text, > > which will be compiled to “$1::text” in the SQL). Prepared statements > > are always server side." > > When I originally added the support, I think the casting was > necessary. It's no longer necessary (at least in my testing), so I > removed it from the tests. For backwards compatibility, it will still > work. > > > What's meant by "default emulated support"? Do I care about this? > > Probably not. It's only for adapters that don't support native > prepared statements.
So there's no need to use the __type names anymore? I'm still a little confused. http://www.postgresql.org/docs/9.0/static/sql-prepare.html uses the 'prepare' and 'execute' statements. Whereas when I use Sequel with DB[:orders] filter(:email_address => :$email). prepare(:select, :select_by_email) DB.call(:select_by_email, :email => '[email protected]') In the postgresql logs, I see a 'parse', then a 'bind' and an 'execute'. I don't see a 'prepare' statement in there. Should I? -- 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.
