There is still a bit more work necessary to easily use PostgreSQL arrays with models, but this at least makes it easy for datasets. Unlike the sequel_column_type_array extension, this supports more types of arrays, as well as multi-dimensional arrays. As far as I know, it's the only ruby parser that supports multi-dimensional string arrays. The string array parser is probably fairly slow, I may add a ragel-based parser to sequel_pg later if people are finding it to be a bottleneck (send ruby-prof output with your request).
Anyway, if you are a PostgreSQL array user, please give this new extension a shot. I'll be expanding on it to make it work nicely with models, and probably add another extension that makes it possible to use array operators without dropping to literal SQL.
> There is still a bit more work necessary to easily use PostgreSQL arrays > with models, but this at least makes it easy for datasets. Unlike the > sequel_column_type_array extension, this supports more types of arrays, as > well as multi-dimensional arrays. As far as I know, it's the only ruby > parser that supports multi-dimensional string arrays. The string array > parser is probably fairly slow, I may add a ragel-based parser to sequel_pg > later if people are finding it to be a bottleneck (send ruby-prof output > with your request).
> Anyway, if you are a PostgreSQL array user, please give this new extension a > shot. I'll be expanding on it to make it work nicely with models, and > probably add another extension that makes it possible to use array operators > without dropping to literal SQL.
> Thanks, > Jeremy
fantastic! now that hstore is a proper extension in 9.1, i'd love to revisit the work i did on that and get it merged in. i'll try and make some time on thursday to talk.
-p
-- Peter van Hardenberg San Francisco, California "Everything was beautiful, and nothing hurt." -- Kurt Vonnegut
>> There is still a bit more work necessary to easily use PostgreSQL arrays >> with models, but this at least makes it easy for datasets. Unlike the >> sequel_column_type_array extension, this supports more types of arrays, as >> well as multi-dimensional arrays. As far as I know, it's the only ruby >> parser that supports multi-dimensional string arrays. The string array >> parser is probably fairly slow, I may add a ragel-based parser to sequel_pg >> later if people are finding it to be a bottleneck (send ruby-prof output >> with your request).
>> Anyway, if you are a PostgreSQL array user, please give this new extension a >> shot. I'll be expanding on it to make it work nicely with models, and >> probably add another extension that makes it possible to use array operators >> without dropping to literal SQL.
Oh cool! I was writing array values manually as literals, and also parsing them out manually from the string. I only store ints or floats in my arrays for now.
> > > There is still a bit more work necessary to easily use PostgreSQL arrays > > > with models, but this at least makes it easy for datasets. Unlike the > > > sequel_column_type_array extension, this supports more types of arrays, as > > > well as multi-dimensional arrays. As far as I know, it's the only ruby > > > parser that supports multi-dimensional string arrays. The string array > > > parser is probably fairly slow, I may add a ragel-based parser to sequel_pg > > > later if people are finding it to be a bottleneck (send ruby-prof output > > > with your request).
> > > Anyway, if you are a PostgreSQL array user, please give this new extension a > > > shot. I'll be expanding on it to make it work nicely with models, and > > > probably add another extension that makes it possible to use array operators > > > without dropping to literal SQL.
> > > 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 sequel-talk@googlegroups.com (mailto:sequel-talk@googlegroups.com). > To unsubscribe from this group, send email to sequel-talk+unsubscribe@googlegroups.com (mailto:sequel-talk+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
On Wednesday, March 7, 2012 12:29:57 AM UTC-8, Peter van Hardenberg wrote: > fantastic! now that hstore is a proper extension in 9.1, i'd love to > revisit the work i did on that and get it merged in. i'll try and make > some time on thursday to talk.
That's actually next on my list after I finish up the array support. :) Let's talk tomorrow and get the details worked out. When I looked over sequel-hstore last night, there were just a few significant changes I was considering:
* Hash keys should be strings, not symbols * HStore should be a DelegateClass of Hash, not a subclass * Make Hstore#[]= convert input key and value to strings before storing * Consider using the default proc of {|h,k| h[k.to_s]} for the hash so that you can access values with symbols even though they are stored as strings * Refactor the parsing somewhat
On Wed, Mar 7, 2012 at 10:04 AM, Jeremy Evans <jeremyeva...@gmail.com> wrote: > On Wednesday, March 7, 2012 12:29:57 AM UTC-8, Peter van Hardenberg wrote:
> * Hash keys should be strings, not symbols
agreed
> * HStore should be a DelegateClass of Hash, not a subclass
agreed
> * Make Hstore#[]= convert input key and value to strings before storing
i'm iffy on this...
> * Consider using the default proc of {|h,k| h[k.to_s]} for the hash so that > you can access values with symbols even though they are stored as strings
... but if this is done i'm less concerned.
> * Refactor the parsing somewhat
glad to help here
-- Peter van Hardenberg San Francisco, California "Everything was beautiful, and nothing hurt." -- Kurt Vonnegut
> There is still a bit more work necessary to easily use PostgreSQL arrays
> with models, but this at least makes it easy for datasets. Unlike the
> sequel_column_type_array extension, this supports more types of arrays, as
> well as multi-dimensional arrays. As far as I know, it's the only ruby
> parser that supports multi-dimensional string arrays. The string array
> parser is probably fairly slow, I may add a ragel-based parser to sequel_pg
> later if people are finding it to be a bottleneck (send ruby-prof output
> with your request).
> Anyway, if you are a PostgreSQL array user, please give this new extension
> a shot. I'll be expanding on it to make it work nicely with models, and
> probably add another extension that makes it possible to use array
> operators without dropping to literal SQL.
> There is still a bit more work necessary to easily use PostgreSQL arrays > with models, but this at least makes it easy for datasets. Unlike the > sequel_column_type_array extension, this supports more types of arrays, as > well as multi-dimensional arrays. As far as I know, it's the only ruby > parser that supports multi-dimensional string arrays. The string array > parser is probably fairly slow, I may add a ragel-based parser to sequel_pg > later if people are finding it to be a bottleneck (send ruby-prof output > with your request).
> Anyway, if you are a PostgreSQL array user, please give this new extension > a shot. I'll be expanding on it to make it work nicely with models, and > probably add another extension that makes it possible to use array > operators without dropping to literal SQL.
On Wednesday, March 7, 2012 10:04:12 AM UTC-8, Jeremy Evans wrote:
> On Wednesday, March 7, 2012 12:29:57 AM UTC-8, Peter van Hardenberg wrote:
>> fantastic! now that hstore is a proper extension in 9.1, i'd love to >> revisit the work i did on that and get it merged in. i'll try and make >> some time on thursday to talk.
> That's actually next on my list after I finish up the array support. :)
On Mon, Mar 12, 2012 at 3:28 PM, Jeremy Evans <jeremyeva...@gmail.com> wrote:
> On Wednesday, March 7, 2012 10:04:12 AM UTC-8, Jeremy Evans wrote:
>> On Wednesday, March 7, 2012 12:29:57 AM UTC-8, Peter van Hardenberg wrote:
>>> fantastic! now that hstore is a proper extension in 9.1, i'd love to >>> revisit the work i did on that and get it merged in. i'll try and make >>> some time on thursday to talk.
>> That's actually next on my list after I finish up the array support. :)
> To post to this group, send email to sequel-talk@googlegroups.com. > To unsubscribe from this group, send email to > sequel-talk+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sequel-talk?hl=en.
-- Peter van Hardenberg San Francisco, California "Everything was beautiful, and nothing hurt." -- Kurt Vonnegut
On Monday, March 12, 2012 3:28:57 PM UTC-7, Jeremy Evans wrote:
> On Wednesday, March 7, 2012 10:04:12 AM UTC-8, Jeremy Evans wrote:
>> On Wednesday, March 7, 2012 12:29:57 AM UTC-8, Peter van Hardenberg wrote:
>>> fantastic! now that hstore is a proper extension in 9.1, i'd love to >>> revisit the work i did on that and get it merged in. i'll try and make >>> some time on thursday to talk.
>> That's actually next on my list after I finish up the array support. :)