On Friday, March 20, 2015 at 2:44:42 PM UTC-7, Elijah Zupancic wrote:
>
> I am using the PostgreSQL citext extension (
> http://www.postgresql.org/docs/9.4/static/citext.html). Sequel doesn't 
> support citext arrays out of the box, so I've created an extension that 
> handles them. There are a few questions that I'm trying to work through 
> before I post a pull request.
>
>    - Should this be a core extension like pg_array? Or is best as an 
>    external extension?
>
> Other users have expressed interested in this in the past, so I'd 
certainly consider shipping such an extension with Sequel.

>
>    - How should I structure the unit tests for it? I see that pg_array 
>    doesn't have tests that actually hit the database (please correct me if I 
>    am wrong). For the pg_citext plugin, we have to connect to the database in 
>    order to make sure that the soid and oid bindings are working correctly. 
>    What's the best place to put those tests? In the spec/extensions directory?
>
> All core/model/extension/plugin specs run against a mock database.  For 
pg_* extensions, there should also be postgres adapter specs to make sure 
it actually works with a real database.  But those are in addition to the 
extension specs, not instead of the extension specs.  See the specs for the 
pg_hstore extension:

Extension: 
https://github.com/jeremyevans/sequel/blob/master/spec/extensions/pg_hstore_spec.rb
Adapter: 
https://github.com/jeremyevans/sequel/blob/master/spec/adapters/postgres_spec.rb
 

> I've been using the underlying code for this extension for close to a year 
> in production with no problems. However, there is one feature of it that 
> I'm not happy about - it runs a query whenever a new connection is opened 
> in order to determine the soid and oid of the citext type on a given 
> database.
>

You should be able to set it up so this only happens once for each Database 
object (when the extension is loaded into the database), not once for each 
connection. That's how pg_hstore works.
 

> I've made a fork and I'm working on a pull request here: 
> https://github.com/dekobon/sequel
>

I'll try to review the code this weekend when I have more time.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to