Commit Graph

3115 Commits

Author SHA1 Message Date
Sooraj
03ecd0398b console: improve console with read-only database
https://github.com/hasura/graphql-engine-mono/pull/1619

GitOrigin-RevId: 26da5b0d1b48d2158642c7efb5f1e99933a37624
2021-06-21 15:17:24 +00:00
Aravind K P
4517478ccc cli: add support for citus sources
https://github.com/hasura/graphql-engine-mono/pull/1247

GitOrigin-RevId: 8383a37f71a4d45fe01c002eb229102f0dd38e9a
2021-06-21 14:35:00 +00:00
Kali Vara Purushotham Santhati
fbbd423d8b cli: migrate create gives warning if database isn't connected to server
https://github.com/hasura/graphql-engine-mono/pull/1518

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: a9e836545922719bcbd6e8c9c027df6056d23cef
2021-06-21 13:55:09 +00:00
Sameer Kolhar
c425b77e2d server: fix regression in action responses where aliased fields are dropped
https://github.com/hasura/graphql-engine-mono/pull/1612

GitOrigin-RevId: a031ec2e9fa15df6394382befd9a0db759ef5213
2021-06-21 12:12:07 +00:00
Ikechukwu Eze
6bb8df6a26 console: add citus support
### Description
Add console support for Citus DB

### Changelist
- [x] Add/Remove Citus Datasource
- [x] Track/Untrack tables
- [x] Create Relationships + Tracking suggested relationships
- [x] Permissions
- [x] Browse Rows (minimal)
- [x] Insert Row (using Mutations)
- [x] Filtering Shards and Partitions (partition details are not present in Modify tab, it should work once https://github.com/hasura/graphql-engine-mono/pull/1164 is merged)
- [x] Create Table
- [x] Fixes issue https://github.com/hasura/graphql-engine/issues/6926 for Citus.

### Known Issues
- Unable to create Functions from Raw SQL, server returns 400.
- Unable to run `ALTER` SQL commands, server returns 400.

### Screenshots

![Screenshot 2021-04-21 at 7 53 23 PM](https://user-images.githubusercontent.com/11921040/115569900-468b3d80-a2db-11eb-8374-e06d5d61b2e4.png)

### Setting up a Citus Source
- Link to [docker compose](https://github.com/citusdata/docker/blob/master/docker-compose.yml)
- Create an `.envfile` and add the following
```env
COORDINATOR_EXTERNAL_PORT=<port to expose citus master>
COMPOSE_PROJECT_NAME=test
```
- run `docker-compose --file docker-compose.yml --env-file .envfile up --scale worker=2 -d`. `worker` controls the number of citus worker nodes.
- Link to [sample data](http://docs.citusdata.com/en/v10.0/get_started/tutorial_multi_tenant.html#data-model-and-sample-data)

### Changelog
- [x] console: add citus support

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

Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 2500a5d5f996a2904fe8b5c656d6f3f2db707db6
2021-06-21 06:47:18 +00:00
Aravind K P
acb69dc88c cli: enrich errors in metadata subcommands
closes https://github.com/hasura/graphql-engine/issues/7020

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

GitOrigin-RevId: 3b7ec9e9dd00e904ecb2dd8fafe42f8078962aac
2021-06-18 17:39:26 +00:00
jkachmar
9b71a1d413 server: Updates 'pg-client-hs', fixes explicit conversions
Previous versions of 'pg-client-hs' provided a Template Haskell splice
'sqlFromFile' which returned compile-time embedded PostgreSQL queries.

Rather than returning a concrete 'Query', however, this function
returned the polymorphic 'IsString txt => txt' which allowed the caller
to implicitly convert the result to anything other type with some
'IsString' instance.

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

GitOrigin-RevId: fb4294439148ae8b2762138ece2d59e8e18ef5e0
2021-06-18 17:00:24 +00:00
Vishnu Bharathi
ee2c9cd4ad cli: avoid race condition in cli-ext
https://github.com/hasura/graphql-engine-mono/pull/1610

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 87972a8a9c94252aa17a1f2304c048f66f6bdf2d
2021-06-18 16:14:27 +00:00
Philip Lykke Carlsen
cfab5fc987 Add support for collapsing nulls across all PG expressions (close #1597)
https://github.com/hasura/graphql-engine-mono/pull/1608

GitOrigin-RevId: 02b6fa0e941a27b3149c9dfb37e0758c94f2986e
2021-06-18 15:34:50 +00:00
hasura-bot
964c7f8de7 docs: update sql-server.md
GITHUB_PR_NUMBER: 7084
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7084

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

Co-authored-by: Tanmai Gopal <131160+coco98@users.noreply.github.com>
GitOrigin-RevId: f527463fd25799e88e0b5981391dc14de6f504fb
2021-06-18 13:30:57 +00:00
Vishnu Bharathi P
7c4de20cfe Revert "Update sql-server.md"
This reverts commit 94c8fc79b2.
2021-06-18 18:32:44 +05:30
Tanmai Gopal
94c8fc79b2
Update sql-server.md 2021-06-18 17:00:16 +05:30
Vijay Prasanna
fdcdc14c01 console: add default selected reference option to create table's foreign key editor
https://github.com/hasura/graphql-engine-mono/pull/1472

GitOrigin-RevId: e44f6bc6d819d049edd042ecd1e4e951a45f4ab8
2021-06-18 09:53:51 +00:00
Aravind K P
c7ac1ede3f cli: add migrate and metadata packages
>

### Description
>
This PR adds two new packages which implement the CLI requirements specified in RFC:https://github.com/hasura/lux/blob/cloud/docs/rfcs/20210614_github_integration.md

1. `pkg/metadata`

![image](https://user-images.githubusercontent.com/8335904/122384828-b4757d80-cf89-11eb-9e21-ef116fb928e9.png)

2. `pkg/migrate`

![image](https://user-images.githubusercontent.com/8335904/122510554-68771700-d023-11eb-9f5d-046d2c0cf18a.png)

### 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/1598

GitOrigin-RevId: 0e2bce498386c5aae68dbca0fe383a6afff9d1a9
2021-06-18 06:25:14 +00:00
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