Commit Graph

561 Commits

Author SHA1 Message Date
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
Vishnu Bharathi
9e3f5a9f01 cli: validate pro plugin version
GitOrigin-RevId: 2bcb64256b357d07d0f06d8347260c649bfcc132
2021-05-20 09:14:29 +00:00
Naveen Naidu
d8d4626ba3 server: fix bigint overflow, incorrect geojson format in event trigger payload
GitOrigin-RevId: f43f54f6851d366b60ff72a1fe9b89ca236c3d89
2021-05-20 07:24:20 +00:00
Karthikeyan Chinnakonda
9a99923fef server: support adding a tracked function as a computed field and vice versa
GitOrigin-RevId: 2f4db0b716d493ce245d9fa7e37e11382f18cd67
2021-05-20 06:29:24 +00:00
Antoine Leblanc
dfbdfca144 server: fix order of fields in introspection output
GitOrigin-RevId: edd6af755d46c3d13c8b7b5504f8d89701a3250f
2021-05-19 16:38:54 +00:00
Swann Moreau
a83194239e server: forward request id when not user-provided
GitOrigin-RevId: 78745dda0112321c809220fdcdeaf2adc6f9c3e5
2021-05-19 14:08:00 +00:00
Abhijeet Khangarot
95d1ab78e1 console: add one-to-one relationships support
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 6177c63a0e8ac86085441cbd4ad1aab179052434
2021-05-19 12:42:45 +00:00
Abby Sassel
3ba5d1e540 server: include more detail in inconsistent metadata error messages (fix #6684)
GitOrigin-RevId: 1a0d8fa2b465320e9ab4ea43259d0e8d92364473
2021-05-19 05:02:53 +00:00
Ikechukwu Eze
a7639145fe console: allow editing sources configuration
This adds the feature to edit data sources to the console

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Martin Mark <74692114+martin-hasura@users.noreply.github.com>
GitOrigin-RevId: 40f97a362620e9cebe97a2267cb9fb143c32af5d
2021-05-19 04:16:38 +00:00
Kali Vara Purushotham Santhati
8edd3f03a5 cli: using forward slash as filepath separator irrespective of os.
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 6ad93a11830868a05a1c02333d482a2978b704c2
2021-05-19 03:36:23 +00:00
Abhijeet Khangarot
8da98c00ba console: show db version in manage db page and remove from about page
GitOrigin-RevId: 482121bb4dd29d36b87f472ec14c966d04daab2c
2021-05-19 03:36:18 +00:00
David Overton
ddad668f07 Fix/custom table name
GitOrigin-RevId: 5004717ac7d9e848ca186a1cdf52e375547034bf
2021-05-18 13:37:27 +00:00
Vishnu Bharathi
b408b04e33 cli: allow space in database name
GitOrigin-RevId: 470bcc6926c19998b2d30787f1ea4649c35bfa41
2021-05-18 10:49:05 +00:00
Antoine Leblanc
ecb90c47a1 server: fix action output fields return type (fix hasura/graphql-engine#6631)
GitOrigin-RevId: 9be5ac87fe69c55aafb6b5af918eb4deb97e27d5
2021-05-18 09:32:43 +00:00
Aravind K P
9dfed5da57 cli: fix applying migrations in a different environment after config v3 update
GitOrigin-RevId: 2f5d554dba50da1d45ea9689afca07f4d0f2c1e5
2021-05-17 15:20:08 +00:00
Vishnu Bharathi
6d340b58c6 cli: adds support for graphql_schema_introspection metadata object
GitOrigin-RevId: a0c372bfa7ee0620bdd80d110da4b1e85e45f73f
2021-05-17 04:53:34 +00:00
Kali Vara Purushotham Santhati
489835eb36 cli: metadata apply,export enhancements
- modified the `dry-run` flag of metadata apply command.
- added new flag `o` which takes "json" or "yaml" as parameters for metadata apply command.
- added new flag `o` which takes "json" or "yaml" as parameters for metadata export command. It outputs the metadata from server to stdout in form of  json or yaml and won't change the project's metadata.
- added deprecation warnings for `--from-file` flag
- added info message for describing change of behavior of `--dry-run` flag
- v3 metadata objects like `rest_endpoints` was also added to list of metadata objects in config v2 (fix)
- the order in which metadata objects are appended to metadata objects list matter when using `--dry-run` flag, refactored this order to match server metadata.
- `metadata apply` command can now accept json/yaml metadata from io pipe
- config v3 `metadata apply` didn't show any information to user when applied metadata is inconsistent, this is addressed.
- removed `github.com/ghodss/yaml` dependency from repo
- version metadata object was added twice during intialization (fix)

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 2316f519eb40645efd86ffee2a85d3c90543ec17
2021-05-14 19:09:59 +00:00
Karthikeyan Chinnakonda
ecb4b9d098 server: graceful shutdown for event and cron triggers and async action (II)
GitOrigin-RevId: 2090c3cc34f633c691b4e4ff9ae918a60c37ce26
2021-05-14 09:39:33 +00:00
Antoine Leblanc
27e68517e7 server: unify parsing Postgres scalars
GitOrigin-RevId: f2a938758cb82b432ec209b0fb453a1d8b206bee
2021-05-13 20:13:49 +00:00
Abhijeet Singh Khangarot
f24caef627 console: add union types to remote schema permissions
GitOrigin-RevId: a2a8311bfee98d1d1285fe869ed2a5963f84440d
2021-05-12 16:19:22 +00:00
Swann Moreau
04a87970f4 server: sanitise event trigger logs (fix #1233)
- sanitise the response field in event trigger and scheduled trigger logs, removing the body and the headers
- flatten the log structure to include the event id at `$.detail.event_id` instead of `$.detail.context.event_id`

the log format changes as follows:
```diff
diff --git a/log b/log
index 96127e0..1fb909a 100644
--- a/log
+++ b/log
@@ -1,48 +1,15 @@
 {
   "detail": {
-    "context": {
-      "event_id": "b9d4e627-6029-43f2-9d46-31c532b07070"
-    },
+    "event_id": "adcc8dcd-2f32-4554-bd55-90c787aee137",
     "request": {
       "size": 416
     },
     "response": {
-      "body": "{\n  \"args\": {}, \n  \"data\": \"{\\\"event\\\":{\\\"session_variables\\\":{\\\"x-hasura-role\\\":\\\"admin\\\"},\\\"op\\\":\\\"INSERT\\\",\\\"data\\\":{\\\"old\\\":null,\\\"new\\\":{\\\"name\\\":\\\"someotheranimal\\\",\\\"id\\\":3}},\\\"trace_context\\\":{\\\"trace_id\\\":\\\"e8237c03de151634\\\",\\\"span_id\\\":\\\"8c5f8952e9e06da8\\\"}},\\\"created_at\\\":\\\"2021-05-06T07:52:58.796611Z\\\",\\\"id>
-      "headers": [
-        {
-          "name": "Date",
-          "value": "Thu, 06 May 2021 07:53:00 GMT"
-        },
-        {
-          "name": "Content-Type",
-          "value": "application/json"
-        },
-        {
-          "name": "Content-Length",
-          "value": "1692"
-        },
-        {
-          "name": "Connection",
-          "value": "keep-alive"
-        },
-        {
-          "name": "Server",
-          "value": "gunicorn/19.9.0"
-        },
-        {
-          "name": "Access-Control-Allow-Origin",
-          "value": "*"
-        },
-        {
-          "name": "Access-Control-Allow-Credentials",
-          "value": "true"
-        }
-      ],
-      "size": 1692,
+      "size": 1719,
       "status": 200
     }
   },
   "level": "info",
-  "timestamp": "2021-05-06T13:23:00.376+0530",
+  "timestamp": "2021-05-06T13:25:14.481+0530",
   "type": "event-trigger"
 }
```

GitOrigin-RevId: d9622de366737da04dc6d9ff73238be16ec9305e
2021-05-12 12:10:53 +00:00
Antoine Leblanc
4c8753afca server: fix single char SQL generation (fixes hasura/graphql-engine#6814)
GitOrigin-RevId: cbbec459cf7b214d50a14e5ef09f2567356e6481
2021-05-11 23:28:30 +00:00
Chris Done
56c094b299 Support query explain for MSSQL (fixes #1024)
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com>
GitOrigin-RevId: 5a57d7570884a5469a947742e4ab9290a0cff55f
2021-05-11 10:05:39 +00:00
Abby Sassel
1e45580e7c server/mssql: fix subscriptions (fixes #6887)
GitOrigin-RevId: 0d0184bd910400ea3a48a650fc61391fa8fd5518
2021-05-10 10:18:45 +00:00
Karthikeyan Chinnakonda
d7ccf81526 server: fix bug when executing a custom function with a row type argument
GitOrigin-RevId: d3a1fa8c9f6b420f4c88eb60c92019c8d0fdc58d
2021-05-06 09:19:49 +00:00
Lyndon Maydwell
3fad5f6678 REST endpoint uuid param bugfix
GitOrigin-RevId: 56066b145576c1f536c420be3e537e8313e61099
2021-05-06 06:44:17 +00:00
hasura-bot
e5b8ae8639 server: support custom URI schemes in CORS config (fix #5818)
GITHUB_PR_NUMBER: 5940
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/5940

Co-authored-by: Carl Patenaude-Poulin <1834919+lilred@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
GitOrigin-RevId: 8060a18a49baeb32e607f2695f16d6867aa1f78e
2021-05-06 00:53:14 +00:00
Antoine Leblanc
34fc92ea8c server: fix validation of query variables (fixes hasura/graphql-engine#6867)
GitOrigin-RevId: 395bf986e0b823f9f18fb9f204e2056b2d2fd682
2021-05-04 17:58:43 +00:00
Aleksandra Sikora
dffe785543 console: read-only modify page for mssql
Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: f3fe2e313b39310bac95e3118e6e14f645627769
2021-05-04 14:41:54 +00:00
Vamshi Surabhi
3dfc50e3ac console/mssql: do not use deprecated sysusers to fetch schema list
On certain MSSQL sources (Azure serverless databases), `sysusers` is not supported.

From [MSSQL docs](https://docs.microsoft.com/en-us/sql/relational-databases/system-compatibility-views/sys-sysusers-transact-sql?view=sql-server-ver15):
> This SQL Server 2000 system table is included as a view for backward compatibility. We recommend that you use the current SQL Server system views instead

Co-authored-by: Ikechukwu Eze <22247592+iykekings@users.noreply.github.com>
GitOrigin-RevId: 6d8a91afa66569cc30b7b83a0c7813a3850c4c9a
2021-05-04 12:41:40 +00:00
Ikechukwu Eze
512c3008b6 console: filter out partitions from track table list and display partition info
### Description
Resolves #1128

### Changelist
- [x] Removed partitions from list of untracked tables (clean up awaits)
- [x] Display table definition at modify table like that of `psql \d+ tableName`
- [x] Fix broken console error when reloading console on `Modify` and `Relationships` tab for any other schema than default redirect schema.
- [x] Fetch table partition info only at /table/modify

### Screenshots
<img width="700" alt="Screenshot 2021-05-04 at 12 57 30" src="https://user-images.githubusercontent.com/9019397/116993856-4c6c2000-acd8-11eb-8a61-cd2b45d6e7ac.png">

### Changelog
- [x] Console

Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 3a6e527839daf52af101c2ce1803eefba600d29e
2021-05-04 11:20:31 +00:00
Rakesh Emmadi
d362e0726e server/mssql: fix MSSQL table metadata SQL, return empty array for no rows
GitOrigin-RevId: ea73e71365150916e1f517f29b812983770644e5
2021-05-03 12:08:11 +00:00
Tirumarai Selvan
eb38eee63a tag release v2.0.0-alpha.10 (#1256)
GitOrigin-RevId: afe16e57e03cf2b790d47f8e44bbb63ae4405f8e
2021-04-29 11:17:50 +00:00
Brandon Simmons
9c9bb43a53 server: restore proper batching behavior in event trigger processing (#1237)
This essentially restores the original code from c425b554b8
(https://github.com/hasura/graphql-engine/pull/4013). Prior to this
commit we would slurp messages as fast as possible from the database
(one thing c425b55 fixed).

Another thing broken as a consequence of the same logic was the
removeEventFromLockedEvents logic which unlocks in-flight events
(breaking at-least-once delivery)

Some archeology, post-c425b55:

- cc8e2ccc erroneously attempted to refactor using `bracket`, resulting
  in the same slurp-all-events behavior (since we don't ever wait for
  processEvent to complete)
- at some point event processing within a batch is made serial, this
  reported as a bug. See: https://github.com/hasura/graphql-engine/issues/5189
- in 0ef52292b5 (which I approved...) an `async` is added, again
  causing the same issue...

GitOrigin-RevId: d8cbaab385267a4c3f1f173e268a385265980fb1
2021-04-29 04:02:05 +00:00
Lyndon Maydwell
507d3aac2c Change schema sync env var to HASURA_GRAPHQL_SCHEMA_SYNC_POLL_INTERVAL
GitOrigin-RevId: 13ed047c9ff391e212c8a50dd13dd0adad666a9e
2021-04-28 22:27:21 +00:00
Swann Moreau
c834629afb server: fix regression in query-log generation
Co-authored-by: Anon Ray <616387+ecthiender@users.noreply.github.com>
GitOrigin-RevId: 74cc6bad2274dc1587f4d3b38e444857d079a4ac
2021-04-28 17:39:02 +00:00
Karthikeyan Chinnakonda
aca8964fdc server: make postgres related ENV vars source specific
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 8ec3db00f00e9c28bf2dc0f47bd312a656c61a69
2021-04-28 16:50:14 +00:00
Vamshi Surabhi
1c668dac0e server/mssql: fix aggregations
Aggregate fields - both the table and the relationship fields haven't been enabled till now. This PR fixes enables the aggregate fields and fixes an issue with root aggregate fields.

Co-authored-by: Chris Done <11019+chrisdone@users.noreply.github.com>
GitOrigin-RevId: a6d7ed9b45cda6af659a57576a8623c725a7372f
2021-04-28 11:06:26 +00:00
Karthikeyan Chinnakonda
bc1e131717 server: accept new env var HASURA_GRAPHQL_EVENTS_FETCH_BATCH_SIZE
GitOrigin-RevId: 62c463d3ee754ce9f05ba09afa8cd74ca807a96c
2021-04-27 17:23:46 +00:00
Vladimir Ciobanu
f50f61ab6a server: fix one-to-one relationships
GitOrigin-RevId: e19f4dec04abbdcf4589d24031705e5c57ea1fbb
2021-04-27 13:45:45 +00:00
kodiakhq[bot]
a935746e17 Integration test improvements (for speed/clarity), also increase polling interval for scheduled events
This claws back ~7min from integration tests (run serially, as with `dev.sh test --integration`
Further improvements would do well to focus on optimizing metadata operations, as `setup` dominates

GitOrigin-RevId: 76637d6fa953c2404627c4391447a05bf09355fa
2021-04-27 05:35:26 +00:00
hasura-bot
3fbc4c3b63 console: quote postgres table name when creating one with a comment
GITHUB_PR_NUMBER: 6761
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6761

Co-authored-by: Ross Gardiner <565371+rossng@users.noreply.github.com>
GitOrigin-RevId: 9fbe6d53724028329b639441b98dff685e5e067e
2021-04-23 15:02:29 +00:00
Antoine Leblanc
5283eebf75 server: fix on_conflict missing when no column update permissions
GitOrigin-RevId: 34dd9f648ca1e268274b6244c48c9e9710c4477d
2021-04-22 10:27:35 +00:00
Aravind K P
cc24e50515 cli: support api_limits in metadata
GitOrigin-RevId: e0d2e30bb2775f761232218aa67cf3781df3e49a
2021-04-21 10:10:08 +00:00
Karthikeyan Chinnakonda
7be8003a4b server: limit of an inherited role will be the max of the limit of the limits of the roles
GitOrigin-RevId: 1373f80a691047a9c69b3705e3aafa9244f673b0
2021-04-21 09:13:15 +00:00
Aravind K P
054a41d93d cli: (regression) fix behaviour of metadata apply --dry-run flag
GitOrigin-RevId: e1f61866f78bbf8b255852c9b9390f02220f5b6b
2021-04-21 08:22:47 +00:00
Tirumarai Selvan
0359e8dbf0 tag release v2.0.0-alpha.9 (#1196)
GitOrigin-RevId: 801cb0a1ab4f69434734beeda3abfca373115e72
2021-04-21 08:22:39 +00:00
Antoine Leblanc
84ed74aba1 server: fix empty remote input objects (fixes #6029, #6703)
GitOrigin-RevId: 3c474ee85b5d1271abfc8848e29ae1d3be28ff63
2021-04-21 01:17:01 +00:00
Abby Sassel
703928de9f mssql: support query multiplexing in subscriptions
GitOrigin-RevId: 757ceba2c1cdb1107ce0b0e41d2e70ac795d0d73
2021-04-20 16:58:13 +00:00
Karthikeyan Chinnakonda
58cf521c62 server: support relationship column comparison with root table columns
GitOrigin-RevId: 9d9bcb82a997c1f060df5ba0726c29d934e70d71
2021-04-19 12:17:07 +00:00
Aravind K P
7638d1832a cli: add support for bigquery
GitOrigin-RevId: 8d479cbd056ee839b11ae24557085573b3e5b5ba
2021-04-19 07:06:18 +00:00
Lyndon Maydwell
33f6ffecec Generating query-log for cached requests
GitOrigin-RevId: fe620d0860854b257ab4901ad301646bacd15e0d
2021-04-19 01:23:01 +00:00
Vijay Prasanna
e3fd4d395a console: bigquery support
Co-authored-by: Abhijeet Singh Khangarot <26903230+abhi40308@users.noreply.github.com>
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 177f57bde4694ab22798e2afd97d489af875e6f7
2021-04-16 17:22:07 +00:00
Tirumarai Selvan
2425607a18 tag release v2.0.0-alpha.8 (#1159)
GitOrigin-RevId: c883bbbef79532ce97b0b25177843f13bb47c184
2021-04-16 13:39:06 +00:00
Vladimir Ciobanu
e8dfeb107b server: query API now requires admin (#1156)
GitOrigin-RevId: a0b45c965805f324e9abfe85ba96dd0d9753713b
2021-04-16 13:27:07 +00:00
Aravind K P
8bc7c2089c cli: fix errors being ignored on metadata apply
GitOrigin-RevId: 1f526c70f57082aa968ebc3d957c78613e9a399e
2021-04-16 11:51:48 +00:00
Rakesh Emmadi
f7c37b007a server: use_prepared_statements option in add_pg_source metadata API
GitOrigin-RevId: 7b5af6d1cafc0b95fc86354293b3c3a4669e8bd2
2021-04-14 17:52:17 +00:00
Philip Carlsen
4cb224afd8 Adding support for ST_3DDWithin and ST_3DIntersects
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: de31fa68fd7dc8ffa0c4e4b89b727a5e14b0525e
2021-04-14 13:03:11 +00:00
Naveen Naidu
f6fbf20b80 Server: Format Tracing values to string
GitOrigin-RevId: eaa5aba0bc283f36870910671e3336aca0ea8222
2021-04-14 10:40:51 +00:00
kodiakhq[bot]
1b378ae6e8 Add a new /dev/rts_stats endpoint, enabled when '+RTS -T'
GitOrigin-RevId: e347bc2f66bad814516662e34bbd8322c214be25
2021-04-13 17:33:38 +00:00
Sameer Kolhar
b03aeb673a console: add live preview for rest endpoints
Co-authored-by: Abhijeet Singh Khangarot <26903230+abhi40308@users.noreply.github.com>
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 918b9f76492085e8ded68070c90eaaae4d424476
2021-04-13 16:21:53 +00:00
Sameer Kolhar
b274a2d240 server: disable caching for actions with forward client headers enabled
Co-authored-by: Lyndon Maydwell <92299+sordina@users.noreply.github.com>
Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
Co-authored-by: hasura-bot <30118761+hasura-bot@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Ikechukwu Eze <22247592+iykekings@users.noreply.github.com>
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
Co-authored-by: Rishichandra Wawhal <27274869+wawhal@users.noreply.github.com>
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: c9a8be3cb607f7767e9d6791717106adf123e3a8
2021-04-13 07:01:34 +00:00
Brandon Simmons
17dc201fef re-Enable HASURA_GRAPHQL_PG_CONN_LIFETIME by default with a default o…
GitOrigin-RevId: 192fc4b80c6bf359334f013af87e20d7de9598ce
2021-04-13 02:55:59 +00:00
Chris Done
f7a202a363 BigQuery Feature Branch
This will implement BigQuery support.

Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
Co-authored-by: Sibi Prabakaran <737477+psibi@users.noreply.github.com>
Co-authored-by: Aniket Deshpande <922486+aniketd@users.noreply.github.com>
Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com>
GitOrigin-RevId: 1a6ffaf34233e13e8125a5c908eaa7e32d65007b
2021-04-12 10:19:20 +00:00
Varun Choudhary
8a77bac164 console: add details button to the success notification to see inserted row
Closes: https://github.com/hasura/graphql-engine/issues/6362

Description:

Add a `detail` button on the success notification while inserting row. We can see row added on clicking `detail` button.
![Screenshot from 2021-03-26 17-37-45](https://user-images.githubusercontent.com/68095256/112629281-1c6c6a00-8e5a-11eb-962a-42143d9501fe.png)

<img width="1051" alt="Screenshot 2021-04-08 at 14 14 10" src="https://user-images.githubusercontent.com/9019397/114024775-bda0ea80-9874-11eb-9ae7-f3ce90e4492e.png">

Effected components:

[x] - Console

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 88257687a2c989369b62115c238aa318ea9780ca
2021-04-08 20:41:29 +00:00
Antoine Leblanc
1a4aad4ba1 server: introduce option to revert to v1 boolean collapse behaviour
GitOrigin-RevId: af6c944270301d8b17618a706ab328a28c0e51dc
2021-04-08 08:26:18 +00:00
Ikechukwu Eze
7db125adc6 console: add custom_column_names to track_table request with replaced invalid characters
This PR allows the use invalid identifiers allowed in SQL server to be used in column names. fixes #954

### Todo
- [x] Track (all) table(s)
- [x] Fetch rows in browse rows
    - [x] Process fetching query
    - [x] Process sort and where clauses
    - [x] Process fetch results

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 7930a2064080156ae067a396523274768f37f17d
2021-04-07 09:12:48 +00:00
Tirumarai Selvan
8be6f55e86 tag release v2.0.0-alpha.7 (#1050)
GitOrigin-RevId: 372e700ee837ef01a18fab3749c0ab9636e4bb88
2021-04-06 11:06:47 +00:00
Aravind K P
1cc3a66fef cli-migrations,ci: add config v3 image
GitOrigin-RevId: ee04d046fd70355495fb18976ebfcca00454c0da
2021-04-06 09:59:16 +00:00
Lyndon Maydwell
c737ce992d Schema-Sync Improvements for Cloud, Pro, and OSS - Version Checking for Metadata (#738)
Modifying schema-sync implementation to use polling for OSS/Pro. Invalidations are now propagated via the `hdb_catalog.hdb_schema_notifications` table in OSS/Pro. Pattern followed is now a Listener/Processor split with Cloud listening for changes via a LISTEN/NOTIFY channel and OSS polling for resource version changes in the metadata table. See issue #460 for more details.

GitOrigin-RevId: 48434426df02e006f4ec328c0d5cd5b30183db25
2021-04-06 03:25:53 +00:00
Abhijeet Singh Khangarot
8274fee00f console: data sidebar bug fixes and improvements
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 169894ff1c4faabc7abee7d0e1e9c3259d5497cc
2021-04-05 15:40:44 +00:00
Rikin Kachhia
7f251d09a2 docs: add ugrade to Hasura v2 guide
GitOrigin-RevId: e45642dee466de7705519b949c5ca33f20a07a4c
2021-04-05 08:11:40 +00:00
Antoine Leblanc
71ae144aa6 server: implement transaction workaround
GitOrigin-RevId: 404f8bbdefb8a99b31fac75e4253daad81c8af90
2021-04-01 20:41:41 +00:00
Aravind K P
7f420ad1ae cli: add --all--databases flag on migrate apply
GitOrigin-RevId: 87a8b4250abad349153d1af73917859bd8f2a31a
2021-04-01 12:59:20 +00:00
Aravind K P
cc3539415b cli: fix seeds incorrectly being applied to databases
GitOrigin-RevId: cce2612ddfd90d1fd10a0a3561d24c64569a6935
2021-04-01 10:39:53 +00:00
Rikin Kachhia
e3d8a721ee server: add "SET check_function_bodies=false" in pg_dump clean output
GitOrigin-RevId: f0526f9666c3986d8e3b374556859043f10dbe8d
2021-03-31 14:49:38 +00:00
Antoine Leblanc
60da76ed89 server/mssql: fix foreign keys being wrongfully coalesced
GitOrigin-RevId: 0cfef7176e751d17ea709814ae912574511ca79a
2021-03-31 13:49:31 +00:00
Rakesh Emmadi
362230e8d0 server: async action query subscription
Multi source support had limited the availability of async action queries in subscriptions. This PR
adds support for async action query subscriptions with new implementation. Also addresses https://github.com/hasura/graphql-engine/issues/6460.

GitOrigin-RevId: 5ddc321073d224f287dc4b86ce2239ff55190b36
2021-03-31 10:40:15 +00:00
Rakesh Emmadi
7798b9c870 server: allow replacing configuration in add source metadata API (#956)
GitOrigin-RevId: a797d6f1f1e568eeab6acd752d3404a30b890461
2021-03-30 10:10:23 +00:00
Vladimir Ciobanu
c08e6d108b server: allow GeoJSON to be passed for Geometry/Geography operators
GitOrigin-RevId: 51ca927b55d3d717da07447f67fd4d3c068a8357
2021-03-26 17:00:18 +00:00
Abby Sassel
33a710f4c7 server/docs: Add MSSQL testing steps for those running pytest manually
GitOrigin-RevId: 36eaab863c7bea552a394bd6c36cedb1aa877f50
2021-03-26 09:49:19 +00:00
Antoine Leblanc
9052518da2 Revert #893
GitOrigin-RevId: 055e7c2761ceae028d4fefc282475199714e6efe
2021-03-25 16:38:47 +00:00
Rakesh Emmadi
d0048897cf server: use_prepared_statements option in add_pg_source metadata API (#893)
* add `use_prepared_statements` option to add_pg_source API

* update CHANGELOG.md

* change default value for 'use_prepared_statements' to False

* update CHANGELOG.md

GitOrigin-RevId: 6f5b90991f4a8c03a51e5829d2650771bb0e29c1
2021-03-25 12:54:00 +00:00
Naveen Naidu
bade27c1cc server: emit max connections reached error from postgres
Co-authored-by: Anon Ray <616387+ecthiender@users.noreply.github.com>
GitOrigin-RevId: 26ea3bcb7a2b247f26c9b032b23ac6d68d40b4aa
2021-03-25 07:42:49 +00:00
Sameer Kolhar
a73b6479b1 server/console/docs: add a comment field for actions
####  CHANGELOG (done)

#### PR description

This PR hopes to resolve https://github.com/hasura/graphql-engine/issues/4662.
The main work done in this PR is to add an comment field on the add actions page. Prior to this the `actionsDescription` was used as the comment for actions.

#### Updated UI

![image](https://user-images.githubusercontent.com/6604943/111342362-64dc9880-86a0-11eb-8922-36b72bf100cb.png)

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 5f31b27d66c27bc6c1b0fc5044f0ac13ecc11fa0
2021-03-24 20:11:48 +00:00
Abby Sassel
9f0bcabf23 server/mssql: better support for spatial data operators (fixes #789)
GitOrigin-RevId: b3d59a5c351e747370b82d086fe13d5d8d178d05
2021-03-24 13:44:44 +00:00
Tirumarai Selvan
ce37e7b1f1 tag release v2.0.0-alpha.6 (#947)
GitOrigin-RevId: a214f5e6ba20a0975e5f8a6c2478950f7455549f
2021-03-24 11:26:22 +00:00
Karthikeyan Chinnakonda
d236391af8 server: remove restriction of tracking only base function argument types
GitOrigin-RevId: 48feb18f1075bb8fe6a1b27a950198127eaaf3da
2021-03-23 16:04:11 +00:00
Abhijeet Singh Khangarot
c597efb65e console: display collection names and queries from all collections in allowlist
This PR
* Gets all queries from all collections present in allowlist and displays those. (Earlier we were just displaying queries present in "allowed-queries" collection.
* Adds collection names to allow-list section

### Description
fix [4138](https://github.com/hasura/graphql-engine/issues/4138)

### Affected components
- [x] Console

### Solution and Design
<img width="828" alt="Screenshot 2021-01-04 at 12 11 01 PM" src="https://user-images.githubusercontent.com/26903230/103507774-eb495280-4e85-11eb-9ef7-95871fb03edd.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.

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: d96d2aadebeabc00073e028d514db429ee18f187
2021-03-23 14:42:15 +00:00
Vladimir Ciobanu
6dcb3dfc8d server: mssql: fix ToTxt TableName instance
GitOrigin-RevId: e5c1cceb753477c801c4dac570f9f9cfd56f36f0
2021-03-22 20:07:33 +00:00
Sameer Kolhar
0dcb00b90e console: allow editing rest endpoints queries and misc ui improvements
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 4dd360eb07b836c6fd6ce666c9444728e22847d7
2021-03-22 17:54:22 +00:00
Rakesh Emmadi
97549ccc8e server: fix action output type generation (#850)
* fix action output type generation

* update CHANGELOG.md

GitOrigin-RevId: 558ff640f5fe5dd5ebf15a3c063f1b989a5fb28a
2021-03-22 10:57:46 +00:00
Antoine Leblanc
f1183b8ae3 server: memoize recursive action input arguments
GitOrigin-RevId: 0dc11f95953f6ad8dfcd82a11f105442042291f8
2021-03-19 14:47:58 +00:00
Abby Sassel
6436ac06e0 server/mssql: support N/IN and N/LIKE operators
GitOrigin-RevId: 6f897b384a4469425d46b1bedf015ecbd1600fcc
2021-03-19 12:43:14 +00:00
Aravind K P
d4921549cf cli: match project metadata key ordering with server metadata
GitOrigin-RevId: 3052dd7cf8a066ac4378a48641935ed98fe0657f
2021-03-19 07:38:48 +00:00
Vladimir Ciobanu
f0dd71db59 server: mssql_add_source: allow connection strings from environment
GitOrigin-RevId: d51e14bdfbb57b83a453f5954397792cbe81455b
2021-03-18 18:33:48 +00:00
Karthikeyan Chinnakonda
395de58c42 server: fix inherited_roles issue when some of the underlying roles don't have permissions configured
GitOrigin-RevId: 771491ec0cf6c0d860ef374ed67b426220fa2b96
2021-03-18 15:29:25 +00:00
Karthikeyan Chinnakonda
478c01ab9b server: support tracking functions having only base type arguments
GitOrigin-RevId: e8939ad25212fc0965e0912fc88721a0cdff844e
2021-03-18 12:50:52 +00:00
Tirumarai Selvan
e56e606ddb tag release v2.0.0-alpha.5 (#890)
GitOrigin-RevId: 63d7ffdb732360b96b3dc5ee670b4bb9cf1ef613
2021-03-18 06:30:20 +00:00
Aravind K P
a9e78b267f cli: fix issue with adding operation to allow list in console mode
GitOrigin-RevId: 6f5d1e4e103e3a219bbfe1fb1ff213aa9e3fd521
2021-03-18 06:11:56 +00:00
hasura-bot
08ba8eda15 console: package modules from oss
GITHUB_PR_NUMBER: 6242
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6242

Co-authored-by: Karthik Venkateswaran <25095884+karthikvt26@users.noreply.github.com>
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
Co-authored-by: Rishichandra Wawhal <27274869+wawhal@users.noreply.github.com>
Co-authored-by: Vladimir Ciobanu <1017953+vladciobanu@users.noreply.github.com>
Co-authored-by: Praveen Durairaju <14110316+praveenweb@users.noreply.github.com>
Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com>
Co-authored-by: Sameer Kolhar <6604943+kolharsam@users.noreply.github.com>
GitOrigin-RevId: 029ac93967c14e634c1baa96f1e4c9b6bb198e91
2021-03-17 18:59:18 +00:00
Abhijeet Singh Khangarot
1c1198c93b console: remote schema permissions bug fixes
Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com>
GitOrigin-RevId: 78c4e144ea32ab1376f36272fab0204c2bd88ef0
2021-03-17 15:57:36 +00:00
hasura-bot
2099208e4b cli: merges cli-ext with cli
GITHUB_PR_NUMBER: 6640
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6640

Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 362d82d8ee18afd7efa63e9c8912f6c5444f82dd
2021-03-17 15:10:03 +00:00
Vijay Prasanna
8103589b79 console: add browse rows for MSSQL
### Description
This PR adds `Browse` tab for MSSQL server.

### Changelist
* [x] Use the server provided GraphQL API to fetch data for browse rows, related issue [here](https://github.com/hasura/graphql-engine-mono/issues/691).
* [x] Use GraphQL API to export data in CSV/JSON format.
* [x] Add Relationship view for tracked relationships.
  * [x] Modify Query generation based on `Array` or `Object` relationship.
* [x] Add custom Pagination Component.
* [x] Make `FilterQuery` sort and filter work for MS SQL server.
### Screenshot
![Screenshot 2021-03-09 at 4 11 22 PM](https://user-images.githubusercontent.com/11921040/110458750-22d8b300-80f2-11eb-8df0-94ed4a1a27f3.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

### Issues that will arise from this PR
- Incorrect number of row counts when exporting table as JSON or CSV - (depends on aggregation support on mssql)
- Disabled actions buttons on table - (depends on mutation support on mssql)
- Display of row counts on Browse Rows - (depends on aggregation support on mssql)

Co-authored-by: Ikechukwu Eze <22247592+iykekings@users.noreply.github.com>
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 803f4a7ce482a01eb9bf29c0ad5e0f26eb4375e5
2021-03-17 12:40:19 +00:00
Karthikeyan Chinnakonda
6093010a6e server: fix issue of parsing input objects in remote schema queries
GitOrigin-RevId: 98c62cab836aff2778dbfedd6535450989090a30
2021-03-15 06:32:07 +00:00
Tirumarai Selvan
692e374c94 tag release v2.0.0-alpha.4
GitOrigin-RevId: fdde115ba4442795494566f2d6a2aacbf50f0632
2021-03-10 11:48:44 +00:00
Vijay Prasanna
89e26d3e9f console: add inherited roles tab
Co-authored-by: Abhijeet Singh Khangarot <26903230+abhi40308@users.noreply.github.com>
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: b6edc26b96e2cd0db11e7951b7941a631932d125
2021-03-10 10:45:18 +00:00
Anon Ray
d16bc4fe46 server: fix handling of nullable object relationships
GitOrigin-RevId: 3214e77ed06a07b6c1293d59daa088649a881e78
2021-03-10 08:56:03 +00:00
Lyndon Maydwell
0c1016e065 Inconsistent metadata support for REST endpoints
Previously invalid REST endpoints would throw errors during schema cache build.

This PR changes the validation to instead add to the inconsistent metadata objects in order to allow use of `allow_inconsistent_metadata` with inconsistent REST endpoints.

All non-fatal endpoint definition errors are returned as inconsistent metadata warnings/errors depending on the use of `allow_inconsistent_metadata`. The endpoints with issues are then created and return informational runtime errors when they are called.

Console impact when creating endpoints is that error messages now refer to metadata inconsistencies rather than REST feature at the top level:

![image](https://user-images.githubusercontent.com/92299/109911843-ede9ec00-7cfe-11eb-9c55-7cf924d662a6.png)

<img width="969" alt="image" src="https://user-images.githubusercontent.com/92299/110258597-8336fa00-7ff7-11eb-872c-bfca945aa0e8.png">

Note: Conflicting endpoints generate one error per conflicting set of endpoints due to the implementation of `groupInconsistentMetadataById` and `imObjectIds`. This is done to ensure that error messages are terse, but may pose errors if there are some assumptions made surrounding `imObjectIds`.

Related to https://github.com/hasura/graphql-engine-mono/pull/473 (Allow Inconsistent Metadata (v2) #473 (Merged))

---

### Kodiak commit message

Changes the validation to use inconsistent metadata objects for REST endpoint issues.

#### Commit title

Inconsistent metadata for REST endpoints

GitOrigin-RevId: b9de971208e9bb0a319c57df8dace44cb115ff66
2021-03-10 05:26:10 +00:00
Sameer Kolhar
eccefff925 console: permissions support for sql server
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 1dce9fff909ccf34e904c785116462ce16b8c44b
2021-03-10 03:51:03 +00:00
Aravind K P
4abc2061fe cli: support inherited roles in metadata
GitOrigin-RevId: f70f199e8ef5c9b859250673bcb7de766400748c
2021-03-09 20:21:03 +00:00
Karthikeyan Chinnakonda
0a7d634326 server: fix issue when remote relationship col has a custom GQL name
GitOrigin-RevId: ca45383020d0e8f80afb445ab8bb240cc1505ea9
2021-03-09 09:25:29 +00:00
Aravind K P
ae92ac4941 cli: rename flag --database to --database-name
GitOrigin-RevId: 37fb8dd4f82c2b68f87013e5ec87d5b2dab8853f
2021-03-09 06:44:37 +00:00
Aravind K P
d18e172662 cli: allow relative paths in !include directives
GitOrigin-RevId: c4928e8a1e8918b1a24774ccafbcc5839574f5d7
2021-03-09 05:57:45 +00:00
Aravind K P
f6ca551df4 cli: support mssql sources
GitOrigin-RevId: 4b1a63c8dc342ae4001b16c4b1dce282092d5c6f
2021-03-08 12:00:34 +00:00
Karthikeyan Chinnakonda
92026b769f [Preview] Inherited roles for postgres read queries
fixes #3868

docker image - `hasura/graphql-engine:inherited-roles-preview-48b73a2de`

Note:

To be able to use the inherited roles feature, the graphql-engine should be started with the env variable `HASURA_GRAPHQL_EXPERIMENTAL_FEATURES` set to `inherited_roles`.

Introduction
------------

This PR implements the idea of multiple roles as presented in this [paper](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/FGALanguageICDE07.pdf). The multiple roles feature in this PR can be used via inherited roles. An inherited role is a role which can be created by combining multiple singular roles. For example, if there are two roles `author` and `editor` configured in the graphql-engine, then we can create a inherited role with the name of `combined_author_editor` role which will combine the select permissions of the `author` and `editor` roles and then make GraphQL queries using the `combined_author_editor`.

How are select permissions of different roles are combined?
------------------------------------------------------------

A select permission includes 5 things:

1. Columns accessible to the role
2. Row selection filter
3. Limit
4. Allow aggregation
5. Scalar computed fields accessible to the role

 Suppose there are two roles, `role1` gives access to the `address` column with row filter `P1` and `role2` gives access to both the `address` and the `phone` column with row filter `P2` and we create a new role `combined_roles` which combines `role1` and `role2`.

Let's say the following GraphQL query is queried with the `combined_roles` role.

```graphql
query {
   employees {
     address
     phone
   }
}
```

This will translate to the following SQL query:

```sql

 select
    (case when (P1 or P2) then address else null end) as address,
    (case when P2 then phone else null end) as phone
 from employee
 where (P1 or P2)
```

The other parameters of the select permission will be combined in the following manner:

1. Limit - Minimum of the limits will be the limit of the inherited role
2. Allow aggregations - If any of the role allows aggregation, then the inherited role will allow aggregation
3. Scalar computed fields - same as table column fields, as in the above example

APIs for inherited roles:
----------------------

1. `add_inherited_role`

`add_inherited_role` is the [metadata API](https://hasura.io/docs/1.0/graphql/core/api-reference/index.html#schema-metadata-api) to create a new inherited role. It accepts two arguments

`role_name`: the name of the inherited role to be added (String)
`role_set`: list of roles that need to be combined (Array of Strings)

Example:

```json
{
  "type": "add_inherited_role",
  "args": {
      "role_name":"combined_user",
      "role_set":[
          "user",
          "user1"
      ]
  }
}
```

After adding the inherited role, the inherited role can be used like single roles like earlier

Note:

An inherited role can only be created with non-inherited/singular roles.

2. `drop_inherited_role`

The `drop_inherited_role` API accepts the name of the inherited role and drops it from the metadata. It accepts a single argument:

`role_name`: name of the inherited role to be dropped

Example:

```json

{
  "type": "drop_inherited_role",
  "args": {
      "role_name":"combined_user"
  }
}
```

Metadata
---------

The derived roles metadata will be included under the `experimental_features` key while exporting the metadata.

```json
{
  "experimental_features": {
    "derived_roles": [
      {
        "role_name": "manager_is_employee_too",
        "role_set": [
          "employee",
          "manager"
        ]
      }
    ]
  }
}
```

Scope
------

Only postgres queries and subscriptions are supported in this PR.

Important points:
-----------------

1. All columns exposed to an inherited role will be marked as `nullable`, this is done so that cell value nullification can be done.

TODOs
-------

- [ ] Tests
   - [ ] Test a GraphQL query running with a inherited role without enabling inherited roles in experimental features
   - [] Tests for aggregate queries, limit, computed fields, functions, subscriptions (?)
   - [ ] Introspection test with a inherited role (nullability changes in a inherited role)
- [ ] Docs
- [ ] Changelog

Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com>
GitOrigin-RevId: 3b8ee1e11f5ceca80fe294f8c074d42fbccfec63
2021-03-08 11:15:10 +00:00
Naveen Naidu
f55df228fe Server: Add Event Trigger Metrics
- [x] **Event Triggers Metrics**
  - [x] Distribution of size of event trigger fetches / Number of events fetched in the last `event trigger fetch`
  - [x] Event Triggers: Number of event trigger HTTP workers in process
  - [x]  Event Triggers: Avg event trigger lock time (if an event has been fetched but not processed because http worker is not free)

#### Sample response
The metrics can be viewed from the `/dev/ekg` endpoint

```json
{
"num_events_fetched":{
      "max":0,
      "mean":0,
      "count":1,
      "min":0,
      "variance":null,
      "type":"d",
      "sum":0
   },
 "num_event_trigger_http_workers":{
      "type":"g",
      "val":0
   },
"event_lock_time":{
      "max":0,
      "mean":0,
      "count":0,
      "min":0,
      "variance":0,
      "type":"d",
      "sum":0
   },
```

#### Todo
- [ ]  Group similar metrics together (Eg: Group all the metrics related to Event trigger, How do we do it??)

Closes: https://github.com/hasura/graphql-engine-mono/issues/202
GitOrigin-RevId: bada11d871272b04c8a09d006d9d037a8464a472
2021-03-07 05:25:24 +00:00
Antoine Leblanc
5a1f71b3bc server/mssql: fix parsing of text column values
GitOrigin-RevId: c4692cdc254af074f70cdceb78c7dc6211e7e084
2021-03-05 18:33:16 +00:00
Rakesh Emmadi
edf5a0661e server: support mssql views
GitOrigin-RevId: 50e2fc1d64a67a9284ae62d2401ca6f9627ebdab
2021-03-05 10:53:38 +00:00
Aravind K P
c8e08e2804 cli: support rest endpoints
GitOrigin-RevId: cd32497fb751489d9b17e91e30e18772f7fa07ec
2021-03-05 03:22:59 +00:00
Tirumarai Selvan
d1d8cc0a40 tag release v2.0.0-alpha.3 (#790)
GitOrigin-RevId: 7b61e8190d07ebe45ff96ee5209992dfc3c53b93
2021-03-04 14:30:32 +00:00
Karthikeyan Chinnakonda
f2199c4174 fix the changelog of static console assets fix (#771)
GitOrigin-RevId: 9516a41c3f615b1ef5264a7c902adf153ae85c00
2021-03-04 06:50:35 +00:00
Vijay Prasanna
968b573171 console: add relationship tab for mssql tables
GitOrigin-RevId: dc55849c9c38834481fc855e5242f7bf0d3a5e6e
2021-03-03 14:18:38 +00:00
Vladimir Ciobanu
d5ff1acf2d better handling for one-to-one relationships
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 1bb5bc0c4ac8109ee1d20563d23cf98e0906a483
2021-03-03 13:02:59 +00:00
Karthikeyan Chinnakonda
f2724c97b4 build: fix the packaging of the static console assets
GitOrigin-RevId: 01a6e4f15366476f01ca355f1013712e24bb4a3b
2021-03-02 13:23:53 +00:00
David Overton
e4c8d560c5 Fix/missing source error
GitOrigin-RevId: 074f4eb2d13a2c8ab002a355c6734eed257482d3
2021-03-02 04:27:29 +00:00
Abby Sassel
01cb59919f docs: changelog & server documentation improvements
GitOrigin-RevId: e6a5e464acb5492ab7a592362fff2bac6528dfaa
2021-03-01 20:53:43 +00:00
Praveen Durairaju
0ff26100bf update docs link to avoid redirects
GitOrigin-RevId: 1f2a1d21bfb9b2908d56305fa2dfb69270deafdf
2021-03-01 18:51:18 +00:00
Vamshi Surabhi
e9f85ce6e6 mssql: connection pooling
GitOrigin-RevId: c1a6509f19a903724ce2b770ae23cbd925b537f8
2021-02-25 18:16:52 +00:00
Abby Sassel
fb1a0d286d server: support ltree operators (close #625)
GitOrigin-RevId: fb6a3eb8cbe4604789938bcbc78916fbcd1af515
2021-02-25 11:06:49 +00:00
Antoine Leblanc
f55bbe96ef server: fix MSSQL returning malformed JSON on empty select
GitOrigin-RevId: b0b9f68dbdb2b015e4c0640670a2e4cf978fe5fb
2021-02-25 09:58:24 +00:00
Karthikeyan Chinnakonda
4211d27272 server: support reading JWT from Cookie header
GitOrigin-RevId: 1de90242d3c000361f87256c2dddce1677863231
2021-02-25 09:03:46 +00:00
Vamshi Surabhi
74a58fb66c mssql: basic support for geography and geometry types
GitOrigin-RevId: 97bbf0e8d53b00c9f4365b145adb19bdcd769ceb
2021-02-24 12:53:15 +00:00
Lyndon Maydwell
b944d598e0 Adding check for multiple query definitions for rest endpoints
When adding a rest endpoint that references a query with multiple definitions, throw an error.

Needed a second PR for this as Kodiak merged the prior PR before this commit was added.

---

### Kodiak commit message

Adding check for multiple query definitions for rest endpoints.

GitOrigin-RevId: 6e3977a210e29f143b61282fbb37c93eb5b9d73c
2021-02-24 10:13:11 +00:00
Lyndon Maydwell
08da0c63b6 REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions
Resolves Issues:

* https://github.com/hasura/graphql-engine-mono/issues/658 - Invalid Slashes
* https://github.com/hasura/graphql-engine-mono/issues/628 - Subscriptions

Implementation:

* Moved some logic from Endpoint.hs to allow reuse of splitting url into PathSegments.
* Additional validation steps alongside checking for overlapping routes
* Logging potential misuse of GET for mutations

Future Work:

* [ ] GET is allowed for mutations (Ignore/Log warning for Now)
* [ ] Add to scInconsistentObjs rather than throwing error
  * Add information to scInconsistentObjs instead of raising errors directly.

TODO:

* [x] Duplicate variable segments with the same name in the location should not be allowed
* [x] We should throw an error on trailing and leading slashes and URLs which contain empty segments
* [x] Endpoints can be created using subscriptions. But the error only shows at the time of the query
* [x] Tests

---

### Kodiak commit message

Prohibit Invalid slashes, duplicate variables, subscriptions for REST endpoints.

GitOrigin-RevId: 86c0d4af97984c8afd02699e6071e9c1658710b8
2021-02-24 04:31:05 +00:00