Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native support for postgres array types (close #348) #2243

Closed
wants to merge 19 commits into from

Conversation

rakeshkky
Copy link
Member

Description

TODO:- [console] support new input types format (json) for functions.

Allows following types of queries

query q {
  bar: foo (where: { a : { _contained_in : [1,2,3,4,5,6,7,8]  }} ) {
    a
  }

  baz: foo (where: { a : { _contains : [1,2,3,4] }} ) {
    a
  } 
}

And the following mutations with array

mutation m {
  insert_foo ( objects: [ {a: [1,3,5,7,9] } ]){
    affected_rows
    returning {
      a 
      id
    }
  }
}

Support _preprend and _append operators in updating array columns

Affected components

  • Server
  • Tests
  • Console

Related Issues

#348
#349

Solution and Design

  • PGColType is modified to support postgres types
  • PGColValue is modified to parse json values according to new PGColType
  • hdb_type_info view is added to hdb_catalog schema to list all types with details
  • catalog version bump

Steps to test and verify

Limitations, known bugs & workarounds

@rakeshkky rakeshkky added c/console Related to console c/server Related to server labels May 21, 2019
@rakeshkky rakeshkky requested a review from 0x777 as a code owner May 21, 2019 12:10
@rakeshkky rakeshkky self-assigned this May 21, 2019
@netlify
Copy link

netlify bot commented May 21, 2019

Deploy preview for hasura-docs ready!

Built with commit 8d3af1d

https://deploy-preview-2243--hasura-docs.netlify.com

@hasura-bot
Copy link
Contributor

Review app for commit c392da4 deployed to Heroku: https://hge-ci-pull-2243.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2243-c392da48

@hasura-bot
Copy link
Contributor

Review app for commit d80ac18 deployed to Heroku: https://hge-ci-pull-2243.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2243-d80ac185

@hasura-bot
Copy link
Contributor

Review app for commit 0daab14 deployed to Heroku: https://hge-ci-pull-2243.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2243-0daab141

@dsandip dsandip self-requested a review May 31, 2019 06:23
Resolve Conflicts:
	server/src-lib/Hasura/GraphQL/Schema.hs
	server/src-lib/Hasura/RQL/DDL/Schema/Diff.hs
	server/src-lib/Hasura/RQL/Types/Catalog.hs
@dsandip
Copy link
Member

dsandip commented Jul 23, 2019

@jberryman some more context on this https://hasurahq.slack.com/archives/CKFUG6RCH/p1562793618269300

Also, figure out what to do with enums

@cthurston
Copy link

cthurston commented Oct 1, 2019

Will this patch allow for array relationships to be defined from a uuid[] array field?

The gui allowed me to define a relationship from a uuid[] field to another table, but when I attempted to use the relationship in a query:

    "hint": "No operator matches the given name and argument type(s). You might need to add explicit type casts.",
     "message": "operator does not exist: uuid[] = uuid",

@andrewalex
Copy link

Also related (From the permissions side) #2882

@himat
Copy link

himat commented Apr 22, 2020

What is the status of this?

@karibertils
Copy link

Looking forward to this one

@maxcan
Copy link

maxcan commented Jul 31, 2020

Is it safe to assume that this current PR is dead? @marionschleifer, @0x777 any idea if native array support will be on the roadmap soon?

My hasura instances are littered with array sub tables since I prefer the strict type safety that gives me over JSONB fields.

@s-kris
Copy link

s-kris commented Aug 3, 2020

Looking forward to this

@0x777
Copy link
Member

0x777 commented Aug 4, 2020

Hey folks, I'm sorry about letting this PR go stale (preserving backwards compatibility with the above changes is very hard). Over the past few weeks, we've been working on some changes to the codebase that'll help us improve the speed at which we can implement new features. As soon as we are done with it, we'll pick up these PRs.

@maxcan
Copy link

maxcan commented Aug 5, 2020

@0x777 appreciate the update! thanks!

@michael-land
Copy link

What is the status of this?

@maxcan
Copy link

maxcan commented Jan 22, 2021

@coco98 ?

@axhl
Copy link

axhl commented Aug 9, 2021

Any updates on where this sits on the roadmap? Lots of folks are excited about it: #348

@michael-land
Copy link

what makes it so hard to get merge/implement? it's more than 2 years since the PR created.

@Fi1osof
Copy link

Fi1osof commented Nov 30, 2021

2021 year. Still waiting for.

UPD: can do like this:

query  {
  product_stats (
    args:{
      ids: "{id1, id2}"
    }
  ) {
    id
    total
  }
}

@karibertils
Copy link

2022 and still waiting

@sassela
Copy link
Contributor

sassela commented Jul 11, 2022

closing this stale PR in favour of the original tracking issue #348

@sassela sassela closed this Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/console Related to console c/server Related to server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet