I've just pushed 2 new extensions into Sequel, pg_auto_parameterization and 
pg_statement_cache.  Both of these are only compatible with Sequel's 
postgres adapter and the pg driver backend. pg_auto_parameterization makes 
Sequel to take string, numeric, and date/time arguments used in queries and 
treat them as query parameters into of literalizing them into the SQL 
query.  pg_statement_cache implements a per-connection modified-LRU cache 
of statements, which are prepared on the server if they are used multiple 
times.  The net result is that when the two extensions are used together, 
it can turn code like this:

    1000.times{|i| DB[:table].where(:column=>i).all}

Into a statement that is prepared once and executed 1000 times with 
separate arguments.

Both extensions have corner cases associated with them, most notably the 
need to add casting in certain cases where none was previously needed, but 
after modifying 8 separate applications to use these new features, the only 
spec failures were casting related, and adding the casts manually was 
pretty trivial.

Anyway, if you use Sequel's postgres adapter with pg, please give these new 
extensions a shot and let me know how it works out.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sequel-talk/-/H4mv621ZNG4J.
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