Commit Graph

1278 Commits

Author SHA1 Message Date
Puru Gupta
d5e46b6041 server: do not serialize env vars in logs or errors: PR II - Actions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4486
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
GitOrigin-RevId: 35bb05f9a3c98689c05f2865e0923c00b46e5419
2022-05-23 11:13:49 +00:00
Puru Gupta
5501f686df server: do not serialize env vars in logs or errors: PR I - Remote Schemas
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4463
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
GitOrigin-RevId: 71c6824130d71312f5bd5ae94fc268c0544c6ca3
2022-05-21 09:05:59 +00:00
Vamshi Surabhi
73b161b2bc move action IR types to IR.Actions module
A very minor cleanup (came out of documenting the architecture of actions). Does what's mentioned in the title.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4451
GitOrigin-RevId: d480ff438256df468df65b43d15f92a30b14b997
2022-05-14 11:10:42 +00:00
Lyndon Maydwell
5d5552f185 Fix for too much information in Pro PSQL exceptions wrt. Certificates
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4475
GitOrigin-RevId: 8a64b4387c559ca447252dcadf6c5e231b079c65
2022-05-12 14:30:35 +00:00
Gil Mizrahi
cd38a9a1fc server/postgres + server/mssql: Insert empty objects with default values
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4487
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 3413f0b5dbe6ec42fff360d83b5202e4aa4aa86e
2022-05-11 16:01:57 +00:00
Solomon
b4f89569c8 GDC: Integration Tests and Servant Agent
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4467
GitOrigin-RevId: 5e81d8581197c90ad2de9106e724c63d7592ae72
2022-05-11 06:15:27 +00:00
Tom Harding
3db241155d Make ForeignKey mappings non-empty
Previously, these were represented with a HashMap, but supposedly that map can never be empty. Now, it uses NEHashMap, which carries the non-empty invariant behind a smart constructor.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4481
GitOrigin-RevId: 93ad9aaa9354f25a1ba10e8207ae19614e1e439e
2022-05-10 15:44:46 +00:00
Karthikeyan Chinnakonda
ce9912ff8c server: run_sql to not drop the SQL triggers created by the graphql-engine
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4397
GitOrigin-RevId: dcd43fc31f64af8c6c9c92c66d46a593d5b12fbd
2022-05-10 13:47:16 +00:00
Antoine Leblanc
697137dd77 Fix Postgres not padding timestamps correctly (fix hasura/graphql-engine#8096)
## Description

As identified in hasura/graphql-engine#8096, the format string we used for timestamps was incorrect; we were using `%F`, which expands to `%Y-%m-%d`; but that meant that the year was not padded to four digits: `0001` would be represented simply as `1`. However, Postgres inteprets that `1` as `2001`, probably due to interpretation rules about two-digit years (in `25/12/01`, `01` is indeed `2001`).

```
# create table timestamp_test ( test timestamptz );
CREATE TABLE
# insert into timestamp_test values ('1-01-01T00:00:57Z');
INSERT 0 1
# select * from timestamp_test;
          test
------------------------
 2001-01-01 00:00:57+00
(1 row)
```

To fix this, this PR changes the format string to use `%0Y`, which always pads the year number with zeroes.

## Remaining work

- [x] write Changelog entry
- [ ] copy timestamp tests from the python suite into the hspec tests

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3536
GitOrigin-RevId: fa144111358339fd4a35b32d888c1d2c5b418ea6
2022-05-09 12:18:18 +00:00
Evie Ciobanu
d1f8b9a87d server: further improve anybackend module docs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4465
GitOrigin-RevId: fda2b45468a94d5b25f9d5aed8199502ee9370ad
2022-05-09 10:12:59 +00:00
Antoine Leblanc
04d8f068b6 Remove explicit case on the backend tag in Cache
### Description

As part of the cache building process, we create / update / migrate the catalog that each DB uses as a place to store event trigger information. The function that decides how this should be done was doing an explicit `case ... of` on the backend tag, instead of delegating to one of the backend classes. The downsides of this is that:
- it adds a "friction point" where the backend matters in the core of the engine, which is otherwise written to be almost entirely backend-agnostic
- it creates imports from deep in the engine to the `Backends`, which we try to restrict to a very small set of clearly identified files (the `Instances` files)
- it is currently implemented using a "catch all" default case, which might not always be correct for new backends

This PR makes the catalog updating process a part of `BackendMetadata`, and cleans the corresponding schema cache code.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4457
GitOrigin-RevId: 592f0eaa97a7c38f4e6d4400e1d2353aab12c97e
2022-05-05 13:44:56 +00:00
Daniel Chambers
97ac9cbcdc Data Connector Agent Configuration Schema [GDW-103]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4450
GitOrigin-RevId: 2dce6e901c9734407d084d57166039fd94394279
2022-05-05 05:19:46 +00:00
Rakesh Emmadi
7474f50ef0 server/bigquery: enable metadata API to add/drop computed fields to BigQuery tables
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4414
GitOrigin-RevId: 7899824a49ba9fd479f4cf08789450153f454168
2022-05-04 14:53:31 +00:00
paritosh-08
fb4f745f74 server: refactor Hasura.GraphQL.Analyse
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4310
GitOrigin-RevId: 36bd42476724cc6b94987a4362c2a46616be4f0c
2022-05-04 10:57:55 +00:00
Gil Mizrahi
4411bc9b17 add some haddock annotations to AnyBackend.hs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4415
GitOrigin-RevId: 8e3feca04ef92bed8870da128959b9d48fb92727
2022-05-03 13:15:41 +00:00
Vamshi Surabhi
d5cb312f8b replace SQLOperator with ScalarSelectionArguments
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4426
GitOrigin-RevId: 69beda27ccf4cb47dab80d59ec383704be805bf6
2022-05-03 09:00:01 +00:00
Naveen Naidu
955db8ab11 server: Use quote_ident for quoting table name when using regclass
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4413
Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
GitOrigin-RevId: 721fae15587bdab6f27b8d1189fe6e41c42097e7
2022-05-02 13:16:55 +00:00
Daniel Chambers
4f835623b1 Rename Data Wrapper to Data Connector [GDW-89]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4400
GitOrigin-RevId: 2d90542f95ef4dad70c8dfe1ca3b4c1f3bdaa527
2022-05-02 05:04:07 +00:00
Lyndon Maydwell
53ca4da79d Fixing URL parameter for variable <name> not supported bug in REST endpoints for Dates
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4345
GitOrigin-RevId: 0b739530757ee1081d764d9582e3c0e648861d4e
2022-05-02 03:34:34 +00:00
Daniel Chambers
9453932112 Data Connector Agent Configuration via HGE Metadata [GDW-103]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4358
GitOrigin-RevId: 36e18edf00ba0665b40a80c0b07c374ffcfe56e4
2022-05-01 23:02:08 +00:00
Daniel Chambers
970d69edd4 Added BackendConfig to allow sources to share configuration of Data Connectors [GDW-78]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4271
GitOrigin-RevId: 6990010bff622a424ca0bb9d24579bf121819fb0
2022-04-29 02:14:10 +00:00
Naveen Naidu
222419527f server: refactor MaintenanceMode datatype
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4298
GitOrigin-RevId: 0b88d040bd4b24c61c4ae91e18dc6edf67b3672e
2022-04-28 20:56:11 +00:00
Naveen Naidu
1d641aa2ff server: support query tags for MSSQL data sources
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4373
GitOrigin-RevId: 45717defdc973f3b7f1c9b972e2d3c836eec4476
2022-04-28 19:34:45 +00:00
Rakesh Emmadi
030de648e3 server/bigquery: internal types and function to fetch routine information from BigQuery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4376
GitOrigin-RevId: 30f2d0373dba262cc868ea48a613272ca19865f6
2022-04-28 12:38:27 +00:00
Solomon
db1c50affa Feature/gdw execute array literals GDW-82
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4319
GitOrigin-RevId: 20db2a1eb6e8521c4e572aa642c802129792468f
2022-04-28 01:53:06 +00:00
Antoine Leblanc
f684fecc6c Cut ties with RQL.DML.Internal
## Description

As the name suggests, `DML.Internal` contains internal implementation details of RQL's DML. However, a lot of unrelated parts of the codebase still use some of the code it contains. This PR fixes this, and removes all imports of `RQL.DML.Internal` from outside of `RQL.DML`. Most of the time, this involves moving a function out of `DML.Internal` to an underlying module (see `getRolePermInfo`) or moving a function _back_ into it (see `checkRetCols`).

This PR also clarifies a bit the situation with `withTyAnn` and `withTypeAnn` by renaming the former into `withScalarTypeAnn` and moving them together. Worth noting: there might be a bug lurking in that function, as it doesn't seem to use the proper type annotations for some extension types!

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4380
GitOrigin-RevId: c8ae5b4e8378fefc0bcccf778d97813df727d3cb
2022-04-27 15:37:23 +00:00
Antoine Leblanc
3cbcbd9291 Remove RQL/Types.hs
## Description

This PR removes `RQL.Types`, which was now only re-exporting a bunch of unrelated modules.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4363
GitOrigin-RevId: 894f29a19bff70b3dad8abc5d9858434d5065417
2022-04-27 13:58:47 +00:00
Philip Lykke Carlsen
135c56eaa3 Simplify getRolePermInfo
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4348
GitOrigin-RevId: a8973624ae3100e5ca12f7c05962d1442c226750
2022-04-27 12:17:15 +00:00
Antoine Leblanc
8b0b4e5c35 Remove all functions from RQL.Types.hs
## Description

This small PR moves all functions in `RQL.Types.hs` to better locations. Most `askX` functions are moved alongside the `unsafe` functions they use. Several other functions are moved closer to their call site. `MetadataM` is moved alongside `Metadata`. This PR also documents the `ask` functions.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4355
GitOrigin-RevId: 0498a7e8f98e7a94af911dd375cad84ace7ddffa
2022-04-26 15:13:57 +00:00
Rakesh Emmadi
6611fbd625 server/mssql: avoid encoding varchar values while generating SQL
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4314
GitOrigin-RevId: 852bc941782414c7d190c6195ff367493b927639
2022-04-26 13:48:37 +00:00
Karthikeyan Chinnakonda
2325755954 server: streaming subscriptions schema generation and tests (incremental PR - 3)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4259
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
GitOrigin-RevId: 4d1b4ec3c01f3a839f4392d3b77950fc3ab30236
2022-04-22 19:54:11 +00:00
Evie Ciobanu
0060a48009 server: minor nit-picks for the Postgres Select module split
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4338
GitOrigin-RevId: c2125275b32a5084c5a96afba79d4cb6c65687a8
2022-04-22 17:19:58 +00:00
Antoine Leblanc
9eca586655 Remove HasSystemDefined.
### Description

`HasSystemDefined` is defined in `RQL.Types`, but only used in one place, `LegacyCatalog`, to avoid passing a boolean around. It is easily replaced by an ad-hoc `ReaderT`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4337
GitOrigin-RevId: 649d758bb2b18b39533429dda5ab71afde62fb53
2022-04-22 16:02:06 +00:00
Antoine Leblanc
ea32b8bf82 Move HasServerConfigCtx to Hasura.Server.Types.
### Description

Small PR that moves code out of `RQL.Types.hs`. Specifically, it moves `HasServerConfigCtx` to where `ServerConfigCtx` is defined. This removes code from `RQL.Types`, makes the dependency on `Server.Types` more explicit, and will make some further cleanups easier.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4336
GitOrigin-RevId: 95bb3467d741763892c4e68a38760497157ba1aa
2022-04-22 14:51:00 +00:00
Philip Lykke Carlsen
9a557ceeee Split up module Hasura.Backend.Postgres.Translate.Select into sub-modules
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4334
GitOrigin-RevId: d083512f3c4e534a10e571eeab10308ad45cc7a0
2022-04-22 13:39:40 +00:00
Rakesh Emmadi
1231d1145b server/tests: add hspec test case to parse legacy remote relationship definition json
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4327
GitOrigin-RevId: 321d59bb1f7e51d37893838cd6262a865eb943c5
2022-04-22 11:34:38 +00:00
Philip Lykke Carlsen
df36cdac09 Refactor insert mutations IR use of "default values"
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4316
GitOrigin-RevId: 91f80902a2dc2a782821033f455c70c4e96f0950
2022-04-21 16:34:04 +00:00
Naveen Naidu
abb57e58c8 server/MSSQL: Event Delivery System (Incremental PR - 3)
</details>

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3392
Co-authored-by: Divi <32202683+imperfect-fourth@users.noreply.github.com>
GitOrigin-RevId: 9df6b0aa7d91f22571b72d3e467da23b916c9140
2022-04-21 07:20:34 +00:00
paritosh-08
7f4565fad2 server: validate top level fragments in GQL query
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4299
GitOrigin-RevId: 70925779d41c5a9fe66577b941c674577a4a9a13
2022-04-20 07:33:21 +00:00
Vamshi Surabhi
1ca0cb9c74 Fixes remote relationships on actions
Fixes: https://github.com/hasura/graphql-engine/issues/8399. See [this comment](https://github.com/hasura/graphql-engine-mono/pull/4297/files#r853259983) for an explanation.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4297
Co-authored-by: Brandon Martin <40686+codedmart@users.noreply.github.com>
GitOrigin-RevId: accc85a77cb108224b1c78da709dc96d0e4e298d
2022-04-19 17:49:57 +00:00
Sibi Prabakaran
a687e7419e Fix BigDecimal/BigNumeric serialization for BigQuery backend
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4268
GitOrigin-RevId: 0158ad7ef4e6b34de7a350f8bbbdc0255c9187e3
2022-04-19 11:37:48 +00:00
Puru Gupta
94539b0dfb multitenant: update shutdown logic
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4154
GitOrigin-RevId: e331b1c531b8e03102353652579b731ff4c09958
2022-04-19 08:50:17 +00:00
Solomon
c945b2d391 Replaces litName splices with name quasiquotes
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4267
GitOrigin-RevId: 2d93c35a7e34dbada3b72aabcae5fc2858bbfc29
2022-04-18 19:44:04 +00:00
hasura-bot
22120a026c don't drop nested typed null fields in actions (fix #8237)
GITHUB_PR_NUMBER: 8238
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8238

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4272
Co-authored-by: Jesse Jaara <294363+Huulivoide@users.noreply.github.com>
Co-authored-by: Lyndon Maydwell <92299+sordina@users.noreply.github.com>
GitOrigin-RevId: 810ec935a1e1c75a06a1ad1427dedb179eb60d5e
2022-04-18 09:59:16 +00:00
Solomon
893fb8cd92 Feature/gdw execute and metadata [GDW-74]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4195
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
GitOrigin-RevId: 2508b604e7453c2efaa2f7096b2b4b2ce6885d2d
2022-04-14 02:07:04 +00:00
Sibi Prabakaran
74328156c5 Fix Decimal serialization for BigQuery backend
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4168
GitOrigin-RevId: 16072ce326ede22ba8be05f92fcfa0aaa2a7a644
2022-04-13 17:09:45 +00:00
Rakesh Emmadi
503f22ba87 fix parsing remote relationship json definition from 1.x server catalog on migration
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4260
GitOrigin-RevId: c5a634ec7275d1cbee0bcda5ada9b21ae874f098
2022-04-13 16:08:28 +00:00
paritosh-08
4e0a0a5804 server: add custom table name in EnumReference
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4177
GitOrigin-RevId: 569b4e450aabe11296b7a43fe4aca1883f221790
2022-04-13 10:08:21 +00:00
Naveen Naidu
bdff49fd55 server: redact sensitive info from logs for metadata queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4072
GitOrigin-RevId: 8e6043878ec4b4f073744614ddc9c7046ca93c82
2022-04-11 17:50:22 +00:00
Naveen Naidu
d10b862b61 server: fix bugs in clear_metadata code path
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3927
Co-authored-by: Divi <32202683+imperfect-fourth@users.noreply.github.com>
Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 6f3457698029af94e9157c23b552ac2034f9c740
2022-04-11 11:25:13 +00:00