Commit Graph

511 Commits

Author SHA1 Message Date
Lyndon Maydwell
4d2e37b3e6 Raw Query Support for Data Connectors - GDW-394
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5890
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: f6bd2ed5fe170bcce262564cf4f45c95c9bdff94
2022-09-22 21:09:06 +00:00
Tom Harding
e71496efa5 Replace Hasura.RQL.Types.Numeric with refined
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5913
GitOrigin-RevId: 96e218229a08dfbc5a598d709be1ee2083d41ec6
2022-09-21 18:03:04 +00:00
Tom Harding
8dcc8f8fca Implement aggregation tests for hspec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5960
GitOrigin-RevId: bac9bae3ea39c005f0e7b9c5f7864f012d395ebb
2022-09-20 15:23:46 +00:00
Daniel Chambers
5c06eb7a3e Remove duplicated Data Connector API types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5930
GitOrigin-RevId: 8c11387fa8556c3cdf8c92a0924ae53d31b953a5
2022-09-20 06:20:25 +00:00
Daniel Chambers
04ae6abf78 Exists support in filter expressions for Data Connector queries [GDW-133]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5904
GitOrigin-RevId: 6bad4c29a7d14d3881f9c57fe983d14cc41bdc4b
2022-09-20 04:01:33 +00:00
awjchen
dcca0c6275 server: support 128-bit trace ids
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5905
GitOrigin-RevId: 48a981a432b2e979bc7b42b32f9c7f53ab9e2598
2022-09-20 02:50:06 +00:00
Samir Talwar
6c03eef990 server: Add test cases for inconsistencies upon reloading or replacing the metadata.
I am working on https://github.com/hasura/graphql-engine/issues/8807, and wanted to write a Haskell integration test case to reproduce it.

We have Python integration tests somewhat covering this behavior in *test_inconsistent_meta.py*, but no Haskell tests, so I thought I'd shore up the coverage here by adding a few test cases for working behavior.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5897
GitOrigin-RevId: 21500e530e413feaede5cbd8b4a94b07d25a6260
2022-09-19 18:49:31 +00:00
Solomon
85cfd91908 allow exporting dc-agent test descriptions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5925
GitOrigin-RevId: a508e942c61c775823dff440a37fd8769ca42e21
2022-09-17 02:20:31 +00:00
Abby Sassel
3056678e04 server/postgres: Implement execution of aggregation predicates
PR for the translation / execution step of [aggregation predicate filters](https://github.com/hasura/graphql-engine-mono/issues/5174).

[`translateAVAggregationPredicates`](translateAVAggregationPredicates) is the main change of note, everything else is a supporting or helper function. Please note this doesn't yet include [tests relating to permissions](https://hasurahq.slack.com/archives/C01RZPEPF0W/p1662560092197769); I decided to raise a PR without them for slightly faster feedback. I may include them in this PR or a separately if it's not trivial.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5724
GitOrigin-RevId: fcac258b64066e2bd45108372165a16fd957f5ab
2022-09-16 15:01:03 +00:00
paritosh-08
ab71adc3a0 server, pro: event trigger auto cleanup (increment 3)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5823
Co-authored-by: pranshi06 <85474619+pranshi06@users.noreply.github.com>
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
GitOrigin-RevId: 3d4af905d5df4c05107ad46ef29f4c0a567ff754
2022-09-15 11:46:22 +00:00
David Overton
cbddcce26b Data connector cache invalidations
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5820
GitOrigin-RevId: ded80e378901cc0c0ca12eb67d9264756a8d6ff4
2022-09-14 13:00:47 +00:00
Naveen Naidu
005dbf43cb server: event triggers should be dropped when a previously present source is dropped in replace_metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5739
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
GitOrigin-RevId: 772de8bb6a55a0002885e08a778c16f22ea0b113
2022-09-13 04:18:21 +00:00
Jesse Hallett
b094947239 server: codecs for TableMetadata, FunctionMetadata, and permissions
This PR expands the set of codecs for source metadata to include `TableMetadata`, `FunctionMetadata`, and various permission types. This fills out more detail in the generated OpenAPI document.

See the [generated OpenAPI spec](https://gist.github.com/hallettj/783d06a926cbc854eececa4964e8aa5b) based on this PR.

See also the
[generated TypeScript types](https://github.com/hasura/graphql-engine-mono/files/9448102/client-typescript.tar.gz) based on that spec.

Ticket: https://hasurahq.atlassian.net/browse/MM-66

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5664
GitOrigin-RevId: b6e1f32c669368cd6150e6f69fc36b78b748d9bb
2022-09-12 20:31:07 +00:00
Daniel Harvey
00b1acaf38 tests: JSON and JSONB hspec tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5721
GitOrigin-RevId: dde515a364566aa8d517923281ea670a8decbdd9
2022-09-12 14:17:19 +00:00
Tom Harding
70515d94c7 Extract Hasura.Prelude from src-lib
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5776
GitOrigin-RevId: 0df263a4d800e694e68e31c189c360c88cf48abc
2022-09-09 13:58:48 +00:00
Jesse Hallett
977c624c9e server: prune health check from codecs for backends that don't support it
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5822
GitOrigin-RevId: 637a8c668299409385f340d62fc6a84df5c4aa0f
2022-09-09 13:07:33 +00:00
Samir Talwar
f48c882521 server: Share tests between CircularT and MemoizeT.
This abstracts `CircularT`'s test cases to work against "any" memoizer, and then runs them against `MemoizeT` as well.

Surprisingly (or not), this works without issue; `MemoizeT` passes all tests with a couple of extra instances.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5780
GitOrigin-RevId: 461880caf9220dc3f52d622a22e8b8bcd594e404
2022-09-08 19:38:49 +00:00
Philip Lykke Carlsen
d43a30e8fc feat(tests): Introduce AggregationPredicatesSpec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5686
GitOrigin-RevId: 85b39ad569180929e5620c45bf9a98ef6ee99d42
2022-09-07 12:10:52 +00:00
David Overton
f4419236ed Gdc capabilities scalar types - GDW-87
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5597
GitOrigin-RevId: 4f561bf476266955d7b1d3dbca4d406a97bf8b34
2022-09-06 04:26:03 +00:00
Daniel Harvey
4964ddc6e9 server: skip SOH header in FromCol EncJSON instance
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5710
GitOrigin-RevId: 6065c5b378cd458ad7ea05ce5ca5ff3cee5b13a7
2022-09-05 15:04:32 +00:00
Tom Harding
136349a70a Tidy up simple object query tests, match fixtures to docs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5752
GitOrigin-RevId: 2e308504a188745ad5714d60d0fe449a65d6f950
2022-09-05 11:09:38 +00:00
awjchen
78cf1d544e server/pro: enable health check on data sources and report via logging and API
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4868
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
GitOrigin-RevId: b8d43e3f7d977c4bb37b8506ac87ce7bf289d542
2022-09-02 06:34:29 +00:00
Philip Lykke Carlsen
b0d2262b20 Let the same SQL function serve as both a computed field and as a root field (fixes hasura/graphql-engine#8643)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5676
GitOrigin-RevId: f891e4172504897bb125bb1e524dc75b11e319c1
2022-08-30 15:00:45 +00:00
Daniel Harvey
2e2b894ed3 tests: log everything posted to HGE in hspec tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5636
GitOrigin-RevId: d6bc47857e3ad3c6a995284ba6756a643cfb9c4c
2022-08-30 08:54:04 +00:00
Lyndon Maydwell
88c5b14c3d Adding EXPLAIN endpoint capability and implementation for SQLite data connector agent GDW-181
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5603
GitOrigin-RevId: b9255d265ceb88d96643c95f409387fb93df6676
2022-08-29 03:40:16 +00:00
Solomon
18f9bf481c Fix GDC Metadata API Tests and Typescript Code Generation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5624
GitOrigin-RevId: a595aeb94971a5ee4968b403af4670e06684b708
2022-08-29 00:21:26 +00:00
Auke Booij
99f7a0fb87 Amend console assets versioning scheme for CE
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5628
GitOrigin-RevId: 550cc987a7142f46f4c380d8217fe6ad8ce53fe9
2022-08-26 12:39:16 +00:00
Gil Mizrahi
a35bd278ad server/postgres: fix string literals in arrays
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5634
GitOrigin-RevId: 67970b0c0f10c187c1a4b97d457717e14fdbd2c8
2022-08-26 09:42:26 +00:00
Jesse Hallett
84fd5910b0 server: polymorphic codec for metadata sources
This PR expands the OpenAPI specification generated for metadata to include separate definitions for `SourceMetadata` for each native database type, and for DataConnector.

For the most part the changes add `HasCodec` implementations, and don't modify existing code otherwise.

The generated OpenAPI spec can be used to generate TypeScript definitions that distinguish different source metadata types based on the value of the `kind` properly. There is a problem: because the specified `kind` value for a data connector source is any string, when TypeScript gets a source with a `kind` value of, say, `"postgres"`, it cannot unambiguously determine whether the source is postgres, or a data connector. For example,

```ts
function consumeSourceMetadata(source: SourceMetadata) {
    if (source.kind === "postgres" || source.kind === "pg") {
        // At this point TypeScript infers that `source` is either an instance
        // of `PostgresSourceMetadata`, or `DataconnectorSourceMetadata`. It
        // can't narrow further.
        source
    }
    if (source.kind === "something else") {
        // TypeScript infers that this `source` must be an instance of
        // `DataconnectorSourceMetadata` because `source.kind` does not match
        // any of the other options.
        source
    }
}
```

The simplest way I can think of to fix this would be to add a boolean property to the `SourceMetadata` type along the lines of `isNative` or `isDataConnector`. This could be a field that only exists in serialized data, like the metadata version field. The combination of one of the native database names for `kind`, and a true value for `isNative` would be enough for TypeScript to unambiguously distinguish the source kinds.

But note that in the current state TypeScript is able to reference the short `"pg"` name correctly!

~~Tests are not passing yet due to some discrepancies in DTO serialization vs existing Metadata serialization. I'm working on that.~~

The placeholders that I used for table and function metadata are not compatible with the ordered JSON serialization in use. I think the best solution is to write compatible codecs for those types in another PR. For now I have disabled some DTO tests for this PR.

Here are the generated [OpenAPI spec](https://github.com/hasura/graphql-engine-mono/files/9397333/openapi.tar.gz) based on these changes, and the generated [TypeScript client code](https://github.com/hasura/graphql-engine-mono/files/9397339/client-typescript.tar.gz) based on that spec.

Ticket: [MM-66](https://hasurahq.atlassian.net/browse/MM-66)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5582
GitOrigin-RevId: e1446191c6c832879db04f129daa397a3be03f62
2022-08-25 18:36:02 +00:00
Gil Mizrahi
5aab7e5ce9 add cockroach to docker compose and tests-hspec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5558
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: b7f242939e718d5bb4f22b11c093ae77d21cdcce
2022-08-25 17:18:40 +00:00
Naveen Naidu
dae6cfa9a6 server: enforce event triggers name in a source to be unique
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5394
GitOrigin-RevId: 78015262365985329c18ed25897ca6d6f4422ecb
2022-08-23 08:51:11 +00:00
Philip Lykke Carlsen
4431fb5ea9 Add schema implementation for Aggregation Predicates
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5259
GitOrigin-RevId: f53e310951fa4eb7570006d8c616398a98078632
2022-08-22 15:59:21 +00:00
Daniel Harvey
5a126a693e server: MSSQL varchars compared to nvarchars
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5536
GitOrigin-RevId: ff2e5c9a71dbb02e729b7715d5df752675fc4656
2022-08-22 08:34:41 +00:00
Tom Harding
4a9da49f8d Move ArrayParamPermissionSpec under Postgres
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5492
GitOrigin-RevId: f9f002934acdb9cb9eb82772969663983de05a23
2022-08-19 16:13:07 +00:00
Philip Lykke Carlsen
0e921ca9a5 Define IR types for AggregationPredicates.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5258
GitOrigin-RevId: 172b9de69f44635c5700b3f75ce17304ec56c18a
2022-08-19 15:41:47 +00:00
Tom Harding
283d51668f Move BackendOnlyPermissionsSpec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5539
GitOrigin-RevId: 96851c840ea945af250c8eb876ea183b8384f5d9
2022-08-19 12:59:03 +00:00
Daniel Chambers
ef0ca7dea2 server: Data Connectors support for ordering by related table column and aggregates [GDW-126]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5478
GitOrigin-RevId: 269d33d48f7d41efc7ab4ac6efd9442c6741d08c
2022-08-19 07:01:52 +00:00
Brandon Simmons
4be1ca758d Add allocation counter to trace spans and trace metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5208
GitOrigin-RevId: c0197e69986109db73fa0734b5a093a5e7f0c2e3
2022-08-18 21:57:59 +00:00
Tom Harding
dea80bfac7 Refactor the InsertDefaultsSpec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5534
GitOrigin-RevId: b5434dbaf86315b77cf9c5ed9d61f80e87c7fc64
2022-08-18 18:16:26 +00:00
Evie Ciobanu
1e48af2d03 server/nada: add unit tests for Postgres insert SQL generation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5543
GitOrigin-RevId: 55646f653926559f1847aa692d3522627a463d25
2022-08-18 10:44:32 +00:00
Evie Ciobanu
56f2501ab9 server/nada: minor refactoring around SQL-generation unit tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5524
GitOrigin-RevId: a9f1bcf66f731829c48cb6ced5d968c2e2f4ae80
2022-08-18 09:01:07 +00:00
Solomon
7a2352dd6e Introduce GDC Add/Remove Agent and List Source Kinds Metadata API Actions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5415
GitOrigin-RevId: b46f928eae85a747378bbc18968d93dcb81c895a
2022-08-17 22:14:40 +00:00
Abby Sassel
1fca1eeb7c server/tests: reorganise RunSQLSpec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5512
GitOrigin-RevId: 45761ec297b629de283c310624d9ccb587f30c19
2022-08-17 13:35:09 +00:00
Tom Harding
78e6c9369a Move ObjectRelationshipsLimitSpec to the regression test directory
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5493
GitOrigin-RevId: e4303cd15229c3551269dac84dcb2670f875359c
2022-08-17 09:51:07 +00:00
Lyndon Maydwell
5d751bf0ba Adding metrics capability to data-connector agents (with specs)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5444
GitOrigin-RevId: 49242e83fc1efeb5665515b44368e930818baf27
2022-08-17 01:47:36 +00:00
Solomon
418d0e2cc2 Use NonNegative types for arg/env parsing
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5305
GitOrigin-RevId: 8274ca8c4217d15939fa2a78664a2be486426bf7
2022-08-17 01:09:19 +00:00
Tom Harding
b4639fd10f Move the InsertOnConflictSpec test to regressions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5495
GitOrigin-RevId: be6986ca1073b76be21fe52ef217dc84f901fe81
2022-08-16 12:29:47 +00:00
Tom Harding
7e6c9df291 Move CustomRootFieldsSpec under Subscriptions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5494
GitOrigin-RevId: bdd0fd4e7a6b6465be59dd497c0ff06588f35445
2022-08-16 11:54:29 +00:00
Tom Harding
a54cbc17c3 Migrate InsertCheckPermissionSpec to the new structure
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5363
GitOrigin-RevId: 6de7600f7d9e6a04a10290d85bb83bb564352772
2022-08-15 18:10:44 +00:00
Brandon Martin
98ba6f8751 Merge pull request #5477 from hasura/gil/fix_ulls_first
server/postgres: Fix ulls first parsers + long identifiers + test

GitOrigin-RevId: 74e067b13ca0b4bc47147e715b87a187cd1aeb29
2022-08-15 15:42:34 +00:00