Commit Graph

3201 Commits

Author SHA1 Message Date
Antoine Leblanc
8a77386fcf server: IR for DB-DB joins
### Description

This PR adds the required IR for DB to DB joins, based on @paf31 and @0x777 's `feature/db-to-db` branch.

To do so, it also refactors the IR to introduce a new type parameter, `r`, which is used to recursively constructs the `v` parameter of remote QueryDBs. When collecting remote joins, we replace `r` with `Const Void`, indicating at the type level that there cannot be any leftover remote join.

Furthermore, this PR refactors IR.Select for readability, moves some code from IR.Root to IR.Select to avoid having to deal with circular dependencies, and makes it compile by adding `error` in all new cases in the execution pipeline.

The diff doesn't make it clear, but most of Select.hs is actually unchanged. Declarations have just been reordered by topic, in the following order:
- type declarations
- instance declarations
- type aliases
- constructor functions
- traverse functions

https://github.com/hasura/graphql-engine-mono/pull/1580

Co-authored-by: Phil Freeman <630306+paf31@users.noreply.github.com>
GitOrigin-RevId: bbdcb4119cec8bb3fc32f1294f91b8dea0728721
2021-06-17 23:13:05 +00:00
Phil Freeman
456caa59e1 server: fix caching for queries using remote schema permissions
https://github.com/hasura/graphql-engine-mono/pull/1579

Co-authored-by: Solomon Bothwell <24038+ssbothwell@users.noreply.github.com>
GitOrigin-RevId: 8fdf33863d812f2ee4edee7eec34150a7dc03231
2021-06-17 19:16:59 +00:00
Sooraj
12045a827c console/fix: changing primary key removes the existing PK when failing to create PK
https://github.com/hasura/graphql-engine-mono/pull/1509

GitOrigin-RevId: b4fec58f399b21125dcacf8083b01148778f97b0
2021-06-17 16:04:02 +00:00
Tanmai Gopal
0a69080189 Notes on Hasura & SQL Server support
https://github.com/hasura/graphql-engine-mono/pull/1600

Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 1a31786c5737c5003e3158c01695c33ed7831fdc
2021-06-17 14:36:46 +00:00
Philip Lykke Carlsen
73e5c6ce47 Generalize set_table_customization to other backends (close #1501)
https://github.com/hasura/graphql-engine-mono/pull/1591

GitOrigin-RevId: 42332798160a3a3b18404345390b235db1dd81a1
2021-06-17 13:22:54 +00:00
Rikin Kachhia
835900cf30 docs: add MS SQL server docs (#1568)
* copy pg -> mssql

* .

* .

* Removes features that are not compatible in schema/index.rst

* delete extra files

* fix refs

* update sidebar link

* mssql schema updates

* Optimised images with calibre/image-actions

* schema updates clear

* MSSQL Queries

* removed distinct queries & aggregate nodes

* updated table basics blank api

* Adds a getting started guide for Hasura Cloud and with Docker for SQL
Server

* fix stuff

Co-authored-by: Tanmai Gopal <tanmaig@hasura.io>
Co-authored-by: VaishnaviGVS <vaishnavi@hasura.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GitOrigin-RevId: d0869ee48e459054c54d3ed3523c32bf4994ddba
2021-06-17 11:47:45 +00:00
hasura-bot
bad2d4190d console: catch api error, fix console getting stuck on loading screen (close #5774)
GITHUB_PR_NUMBER: 5837
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/5837

https://github.com/hasura/graphql-engine-mono/pull/856

Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
GitOrigin-RevId: 2a878ea9de0b21cf998b7a49dbfc6d99c143168e
2021-06-17 11:03:24 +00:00
Kali Vara Purushotham Santhati
a70e6089c8 cli: show only differences in metadata on metadata diff
https://github.com/hasura/graphql-engine-mono/pull/461

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 626bdfd8d1d05996153cd9676f1695ea796b00d9
2021-06-17 10:16:17 +00:00
Abhijeet Khangarot
240738cf60 console: fix routes for hasura cloud console
https://github.com/hasura/graphql-engine-mono/pull/1560

GitOrigin-RevId: 83d1825ad7ee74fd7a941376925d7e26c788baf5
2021-06-17 09:34:13 +00:00
Solomon Bothwell
99e7e3b7b4 Implement refresh parameter for Cached Directive
https://github.com/hasura/graphql-engine-mono/pull/1523

Co-authored-by: Phil Freeman <630306+paf31@users.noreply.github.com>
GitOrigin-RevId: f83b73d23db15efdd19a61eca35badc3ff235779
2021-06-17 06:28:45 +00:00
Rikin Kachhia
bf29ab1559 docs: fix links in cloud maintenance mode page
https://github.com/hasura/graphql-engine-mono/pull/1589

GitOrigin-RevId: 69c5ebd495bef259753a706eeceeb93153e07ac4
2021-06-16 13:34:12 +00:00
Karthikeyan Chinnakonda
62e7fe62db server: log additional info in the livequery poller logs
https://github.com/hasura/graphql-engine-mono/pull/1529

GitOrigin-RevId: 27060632d5ac0da3f695c6755350f4e32dc0efc1
2021-06-16 13:28:17 +00:00
surendran82
c651c9b2ff docs: safari browser navbar UI fix
https://github.com/hasura/graphql-engine-mono/pull/1590

GitOrigin-RevId: e3f178bed8c275b8039a53ab1abd5af7e2629c65
2021-06-16 12:43:06 +00:00
Tirumarai Selvan
283b77c5e0 tag release v2.0.0-beta.2
GitOrigin-RevId: cb066ee5e6738973f05a442230c074cb262e8c8d
2021-06-16 11:57:34 +00:00
Aravind K P
3136ffad1b cli: update go.mod
>

### Description
Update `go.mod` to allow other packages to import [v2.0.0 versions](https://blog.golang.org/v2-go-modules).

### Changelog

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] CLI

https://github.com/hasura/graphql-engine-mono/pull/1584

GitOrigin-RevId: a5d17ad20289d1cd7217763f56ef3ba6552d69c4
2021-06-16 11:45:07 +00:00
surendran82
09070769b4 docs: HasuraCon banner stripe updated
https://github.com/hasura/graphql-engine-mono/pull/1586

GitOrigin-RevId: bcae4c3449048cb00deeed6bb53adb2b8fcec1b9
2021-06-16 11:04:26 +00:00
Rikin Kachhia
d4c65d176c docs: separate v1 and v2 docs
https://github.com/hasura/graphql-engine-mono/pull/1577

GitOrigin-RevId: 606ac087536a8910e93126512592389eeeb4252f
2021-06-16 09:47:55 +00:00
Rikin Kachhia
d8d62f19e2 docs: add v2 computed field typename breaking change
https://github.com/hasura/graphql-engine-mono/pull/1585

GitOrigin-RevId: 41ae0c657f9d1851d0bce6a009c843b0f903e93b
2021-06-16 09:06:14 +00:00
Abby Sassel
b6b1354a2b server/mssql: Fix sqlcmd symlink Dockerfile
https://github.com/hasura/graphql-engine-mono/pull/1578

GitOrigin-RevId: 97d793b42b029cd51a8a96699ca4a67f1463d349
2021-06-15 19:45:08 +00:00
Antoine Leblanc
9a8a211367 server: remove XDistinct, cleanup table arguments
https://github.com/hasura/graphql-engine-mono/pull/1028

GitOrigin-RevId: dae3d46097520f6838b7e95cdda1ab8d53dc9700
2021-06-15 15:54:12 +00:00
Antoine Leblanc
a805f4d185 server: misc cleanups
https://github.com/hasura/graphql-engine-mono/pull/1553

GitOrigin-RevId: b67dc40e54496ed6ad6c85755cf66745664416f7
2021-06-15 15:06:37 +00:00
Rikin Kachhia
8e1c3dfd65 docs: update cli docs
https://github.com/hasura/graphql-engine-mono/pull/1573

GitOrigin-RevId: 6d6047ac24c4fd6abcd49aa5fcb0c3f97168c41d
2021-06-15 12:26:48 +00:00
Chris Done
67a9045328 Bigquery/cleanups
A pull request for cleaning up small issues, bugs, redundancies and missing things in the BigQuery backend.

Summary:

1. Remove duplicate projection fields - BigQuery rejects these.
2. Add order_by to the test suite cases, as it was returning inconsistent results.
3. Add lots of in FromIr about how the dataloader approach is given support.
4. Produce the correct output structure for aggregates:
   a. Should be a singleton object for a top-level aggregate query.
   b. Should have appropriate aggregate{} and nodes{} labels.
   c. **Support for nodes** (via array_agg).
5. Smooth over support of array aggregates by removing the fields used for joining with an explicit projection of each wanted field.

https://github.com/hasura/graphql-engine-mono/pull/1317

Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com>
GitOrigin-RevId: cd3899f4667770a27055f94988ef2a6d5808f1f5
2021-06-15 08:59:11 +00:00
Kali Vara Purushotham Santhati
0ce7769603 cli: generate migrations for mssql databases in hasura console mode
closes https://github.com/hasura/graphql-engine/issues/7011

https://github.com/hasura/graphql-engine-mono/pull/1527

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: c03af1b9c4221263a5e23a41bb710010fe82c018
2021-06-15 06:30:36 +00:00
Nicolas Beaussart
ad2f48c534 console: add testing to core requestAction
https://github.com/hasura/graphql-engine-mono/pull/1563

GitOrigin-RevId: 1bbd107e81a9965d0be9d35c581ca261935bfc83
2021-06-15 05:43:48 +00:00
Karthikeyan Chinnakonda
47de5e06cf server: fetch pending events across sources concurrently
https://github.com/hasura/graphql-engine-mono/pull/1562

GitOrigin-RevId: 763e60e8b175ba4b44aefbbf4ebe91455b8e3fff
2021-06-14 16:09:39 +00:00
Vishnu Bharathi
7d2f1c0536 ci: sets include_pr_number kodiak config to false (#1569)
https://github.com/hasura/graphql-engine-mono/pull/1569

Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
GitOrigin-RevId: d2c51608887ebdea2719e1e4f66def9596202897
2021-06-14 15:21:56 +00:00
hasura-bot
6d8a441e64 ci: renames mssql test job (#1567)
GITHUB_PR_NUMBER: 7059
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7059

https://github.com/hasura/graphql-engine-mono/pull/1567

Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 12d4cfdb8aee13644c0b9eed56d152e74335dd24
2021-06-14 14:41:20 +00:00
Aravind K P
c1fd8beeef Revert "cli: add exclude-schema & full flags to migrate create command (#1564)" (#1566)
This reverts commit b4441cbde667c66f3ae203d752d6b33a0833f34e.

GitOrigin-RevId: 33ddf5c3d94e888497eb909ccb18d35bb5614ea2
2021-06-14 12:28:34 +00:00
hasura-bot
6e5186475c cli: add exclude-schema & full flags to migrate create command (#1564)
GITHUB_PR_NUMBER: 5713
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/5713

https://github.com/hasura/graphql-engine-mono/pull/1564

Co-authored-by: Sameer Kolhar <6604943+kolharsam@users.noreply.github.com>
Co-authored-by: Kali Vara Purushotham Santhati <72007599+purush7@users.noreply.github.com>
GitOrigin-RevId: b4441cbde667c66f3ae203d752d6b33a0833f34e
2021-06-14 12:11:31 +00:00
Sooraj
8e6a8ee8c5 console: merge duplicate unit test folders (#1561)
https://github.com/hasura/graphql-engine-mono/pull/1561

GitOrigin-RevId: 635a185e456c1860fb7e596a2247657135213391
2021-06-14 10:19:59 +00:00
Abby Sassel
34de64bcdf server/mssql: run tests in CI (#1452)
https://github.com/hasura/graphql-engine-mono/pull/1452

GitOrigin-RevId: 9fd345f7e5c24ebc3f47bdd0b15f84c9b8766f0c
2021-06-14 07:31:42 +00:00
Brandon Simmons
4065d807a8 ci: kodiak.toml comment tweak (#1548)
https://github.com/hasura/graphql-engine-mono/pull/1548

GitOrigin-RevId: 25c5a0b523d07771c5e7db72ba9edf51ae7d95fd
2021-06-11 17:00:32 +00:00
Antoine Leblanc
5105cba829 server/citus: fix Citus runSQL never rebuilding the schema cache (#1549)
### Description

RunSQL commands are analyzed to detect whether they require a schema cache rebuild; in the case of Citus we were always returning `False`. This PR fixes this, and also removes the catch-all case, to make it explicit / obvious whenever we change this.

https://github.com/hasura/graphql-engine-mono/pull/1549

GitOrigin-RevId: dddaaea868e7b7999bdfe11451032df9d9b44274
2021-06-11 11:38:57 +00:00
Vamshi Surabhi
e8e4f30dd6 server: support remote relationships on SQL Server and BigQuery (#1497)
Remote relationships are now supported on SQL Server and BigQuery. The major change though is the re-architecture of remote join execution logic. Prior to this PR, each backend is responsible for processing the remote relationships that are part of their AST.

This is not ideal as there is nothing specific about a remote join's execution that ties it to a backend. The only backend specific part is whether or not the specification of the remote relationship is valid (i.e, we'll need to validate whether the scalars are compatible).

The approach now changes to this:

1. Before delegating the AST to the backend, we traverse the AST, collect all the remote joins while modifying the AST to add necessary join fields where needed.

1. Once the remote joins are collected from the AST, the database call is made to fetch the response. The necessary data for the remote join(s) is collected from the database's response and one or more remote schema calls are constructed as necessary.

1. The remote schema calls are then executed and the data from the database and from the remote schemas is joined to produce the final response.

### Known issues

1. Ideally the traversal of the IR to collect remote joins should return an AST which does not include remote join fields. This operation can be type safe but isn't taken up as part of the PR.

1. There is a lot of code duplication between `Transport/HTTP.hs` and `Transport/Websocket.hs` which needs to be fixed ASAP. This too hasn't been taken up by this PR.

1. The type which represents the execution plan is only modified to handle our current remote joins and as such it will have to be changed to accommodate general remote joins.

1. Use of lenses would have reduced the boilerplate code to collect remote joins from the base AST.

1. The current remote join logic assumes that the join columns of a remote relationship appear with their names in the database response. This however is incorrect as they could be aliased. This can be taken up by anyone, I've left a comment in the code.

### Notes to the reviewers

I think it is best reviewed commit by commit.

1. The first one is very straight forward.

1. The second one refactors the remote join execution logic but other than moving things around, it doesn't change the user facing functionality.  This moves Postgres specific parts to `Backends/Postgres` module from `Execute`. Some IR related code to `Hasura.RQL.IR` module.  Simplifies various type class function signatures as a backend doesn't have to handle remote joins anymore

1. The third one fixes partial case matches that for some weird reason weren't shown as warnings before this refactor

1. The fourth one generalizes the validation logic of remote relationships and implements `scalarTypeGraphQLName` function on SQL Server and BigQuery which is used by the validation logic. This enables remote relationships on BigQuery and SQL Server.

https://github.com/hasura/graphql-engine-mono/pull/1497

GitOrigin-RevId: 77dd8eed326602b16e9a8496f52f46d22b795598
2021-06-11 03:27:39 +00:00
Brandon Simmons
fe2c88907b ci: kodiak merge.message: include_pr_number and include_pull_request_url
GitOrigin-RevId: 53fa1940366c8b45c6893a3a06d11448978d67e0
2021-06-10 17:49:54 +00:00
Rikin Kachhia
90f9806c99 docs: add cloud v2 update guide
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GitOrigin-RevId: 581f08d36caf95d653fe88ee050b11f657614da4
2021-06-10 17:04:44 +00:00
Antoine Leblanc
2d8ac777b3 server: introduce new custom scalars and remove offsetParser
GitOrigin-RevId: 5db058a7ae8f57bdc7e9844fcdd94e31ce11d961
2021-06-10 16:14:21 +00:00
Vamshi Surabhi
96104ec1a8 Revert "remote schema typename customisation"
This reverts the remote schema type customisation and namespacing feature temporarily as we test for certain conditions.

GitOrigin-RevId: f8ee97233da4597f703970c3998664c03582d8e7
2021-06-10 09:57:16 +00:00
Varun Choudhary
a7ef558b41 console: add modify functionality on columns, primary keys & unique keys to MS SQL Server tables
Modify page for mssql.
Column edit, add and delete
Pk add and delete
unique key add and delete

> Known Issues
> It is not because of this PR, but evident after implementing this changes.
> Table comments section is not only showing table comments but also anything that has `SYS.EXTENDED_PROPERTIES` with the table id, we may need to fix this by adding more conditions while fetching the table comments
> issue: https://github.com/hasura/graphql-engine-mono/issues/1486

Update
> Found a common issue while testing this PR, and it happens for PG tables too, so keeping it as a different issue
https://github.com/hasura/graphql-engine/issues/7018

GitOrigin-RevId: f7883a797ce8d25034824ae35668b1f830e59c70
2021-06-10 09:09:33 +00:00
Nicolas Beaussart
651d8ce190 console: upgrade redux and add redux toolkit
GitOrigin-RevId: 328e28f521f6e5fa20489aaeea2be1f1cc456d56
2021-06-10 07:20:23 +00:00
David Overton
4a69fdeb01 Dmoverton/5863 prefix namespacing
GitOrigin-RevId: 108e8b25e745cb4f74d143d316262049cef62b70
2021-06-09 22:42:05 +00:00
Antoine Leblanc
972c662b45 server: cleanup backend types in permissions
GitOrigin-RevId: a5d9f7c25df3d891927d659f6db35b36dc923deb
2021-06-09 19:43:27 +00:00
Shraddha Agrawal
64f8ec18a0 docs: add cloud maintenance mode docs
docs for lux PR [#2308](https://github.com/hasura/lux/pull/2308).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 290482e1d737bda419ee7f514ca27c5d7929a31c
2021-06-09 13:39:53 +00:00
Antoine Leblanc
8c3808f2bc server: make runMonadSchema backend agnostic
GitOrigin-RevId: ce4e36aedade18d47d035b90a69b9c545ea7d6ed
2021-06-09 13:03:08 +00:00
Rakesh Emmadi
04e041b8cb server: fix replace configuration in add source metadata API
>

### Description
>

### Changelog

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Server

### Related Issues
->
Fixes #1528

### Solution and Design
>
Only replace connection configuration instead of replacing entire metadata with empty one.

GitOrigin-RevId: f9a16dcc7b1219ec1af915bf083622fcb7dde69a
2021-06-09 12:14:24 +00:00
Kali Vara Purushotham Santhati
8bfc56b7c4 cli: remove the unnecessary empty lines in actions.graphql generated by metadata export command
closes https://github.com/hasura/graphql-engine/issues/5338

GitOrigin-RevId: 83bd8492beb9f52c761d5857ca369425c69691a4
2021-06-09 10:46:05 +00:00
Abby Sassel
dc950eda6a server/test: fix BACKEND variable in dev.sh script
GitOrigin-RevId: 0dae37c0aa50c8e4be59618d9d0a777f537fa4dc
2021-06-09 09:51:07 +00:00
Abhijeet Khangarot
75f37f69d3 console: allow input object presets in remote schema permissions
GitOrigin-RevId: 6a535a5b9adb0a80d8f57682618aa7dd406236b0
2021-06-09 08:52:22 +00:00
Vishnu Bharathi
4b76289d03 cli: add interactive prompt to get input when --database-name flag is missing
GitOrigin-RevId: f92478d0ca6a4f6d0cfaa7aca3b4bb8a215a5cad
2021-06-09 07:13:46 +00:00