-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: add support for Hasura #72407
Copy link
Copy link
Closed
Labels
A-tools-hasuraC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)meta-issueContains a list of several other issues.Contains a list of several other issues.
Description
For anyone pursuing updates here, last I've heard is that Hasura is currently working towards making integrations with other databases easier. As soon as we can get any update, we'll look to get the ball moving on this again.
We know we have some features that we need to implement (and are looking to get a lot of these done in the next 6-12 months!) and we hope we can get this working for all of you soon!
Prototype branches
- CockroachDB: master...otan-cockroach:ext / [wip] hasura integration #76197
- Hasura: hasura/graphql-engine@master...otan-cockroach:crdb
List of needed changes so far:
- (Hasura workaround possible) User-defined functions are needed for
hasura_gen_uuid()andinsert_event_log. (hasura/graphql-engine@af13f96) - (Hasura workaround possible?) We do not support the
ON CONFLICT ((expr))clause (hasura/graphql-engine@dfab446) -- sql: support expressions as ON CONFLICT targets #67893 - (Hasura workaround possible?) We do not support
ON UPDATE SKIP LOCKED(hasura/graphql-engine@35366c1) -- sql: supportFOR {UPDATE,SHARE} {SKIP LOCKED,NOWAIT}#40476 - (Hasura workaround possible) We do not support aliasing tables to
index, but PG does (hasura/graphql-engine@0439afe) - (Hasura workaround possible but CockroachDB fix possible) We need to feign support for pgcrypto, or make hasura not check for it (d09ea03). We support some of the pgcrypto builtins, but we'll have to check if the other ones are needed to. See CRDB-120.
- (Hasura workaround doable for someone versed at Haskell; CockroachDB proper fix labour intensive + major behaviour change which is backwards compat) We do not support the JSON type (we convert everything to JSONB automatically). Hasura relies on JSON wire format, which means I needed to make these scary changes to CRDB as a quick hack to pretend we write json. (63041ba, e64bc44) Hasura relies on
AltJ/ their own thing I don't totally grok to do this decoding, not sure how to change it (it's their own homegrown library: https://github.com/hasura/pg-client-hs). Hasura needs to recognise the "1" at the front is just part of the binary protocol. (see "unknown oid type: 114" when sending JSON data in wire format #88355) - (CockroachDB issue)This query finishes in 20mins on CRDB: https://gist.github.com/otan/498fc5fef15f6147be5ae1f429ca146f. Root cause is
pg_catalog.col_descriptionwhich is slow. disabled. hasura/graphql-engine@5da773c (seepg_catalog.col_descriptionis very slow #87947) - (CockroachDB issue) CockroachDB does not support
pg_get_functiondef. We should return NULL. hasura/graphql-engine@74159c2 - (CockroachDB issue) need to add
--skip-schema-setupto pytest command, becausedrop schema if exists hge_tests cascade; create schema hge_tests;in the same txn doesn't work. - (Hasura issue) psycopg on Hasura doesn't recognise CockroachDB - see 5349071
At present time, I have the Haskell engine up, but the pytest has UDFs all over the test suite. Impossible to get around - we need to implement them or the Hasura suite needs to not use them.
Epic CRDB-11916
Jira issue: CRDB-11915
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-tools-hasuraC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)meta-issueContains a list of several other issues.Contains a list of several other issues.