Commit Graph

495 Commits

Author SHA1 Message Date
Kali Vara Purushotham Santhati
a924720a3a cli: add skip-execution support for up and down flags in migrate apply
https://github.com/hasura/graphql-engine-mono/pull/1510

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 9f7b271bda08ecd156a6220e830063bbb36a4b36
2021-06-21 15:57:41 +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
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
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
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
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
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
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
Tirumarai Selvan
283b77c5e0 tag release v2.0.0-beta.2
GitOrigin-RevId: cb066ee5e6738973f05a442230c074cb262e8c8d
2021-06-16 11:57:34 +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
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
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
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
David Overton
4a69fdeb01 Dmoverton/5863 prefix namespacing
GitOrigin-RevId: 108e8b25e745cb4f74d143d316262049cef62b70
2021-06-09 22:42:05 +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
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
Varun Choudhary
3f19e8a3a8 console: allow tracking of custom SQL functions having composite type (rowtype) input arguments
Closes: https://github.com/hasura/graphql-engine/issues/6858

Description:

Following two things are done:

1. Show compatible functions in the Untracked custom functions list (i.e. even those with ROWTYPE arg)
![Screenshot from 2021-05-11 16-13-21](https://user-images.githubusercontent.com/68095256/117803100-dd606f80-b273-11eb-8d02-1ea55b31863d.png)
2. When a function with ROWTYPE argument is tracked, a confirmatory dialogue box is shown. The text reads `This function can be added as a root field or a computed field inside a table` and the buttons reflect the options: `Add as root field`, `Add as computed field` (this will take the user to the Modify -> Add a computed field section of the first-row type argument)
![Screenshot from 2021-06-03 17-28-28](https://user-images.githubusercontent.com/68095256/120641377-28dff500-c491-11eb-80ea-cc60e6f37f23.png)

Affected Component:

- [x] Console

Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
GitOrigin-RevId: 089944aadba73f7a77e220a49489846ff1cb9540
2021-06-08 15:22:24 +00:00
Varun Choudhary
f3643f26ad console/mssql: support CRUD operations for foreign keys
adds foreign key functionality to mssql tables under Modify Tab.

Steps to test:
1. Connect an MSSQL data source.
2. Create a table
3. go to modify page
4. make sure the `Add foreign key `button is visible
5. click on `Add foreign key`, and try to add FK
6. after adding the FK, we will see the `edit` and `remove` button, try to edit and remove the FK

Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 63be7c4ef909503ac05096a64c686b72f7c47307
2021-06-03 11:49:21 +00:00
Tirumarai Selvan
205a31de0c tag release v2.0.0-beta.1
GitOrigin-RevId: e015b7d72751b54684e2e74a645d0b58714ef102
2021-06-02 12:07:58 +00:00
hasura-bot
c1381d38e0 console: show error notification for table and cloumn names exceeding 63 characters and trim migration names exceeding 255 characters
GITHUB_PR_NUMBER: 5785
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/5785

Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
GitOrigin-RevId: b12a729cfb708ff0622805f247473cb16b44ae0a
2021-06-02 10:23:58 +00:00
kodiakhq[bot]
01d8a37706 server: fix asymptotics of event_log batch fetching
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
GitOrigin-RevId: 9b8afb502e94dd371a8596ccde97d023bd2344a9
2021-06-01 17:34:38 +00:00
Aravind K P
757327d94c cli: use stdout logger in version command
closes https://github.com/hasura/graphql-engine/issues/6998

GitOrigin-RevId: 202eecc6085970aa5433e652cfafd34195252dbf
2021-05-31 04:13:34 +00:00
Ikechukwu Eze
9b42a52637 console: allow renaming data source
Before: on edit source page, changing data source name was not allowed and the input disabled.
Now: data source name can be changed on edit source page.

Note:
- ~When only the data source name is changed, a  request is sent for renaming and another for updating data source even when other values of the data source configuration weren't changed.~
- This has been fixed and should be tested thus:
    - run `npm run jest`
    - on edit source UI, change only data source name and confirm that only `rename_source` request is being sent through network tab in dev tools
    - change any other fields but the source name, and confirm that only `add_source` with `replace_configuration: true` is sent.
    - change both source name and any other field in the form and confirm that both request are sent (in this order: rename request before add request) and export_metadata request only sent once after that.
    - Try with bigquery, mssql and postgres

Possible Refactor:
  - consider if `renameDataSource` and `addDataSource`, can be refactored or left as is

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: cbb041ac8362fd94de5aa19bfa61c0cde8703459
2021-05-28 07:59:47 +00:00
Lyndon Maydwell
f3749f24b3 Fix for 6913 - Undefined ENV variable during a replace metadata throws on allow_inconsistent_metadata
GitOrigin-RevId: 46494f8784d21179e49d2034e1f68171cf146e49
2021-05-28 04:32:33 +00:00
Sooraj
c3d7a7634f console: add drop table functionality to ms sql server tables
GitOrigin-RevId: a79c864263ebdde4a9a7e1ce1354a3ac17be4098
2021-05-27 21:26:50 +00:00
Abhijeet Khangarot
9a68cb51c9 console: update connect database form with SSL certificates
GitOrigin-RevId: b8da60cbe1220c8f4f8ec180fd3967e326b7f3a8
2021-05-27 16:00:01 +00:00
Rakesh Emmadi
e43d0273e0 server: mssql: apply schema changes by mssql_run_sql DDL on metadata (fix #779)
Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
GitOrigin-RevId: 6905d5914c8a698445c0ef03d6a8303747701e1c
2021-05-27 15:07:10 +00:00
Aravind K P
8ebf5eef2b cli: disable reading metadata from pipe
closes https://github.com/hasura/graphql-engine/issues/6987

GitOrigin-RevId: f12b7475055d2f9767a6dd20eee531042bdbcbc5
2021-05-27 14:17:25 +00:00
Karthikeyan Chinnakonda
72c24eea69 server: fix cron trigger bug of new events not getting generated when cron trigger is imported via metadata
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
GitOrigin-RevId: 1a9076e039ba2c8da898683c64ef988fb8512eae
2021-05-26 16:20:19 +00:00
Vijay Prasanna
1c79bb4b80 console: add create table view for mssql schemas
### Description
This PR adds `Create Table` view for MSSQL server schemas.

### Changelist
* [x] Add basic `create table` form view on navigating from Schema's create table action.
* [x] Hide frequently selected columns button.
* [x] Allow the user to manually add column types for now: convert `select` for columns to a `text` input .
* [x] Remove `Restrict` radio selection for foreign key constraints.
* [x] Add SQL query for Create table in MSSQL.
### Screenshot
![Screenshot 2021-03-09 at 5 22 03 PM](https://user-images.githubusercontent.com/11921040/110467030-82d45700-80fc-11eb-84af-dd228d84b135.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.

### Modified components
 - Console

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: a783b5940198ecf582d1cd6ad4d4224efabf59fc
2021-05-26 15:28:32 +00:00
Aleksandra Sikora
455b5a9fd6 console/mssql: add comment and check constraints to modify page
GitOrigin-RevId: 0fcc9741d031ec7a74efff5437e676ea7f744922
2021-05-26 14:27:42 +00:00
Abhijeet Khangarot
d0a66e5172 console: add new connection params to connect database form
GitOrigin-RevId: 073d30e50a196e265cd8dfb7cfb3c9af00c3fc0e
2021-05-25 13:03:08 +00:00
Tirumarai Selvan
3bcf758e14 tag release v2.0.0-alpha.11
GitOrigin-RevId: cbc36c7b0385ad7e1ca7fcda8a364ee9b201b35d
2021-05-25 12:18:44 +00:00
Naveen Naidu
12b57530f3 server: log warning for deprecated environment variables
Co-authored-by: Anon Ray <616387+ecthiender@users.noreply.github.com>
GitOrigin-RevId: e3a845d93d05545816aa9448aad5845b7247b679
2021-05-25 10:50:51 +00:00
Swann Moreau
d3611af58d server: lazy event catalog initialisation
event catalog:
- `hdb_catalog` is no longer automatically created
- catalog is initialised when the first event trigger is created
- catalog initialisation is done during the schema cache build, using `ArrowCache` so it is only run in response to a change to the set of event triggers

event queue:
- `processEventQueue` thread is prevented from starting when `HASURA_GRAPHQL_EVENTS_FETCH_INTERVAL=0`
- `processEventQueue` thread only processes sources for which at least one event trigger exists in some table in the source

Co-authored-by: Anon Ray <616387+ecthiender@users.noreply.github.com>
GitOrigin-RevId: 73f256465d62490cd2b59dcd074718679993d4fe
2021-05-25 06:51:03 +00:00
Antoine Leblanc
6e95f761f5 server: rewrite remote input parsers to deal with partial variable expansion (fix hasura/graphql-engine#6656)
GitOrigin-RevId: e0b197a0fd1e259d43e6152b726b350c4d527a4b
2021-05-24 20:13:47 +00:00
Abhijeet Khangarot
82e2e382f1 console: rearrange connect database form and add prepared statements
GitOrigin-RevId: 2cb84e3feabc72875c6b3f5368b55fa893ba72a9
2021-05-24 15:09:55 +00:00
Vladimir Ciobanu
0f8f4764c7 server: rename source
GitOrigin-RevId: 5f4a17941bfd447deb9663a4c250f149238c5f53
2021-05-24 13:15:02 +00:00
Abby Sassel
c9e7e10eaa server/bugfix: Include permission filter in the exists clause. Fixes #6931
GitOrigin-RevId: d3080dfa00c96afcf1254d83757a5e50a0726381
2021-05-24 09:09:50 +00:00
Anon Ray
63594e1828 server: fix referenced session vars for live queries when UDF has specified session argument
GitOrigin-RevId: 23efdf4d3b3902b5ce7ec14061faa53b18258e86
2021-05-24 07:34:33 +00:00
hasura-bot
2a24947e57 🐛 [3897] Squash fails when down/metadown empty (close #3897)
GITHUB_PR_NUMBER: 6934
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6934

Co-authored-by: Appréderisse Benjamin <8669741+bappr@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 13c7bcdcac9e2bcb659734e0e91d676525f8adcc
2021-05-24 06:05:54 +00:00
Kali Vara Purushotham Santhati
5e92ce028e cli: migrate delete command, update migration state on server after squash
It contains 2 flags

all   -  To delete all migrations locally and on database
version - To delete a single migration locally and on database

Usage :
`hasura migrate delete --all`
`hasura migrate delete --version <version_number>`

Additional fix :
The `migrate squash`  will deletes the migration history on server after squashing if user opts to delete the migrations.

closes https://github.com/hasura/graphql-engine-mono/issues/292
closes https://github.com/hasura/graphql-engine/issues/5373
closes https://github.com/hasura/graphql-engine/issues/6434

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: fa7ceae7a1970d6724fb601a147900e880ad2e6f
2021-05-24 02:34:33 +00:00
Chris Done
feb08d8998 Various MSSQL bugfixes/cleanups
GitOrigin-RevId: 673df70de7b7f9130482b7a28f860bbaffad44a4
2021-05-21 12:28:52 +00:00
Abby Sassel
1afa4ac3cc server/citus: feature branch
Co-authored-by: Vladimir Ciobanu <1017953+vladciobanu@users.noreply.github.com>
Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
Co-authored-by: Ikechukwu Eze <22247592+iykekings@users.noreply.github.com>
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
Co-authored-by: Phil Freeman <630306+paf31@users.noreply.github.com>
GitOrigin-RevId: 1b964fe5f5f50380172cb702b6a328fed782b6b7
2021-05-21 02:47:51 +00:00
Antoine Leblanc
5238bb8011 server: support for custom directives
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: f11b3b2e964af4860c3bb0fd9efec6be54c2e88b
2021-05-20 10:03:50 +00:00