Skip to content

Add array and Hstore as first-class objects. - #144

Closed
matinm wants to merge 6 commits into
brianc:masterfrom
matinm:master
Closed

Add array and Hstore as first-class objects.#144
matinm wants to merge 6 commits into
brianc:masterfrom
matinm:master

Conversation

@matinm

@matinm matinm commented Oct 6, 2013

Copy link
Copy Markdown
Contributor
  • Added array literals:
// SELECT ARRAY[1, 2, 3] FROM post
post.select(sql.array(1,2,3)).toString();
  • Added array slicing:
// SELECT (ARRAY[1, 2, 3])[2:3] FROM "post"
post.select(sql.array(1,2,3).slice(2,3)).toString();
  • Added array indexing:
// SELECT (ARRAY[1, 2, 3])[2] FROM "post"
post.select(sql.array(1,2,3).at(2)).toString();
  • Added Hstore key accessor -> operator:
// SELECT ("post"."metadata" -> 'age') FROM "post"
post.select(post.metadata.key('age'))
  • Added Hstore/array concat operator ||:
// SELECT ARRAY[1] || HSTORE(x,2) -> 'x' FROM "post"
post.select(sql.array(1).concat(Sql.functions.HSTORE('x',2).key('x'))).toString();

@matinm matinm closed this Oct 6, 2013
@brianc

brianc commented Oct 14, 2013

Copy link
Copy Markdown
Owner

hmm...how come you closed this? Unhappy with the implmentation?

@matinm

matinm commented Oct 14, 2013

Copy link
Copy Markdown
Contributor Author

No, I had submitted this PR from the wrong branch. I re-submitted the PR
from the correct branch, and you merged it in, so all is good now!

On Monday, October 14, 2013, Brian C wrote:

hmm...how come you closed this? Unhappy with the implmentation?


Reply to this email directly or view it on GitHubhttps://github.com//pull/144#issuecomment-26272914
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants