graphql-engine/server/tests-py/queries/graphql_query/citus/setup_citus.yaml
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

157 lines
3.0 KiB
YAML

type: bulk
args:
#Author table
- type: citus_track_table
args:
source: citus
table:
name: author
#Article table
- type: citus_track_table
args:
source: citus
table:
name: article
#Object relationship
- type: citus_create_object_relationship
args:
source: citus
table: article
name: author
using:
foreign_key_constraint_on: author_id
#Array relationship
- type: citus_create_array_relationship
args:
source: citus
table: author
name: articles
using:
foreign_key_constraint_on:
table: article
column: author_id
#country table
- type: citus_track_table
args:
source: citus
table:
name: country
#state table
- type: citus_track_table
args:
source: citus
table:
name: state
#disaster table
- type: citus_track_table
args:
source: citus
table:
name: disaster
#disaster_affected_state table
- type: citus_track_table
args:
source: citus
table:
name: disaster_affected_state
# #using metadata from
# #https://github.com/hasura/graphql-engine-mono/blob/vamshi/rfc/citus-support/rfcs/citus-support.md
- type: citus_create_array_relationship
args:
source: citus
table: country
name: states
using:
foreign_key_constraint_on:
table: state
column: country_id
- type: citus_create_array_relationship
args:
source: citus
table: country
name: disasters
using:
manual_configuration:
remote_table: disaster
column_mapping:
id: country_id
- type: citus_create_object_relationship
args:
source: citus
table: state
name: country
using:
foreign_key_constraint_on: country_id
- type: citus_create_object_relationship
args:
source: citus
table: disaster
name: country
using:
manual_configuration:
remote_table: country
column_mapping:
country_id: id
- type: citus_create_array_relationship
args:
source: citus
table: disaster
name: affected_states
using:
manual_configuration:
remote_table: disaster_affected_state
column_mapping:
id: disaster_id
country_id: country_id
- type: citus_create_object_relationship
args:
source: citus
table: disaster_affected_state
name: state
using:
manual_configuration:
remote_table: state
column_mapping:
state_id: id
- type: citus_create_object_relationship
args:
source: citus
table: disaster_affected_state
name: disaster
using:
manual_configuration:
remote_table: disaster
column_mapping:
disaster_id: id
country_id: country_id
#search_disasters_sql function
- type: citus_track_function
args:
source: citus
function:
name: search_disasters_sql
#search_disasters_plpgsql function
- type: citus_track_function
args:
source: citus
function:
name: search_disasters_plpgsql