From 3a1f533d63da9a7c681cc80f4ef58e4e96ada2e8 Mon Sep 17 00:00:00 2001 From: windyboy Date: Wed, 7 Aug 2024 17:15:41 +0800 Subject: [PATCH] hasura --- internal/repository/generated.go | 10 +- internal/repository/schema.graphql | 641 ++--------------------------- 2 files changed, 31 insertions(+), 620 deletions(-) diff --git a/internal/repository/generated.go b/internal/repository/generated.go index a184737..f196966 100644 --- a/internal/repository/generated.go +++ b/internal/repository/generated.go @@ -13,7 +13,7 @@ import ( // input type for inserting data into table "aviation.telegrams" type Aviation_telegrams_insert_input struct { - Text string `json:"Text"` + Body_and_footer string `json:"body_and_footer"` Body_data json.RawMessage `json:"body_data"` Category string `json:"category"` Date_time string `json:"date_time"` @@ -27,11 +27,12 @@ type Aviation_telegrams_insert_input struct { Priority_indicator string `json:"priority_indicator"` Received_at time.Time `json:"received_at"` Secondary_addresses string `json:"secondary_addresses"` + Text string `json:"text"` Uuid uuid.UUID `json:"uuid"` } -// GetText returns Aviation_telegrams_insert_input.Text, and is useful for accessing the field via an interface. -func (v *Aviation_telegrams_insert_input) GetText() string { return v.Text } +// GetBody_and_footer returns Aviation_telegrams_insert_input.Body_and_footer, and is useful for accessing the field via an interface. +func (v *Aviation_telegrams_insert_input) GetBody_and_footer() string { return v.Body_and_footer } // GetBody_data returns Aviation_telegrams_insert_input.Body_data, and is useful for accessing the field via an interface. func (v *Aviation_telegrams_insert_input) GetBody_data() json.RawMessage { return v.Body_data } @@ -76,6 +77,9 @@ func (v *Aviation_telegrams_insert_input) GetSecondary_addresses() string { return v.Secondary_addresses } +// GetText returns Aviation_telegrams_insert_input.Text, and is useful for accessing the field via an interface. +func (v *Aviation_telegrams_insert_input) GetText() string { return v.Text } + // GetUuid returns Aviation_telegrams_insert_input.Uuid, and is useful for accessing the field via an interface. func (v *Aviation_telegrams_insert_input) GetUuid() uuid.UUID { return v.Uuid } diff --git a/internal/repository/schema.graphql b/internal/repository/schema.graphql index 4a56af6..d13567d 100644 --- a/internal/repository/schema.graphql +++ b/internal/repository/schema.graphql @@ -85,7 +85,7 @@ input String_comparison_exp { columns and relationships of "aviation.telegrams" """ type aviation_telegrams { - Text: String + body_and_footer: String body_data( """JSON select path""" path: String @@ -102,6 +102,7 @@ type aviation_telegrams { priority_indicator: String received_at: timestamp! secondary_addresses: String + text: String! uuid: uuid! } @@ -131,10 +132,10 @@ input aviation_telegrams_append_input { Boolean expression to filter rows from the table "aviation.telegrams". All fields are combined with a logical 'AND'. """ input aviation_telegrams_bool_exp { - Text: String_comparison_exp _and: [aviation_telegrams_bool_exp!] _not: aviation_telegrams_bool_exp _or: [aviation_telegrams_bool_exp!] + body_and_footer: String_comparison_exp body_data: jsonb_comparison_exp category: String_comparison_exp date_time: String_comparison_exp @@ -148,6 +149,7 @@ input aviation_telegrams_bool_exp { priority_indicator: String_comparison_exp received_at: timestamp_comparison_exp secondary_addresses: String_comparison_exp + text: String_comparison_exp uuid: uuid_comparison_exp } @@ -186,7 +188,7 @@ input aviation_telegrams_delete_key_input { input type for inserting data into table "aviation.telegrams" """ input aviation_telegrams_insert_input { - Text: String + body_and_footer: String body_data: jsonb category: String date_time: String @@ -200,12 +202,13 @@ input aviation_telegrams_insert_input { priority_indicator: String received_at: timestamp secondary_addresses: String + text: String uuid: uuid } """aggregate max on columns""" type aviation_telegrams_max_fields { - Text: String + body_and_footer: String category: String date_time: String dispatched_at: timestamp @@ -217,12 +220,13 @@ type aviation_telegrams_max_fields { priority_indicator: String received_at: timestamp secondary_addresses: String + text: String uuid: uuid } """aggregate min on columns""" type aviation_telegrams_min_fields { - Text: String + body_and_footer: String category: String date_time: String dispatched_at: timestamp @@ -234,6 +238,7 @@ type aviation_telegrams_min_fields { priority_indicator: String received_at: timestamp secondary_addresses: String + text: String uuid: uuid } @@ -259,7 +264,7 @@ input aviation_telegrams_on_conflict { """Ordering options when selecting data from "aviation.telegrams".""" input aviation_telegrams_order_by { - Text: order_by + body_and_footer: order_by body_data: order_by category: order_by date_time: order_by @@ -273,6 +278,7 @@ input aviation_telegrams_order_by { priority_indicator: order_by received_at: order_by secondary_addresses: order_by + text: order_by uuid: order_by } @@ -291,7 +297,7 @@ select columns of table "aviation.telegrams" """ enum aviation_telegrams_select_column { """column name""" - Text + body_and_footer """column name""" body_data @@ -332,6 +338,9 @@ enum aviation_telegrams_select_column { """column name""" secondary_addresses + """column name""" + text + """column name""" uuid } @@ -340,7 +349,7 @@ enum aviation_telegrams_select_column { input type for updating data in table "aviation.telegrams" """ input aviation_telegrams_set_input { - Text: String + body_and_footer: String body_data: jsonb category: String date_time: String @@ -354,6 +363,7 @@ input aviation_telegrams_set_input { priority_indicator: String received_at: timestamp secondary_addresses: String + text: String uuid: uuid } @@ -370,7 +380,7 @@ input aviation_telegrams_stream_cursor_input { """Initial value of the column from where the streaming should start""" input aviation_telegrams_stream_cursor_value_input { - Text: String + body_and_footer: String body_data: jsonb category: String date_time: String @@ -384,6 +394,7 @@ input aviation_telegrams_stream_cursor_value_input { priority_indicator: String received_at: timestamp secondary_addresses: String + text: String uuid: uuid } @@ -392,7 +403,7 @@ update columns of table "aviation.telegrams" """ enum aviation_telegrams_update_column { """column name""" - Text + body_and_footer """column name""" body_data @@ -433,6 +444,9 @@ enum aviation_telegrams_update_column { """column name""" secondary_addresses + """column name""" + text + """column name""" uuid } @@ -512,391 +526,6 @@ input jsonb_comparison_exp { _nin: [jsonb!] } -""" -columns and relationships of "messages" -""" -type messages { - body_and_footer: String - body_data( - """JSON select path""" - path: String - ): jsonb - category: String - date_time: String - dispatched_at: timestamptz - id: uuid! - message_id: String! - need_dispatch: Boolean - originator: String - originator_date_time: String - parsed_at: timestamptz - primary_address: String - priority_indicator: String - received_at: timestamptz - secondary_addresses: String -} - -""" -aggregated selection of "messages" -""" -type messages_aggregate { - aggregate: messages_aggregate_fields - nodes: [messages!]! -} - -""" -aggregate fields of "messages" -""" -type messages_aggregate_fields { - count(columns: [messages_select_column!], distinct: Boolean): Int! - max: messages_max_fields - min: messages_min_fields -} - -"""append existing jsonb value of filtered columns with new jsonb value""" -input messages_append_input { - body_data: jsonb -} - -""" -Boolean expression to filter rows from the table "messages". All fields are combined with a logical 'AND'. -""" -input messages_bool_exp { - _and: [messages_bool_exp!] - _not: messages_bool_exp - _or: [messages_bool_exp!] - body_and_footer: String_comparison_exp - body_data: jsonb_comparison_exp - category: String_comparison_exp - date_time: String_comparison_exp - dispatched_at: timestamptz_comparison_exp - id: uuid_comparison_exp - message_id: String_comparison_exp - need_dispatch: Boolean_comparison_exp - originator: String_comparison_exp - originator_date_time: String_comparison_exp - parsed_at: timestamptz_comparison_exp - primary_address: String_comparison_exp - priority_indicator: String_comparison_exp - received_at: timestamptz_comparison_exp - secondary_addresses: String_comparison_exp -} - -""" -unique or primary key constraints on table "messages" -""" -enum messages_constraint { - """ - unique or primary key constraint on columns "id" - """ - parsed_messages_pkey -} - -""" -delete the field or element with specified path (for JSON arrays, negative integers count from the end) -""" -input messages_delete_at_path_input { - body_data: [String!] -} - -""" -delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array -""" -input messages_delete_elem_input { - body_data: Int -} - -""" -delete key/value pair or string element. key/value pairs are matched based on their key value -""" -input messages_delete_key_input { - body_data: String -} - -""" -input type for inserting data into table "messages" -""" -input messages_insert_input { - body_and_footer: String - body_data: jsonb - category: String - date_time: String - dispatched_at: timestamptz - id: uuid - message_id: String - need_dispatch: Boolean - originator: String - originator_date_time: String - parsed_at: timestamptz - primary_address: String - priority_indicator: String - received_at: timestamptz - secondary_addresses: String -} - -"""aggregate max on columns""" -type messages_max_fields { - body_and_footer: String - category: String - date_time: String - dispatched_at: timestamptz - id: uuid - message_id: String - originator: String - originator_date_time: String - parsed_at: timestamptz - primary_address: String - priority_indicator: String - received_at: timestamptz - secondary_addresses: String -} - -"""aggregate min on columns""" -type messages_min_fields { - body_and_footer: String - category: String - date_time: String - dispatched_at: timestamptz - id: uuid - message_id: String - originator: String - originator_date_time: String - parsed_at: timestamptz - primary_address: String - priority_indicator: String - received_at: timestamptz - secondary_addresses: String -} - -""" -response of any mutation on the table "messages" -""" -type messages_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [messages!]! -} - -""" -on_conflict condition type for table "messages" -""" -input messages_on_conflict { - constraint: messages_constraint! - update_columns: [messages_update_column!]! = [] - where: messages_bool_exp -} - -"""Ordering options when selecting data from "messages".""" -input messages_order_by { - body_and_footer: order_by - body_data: order_by - category: order_by - date_time: order_by - dispatched_at: order_by - id: order_by - message_id: order_by - need_dispatch: order_by - originator: order_by - originator_date_time: order_by - parsed_at: order_by - primary_address: order_by - priority_indicator: order_by - received_at: order_by - secondary_addresses: order_by -} - -"""primary key columns input for table: messages""" -input messages_pk_columns_input { - id: uuid! -} - -"""prepend existing jsonb value of filtered columns with new jsonb value""" -input messages_prepend_input { - body_data: jsonb -} - -""" -select columns of table "messages" -""" -enum messages_select_column { - """column name""" - body_and_footer - - """column name""" - body_data - - """column name""" - category - - """column name""" - date_time - - """column name""" - dispatched_at - - """column name""" - id - - """column name""" - message_id - - """column name""" - need_dispatch - - """column name""" - originator - - """column name""" - originator_date_time - - """column name""" - parsed_at - - """column name""" - primary_address - - """column name""" - priority_indicator - - """column name""" - received_at - - """column name""" - secondary_addresses -} - -""" -input type for updating data in table "messages" -""" -input messages_set_input { - body_and_footer: String - body_data: jsonb - category: String - date_time: String - dispatched_at: timestamptz - id: uuid - message_id: String - need_dispatch: Boolean - originator: String - originator_date_time: String - parsed_at: timestamptz - primary_address: String - priority_indicator: String - received_at: timestamptz - secondary_addresses: String -} - -""" -Streaming cursor of the table "messages" -""" -input messages_stream_cursor_input { - """Stream column input with initial value""" - initial_value: messages_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input messages_stream_cursor_value_input { - body_and_footer: String - body_data: jsonb - category: String - date_time: String - dispatched_at: timestamptz - id: uuid - message_id: String - need_dispatch: Boolean - originator: String - originator_date_time: String - parsed_at: timestamptz - primary_address: String - priority_indicator: String - received_at: timestamptz - secondary_addresses: String -} - -""" -update columns of table "messages" -""" -enum messages_update_column { - """column name""" - body_and_footer - - """column name""" - body_data - - """column name""" - category - - """column name""" - date_time - - """column name""" - dispatched_at - - """column name""" - id - - """column name""" - message_id - - """column name""" - need_dispatch - - """column name""" - originator - - """column name""" - originator_date_time - - """column name""" - parsed_at - - """column name""" - primary_address - - """column name""" - priority_indicator - - """column name""" - received_at - - """column name""" - secondary_addresses -} - -input messages_updates { - """append existing jsonb value of filtered columns with new jsonb value""" - _append: messages_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: messages_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: messages_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: messages_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: messages_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: messages_set_input - - """filter the rows which have to be updated""" - where: messages_bool_exp! -} - """mutation root""" type mutation_root { """ @@ -912,19 +541,6 @@ type mutation_root { """ delete_aviation_telegrams_by_pk(uuid: uuid!): aviation_telegrams - """ - delete data from the table: "messages" - """ - delete_messages( - """filter the rows which have to be deleted""" - where: messages_bool_exp! - ): messages_mutation_response - - """ - delete single row from the table: "messages" - """ - delete_messages_by_pk(id: uuid!): messages - """ insert data into the table: "aviation.telegrams" """ @@ -947,28 +563,6 @@ type mutation_root { on_conflict: aviation_telegrams_on_conflict ): aviation_telegrams - """ - insert data into the table: "messages" - """ - insert_messages( - """the rows to be inserted""" - objects: [messages_insert_input!]! - - """upsert condition""" - on_conflict: messages_on_conflict - ): messages_mutation_response - - """ - insert a single row into the table: "messages" - """ - insert_messages_one( - """the row to be inserted""" - object: messages_insert_input! - - """upsert condition""" - on_conflict: messages_on_conflict - ): messages - """ update data of the table: "aviation.telegrams" """ @@ -1038,76 +632,6 @@ type mutation_root { """updates to execute, in order""" updates: [aviation_telegrams_updates!]! ): [aviation_telegrams_mutation_response] - - """ - update data of the table: "messages" - """ - update_messages( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: messages_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: messages_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: messages_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: messages_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: messages_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: messages_set_input - - """filter the rows which have to be updated""" - where: messages_bool_exp! - ): messages_mutation_response - - """ - update single row of the table: "messages" - """ - update_messages_by_pk( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: messages_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: messages_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: messages_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: messages_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: messages_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: messages_set_input - pk_columns: messages_pk_columns_input! - ): messages - - """ - update multiples rows of table: "messages" - """ - update_messages_many( - """updates to execute, in order""" - updates: [messages_updates!]! - ): [messages_mutation_response] } """column ordering options""" @@ -1176,49 +700,6 @@ type query_root { fetch data from the table: "aviation.telegrams" using primary key columns """ aviation_telegrams_by_pk(uuid: uuid!): aviation_telegrams - - """ - fetch data from the table: "messages" - """ - messages( - """distinct select on columns""" - distinct_on: [messages_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [messages_order_by!] - - """filter the rows returned""" - where: messages_bool_exp - ): [messages!]! - - """ - fetch aggregated fields from the table: "messages" - """ - messages_aggregate( - """distinct select on columns""" - distinct_on: [messages_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [messages_order_by!] - - """filter the rows returned""" - where: messages_bool_exp - ): messages_aggregate! - - """fetch data from the table: "messages" using primary key columns""" - messages_by_pk(id: uuid!): messages } type subscription_root { @@ -1280,63 +761,6 @@ type subscription_root { """filter the rows returned""" where: aviation_telegrams_bool_exp ): [aviation_telegrams!]! - - """ - fetch data from the table: "messages" - """ - messages( - """distinct select on columns""" - distinct_on: [messages_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [messages_order_by!] - - """filter the rows returned""" - where: messages_bool_exp - ): [messages!]! - - """ - fetch aggregated fields from the table: "messages" - """ - messages_aggregate( - """distinct select on columns""" - distinct_on: [messages_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [messages_order_by!] - - """filter the rows returned""" - where: messages_bool_exp - ): messages_aggregate! - - """fetch data from the table: "messages" using primary key columns""" - messages_by_pk(id: uuid!): messages - - """ - fetch data from the table in a streaming manner: "messages" - """ - messages_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [messages_stream_cursor_input]! - - """filter the rows returned""" - where: messages_bool_exp - ): [messages!]! } scalar timestamp @@ -1356,23 +780,6 @@ input timestamp_comparison_exp { _nin: [timestamp!] } -scalar timestamptz - -""" -Boolean expression to compare columns of type "timestamptz". All fields are combined with logical 'AND'. -""" -input timestamptz_comparison_exp { - _eq: timestamptz - _gt: timestamptz - _gte: timestamptz - _in: [timestamptz!] - _is_null: Boolean - _lt: timestamptz - _lte: timestamptz - _neq: timestamptz - _nin: [timestamptz!] -} - scalar uuid """