2021-10-29 17:42:07 +03:00
|
|
|
- description: PG add source
|
|
|
|
url: /v1/metadata
|
|
|
|
status: 200
|
|
|
|
response:
|
|
|
|
message: success
|
|
|
|
query:
|
|
|
|
type: pg_add_source
|
|
|
|
args:
|
|
|
|
name: pg1
|
|
|
|
configuration:
|
|
|
|
connection_info:
|
|
|
|
database_url:
|
|
|
|
from_env: HASURA_GRAPHQL_PG_SOURCE_URL_1
|
|
|
|
pool_settings:
|
|
|
|
max_connections: 50
|
|
|
|
idle_timeout: 180
|
|
|
|
retries:
|
|
|
|
customization:
|
|
|
|
root_fields:
|
|
|
|
namespace: my_source
|
|
|
|
type_names:
|
|
|
|
prefix: foo_
|
|
|
|
|
|
|
|
- description: create table 1
|
|
|
|
url: /v1/query
|
|
|
|
status: 200
|
|
|
|
response:
|
|
|
|
result_type: CommandOk
|
|
|
|
result:
|
|
|
|
query:
|
|
|
|
type: run_sql
|
|
|
|
args:
|
|
|
|
source: pg1
|
|
|
|
sql: |
|
2021-11-26 14:39:25 +03:00
|
|
|
create table author_local(
|
2021-10-29 17:42:07 +03:00
|
|
|
id serial primary key,
|
|
|
|
name text unique
|
|
|
|
);
|
2021-11-26 14:39:25 +03:00
|
|
|
INSERT INTO author_local (name)
|
2021-10-29 17:42:07 +03:00
|
|
|
VALUES ('Author 1'), ('Author 2');
|
|
|
|
|
|
|
|
- description: track table
|
|
|
|
url: /v1/metadata
|
|
|
|
status: 200
|
|
|
|
response:
|
|
|
|
message: success
|
|
|
|
query:
|
|
|
|
type: pg_track_table
|
|
|
|
args:
|
2021-11-26 14:39:25 +03:00
|
|
|
table: author_local
|
2021-10-29 17:42:07 +03:00
|
|
|
source: pg1
|
|
|
|
|
|
|
|
|
|
|
|
- description: Simple GraphQL query to fetch items from the source table
|
|
|
|
url: /v1/graphql
|
|
|
|
status: 200
|
|
|
|
response:
|
|
|
|
data:
|
|
|
|
my_source:
|
|
|
|
__typename: foo_my_source_query
|
2021-11-26 14:39:25 +03:00
|
|
|
author_local:
|
2021-10-29 17:42:07 +03:00
|
|
|
- id: 1
|
|
|
|
name: 'Author 1'
|
2021-11-26 14:39:25 +03:00
|
|
|
__typename: foo_author_local
|
2021-10-29 17:42:07 +03:00
|
|
|
- id: 2
|
|
|
|
name: 'Author 2'
|
2021-11-26 14:39:25 +03:00
|
|
|
__typename: foo_author_local
|
2021-10-29 17:42:07 +03:00
|
|
|
query:
|
|
|
|
query: |
|
|
|
|
query {
|
|
|
|
my_source {
|
|
|
|
__typename
|
2021-11-26 14:39:25 +03:00
|
|
|
author_local {
|
2021-10-29 17:42:07 +03:00
|
|
|
id
|
|
|
|
name
|
|
|
|
__typename
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- description: untrack table
|
|
|
|
url: /v1/metadata
|
|
|
|
status: 200
|
|
|
|
response:
|
|
|
|
message: success
|
|
|
|
query:
|
|
|
|
type: pg_untrack_table
|
|
|
|
args:
|
2021-11-26 14:39:25 +03:00
|
|
|
table: author_local
|
2021-10-29 17:42:07 +03:00
|
|
|
source: pg1
|
|
|
|
|
|
|
|
- description: drop table
|
|
|
|
url: /v1/query
|
|
|
|
status: 200
|
|
|
|
response:
|
|
|
|
result_type: CommandOk
|
|
|
|
result:
|
|
|
|
query:
|
|
|
|
type: run_sql
|
|
|
|
args:
|
|
|
|
source: pg1
|
|
|
|
sql: |
|
2021-11-26 14:39:25 +03:00
|
|
|
drop table author_local;
|
2021-10-29 17:42:07 +03:00
|
|
|
|
|
|
|
- description: PG Drop Source 1
|
|
|
|
url: /v1/metadata
|
|
|
|
status: 200
|
|
|
|
response:
|
|
|
|
message: success
|
|
|
|
query:
|
|
|
|
type: pg_drop_source
|
|
|
|
args:
|
|
|
|
name: pg1
|