Skip to content

Commit

Permalink
DPLT-1084 Add Hasura CLI config (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgsmccauley authored Aug 7, 2023
1 parent 759670e commit 6218297
Show file tree
Hide file tree
Showing 15 changed files with 109 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hasura/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 3
endpoint: http://localhost:8080
admin_secret: myadminsecretkey
metadata_directory: metadata
actions:
kind: synchronous
handler_webhook_baseurl: http://localhost:3000
Empty file added hasura/metadata/actions.graphql
Empty file.
6 changes: 6 additions & 0 deletions hasura/metadata/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions: []
custom_types:
enums: []
input_objects: []
objects: []
scalars: []
1 change: 1 addition & 0 deletions hasura/metadata/allow_list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions hasura/metadata/cron_triggers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
14 changes: 14 additions & 0 deletions hasura/metadata/databases/databases.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- name: default
kind: postgres
configuration:
connection_info:
database_url:
from_env: HASURA_GRAPHQL_DATABASE_URL
isolation_level: read-committed
pool_settings:
connection_lifetime: 600
idle_timeout: 180
max_connections: 50
retries: 1
use_prepared_statements: true
tables: "!include default/tables/tables.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
table:
name: indexer_log_entries
schema: public
insert_permissions:
- permission:
check: {}
columns:
- block_height
- function_name
- message
- timestamp
- id
role: append
select_permissions:
- permission:
columns:
- block_height
- function_name
- message
- timestamp
- id
filter: {}
role: append
31 changes: 31 additions & 0 deletions hasura/metadata/databases/default/tables/public_indexer_state.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
table:
name: indexer_state
schema: public
insert_permissions:
- permission:
check: {}
columns:
- function_name
- current_block_height
- current_historical_block_height
- status
role: append
select_permissions:
- permission:
columns:
- function_name
- current_block_height
- current_historical_block_height
- status
filter: {}
role: append
update_permissions:
- permission:
check: {}
columns:
- function_name
- current_block_height
- current_historical_block_height
- status
filter: {}
role: append
2 changes: 2 additions & 0 deletions hasura/metadata/databases/default/tables/tables.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- "!include public_indexer_log_entries.yaml"
- "!include public_indexer_state.yaml"
1 change: 1 addition & 0 deletions hasura/metadata/query_collections.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions hasura/metadata/remote_schemas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions hasura/metadata/rest_endpoints.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions hasura/metadata/version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version: 3
2 changes: 2 additions & 0 deletions hasura/migrations/default/1691364619300_init/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DROP TABLE public.indexer_log_entries;
DROP TABLE public.indexer_state;
18 changes: 18 additions & 0 deletions hasura/migrations/default/1691364619300_init/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
SET check_function_bodies = false;
CREATE TABLE public.indexer_log_entries (
id uuid DEFAULT gen_random_uuid() NOT NULL,
function_name text NOT NULL,
block_height numeric NOT NULL,
"timestamp" timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
message text
);
CREATE TABLE public.indexer_state (
function_name character varying NOT NULL,
current_block_height numeric(21,0) NOT NULL,
status text,
current_historical_block_height numeric(21,0)
);
ALTER TABLE ONLY public.indexer_log_entries
ADD CONSTRAINT indexer_log_entries_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.indexer_state
ADD CONSTRAINT indexer_state_pkey PRIMARY KEY (function_name);

0 comments on commit 6218297

Please sign in to comment.