[DBIx-Class-Devel] [sql-abstract] Custom methods for HSTORE and ANY ( method ) in psql (#2)

Peter Rabbitson notifications at github.com
Mon Jan 12 16:14:00 GMT 2015


Hi @dinesh-it, @timbunce,

Sorry for dropping the ball on this, github did not notify me (yet again) of activity post-close. This PR was dealing with two things - ANY and HSTORE, which I will address separately.

For `ANY` there is no need to add anything - it is covered by the current "generic operator" support:

```
rabbit at Ahasver:~$ perl -MSQL::Abstract -MDevel::Dwarn -e 'Dwarn [ SQL::Abstract->new->where({ Group => { -any => { -ident => "Prepay" } } }) ]'
[
  " WHERE ( Group ANY Prepay )"
]
rabbit at Ahasver:~$ perl -MSQL::Abstract -MDevel::Dwarn -e 'Dwarn [ SQL::Abstract->new->where({ Group => { -any => "Prepay" } }) ]'
[
  " WHERE ( Group ANY ? )",
  "Prepay"
]
```

For HSTORE implementing `->` alone and giving it an arbitrary name of `inhstore` seems a bit shortsighted to me from an API-design standpoint. I think any future work needs to strive to cover the entire [gamut of currently supported operators](http://www.postgresql.org/docs/9.4/static/hstore.html#HSTORE-OP-TABLE) with an option open to future expansion.

Furthermore given how this is at this point firmly Postgres-only syntax (following their decision to repurpose `?`), its best implementation venue would be a subclass of `DBIx::Class::SQLMaker` settable post-connect, or something like that. 

These are just superficial thoughts off-the-cuff. I have never used HSTORE personally, hence do not have much to add in terms of design advice.

---
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/sql-abstract/pull/2#issuecomment-69594752
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20150112/9e072c29/attachment-0001.htm>


More information about the DBIx-Class-Devel mailing list