graphql-engine/server/tests-py/queries/v1/track_table/setup.yaml
Karthikeyan Chinnakonda 7b83018c39 Server: fix issue of not being able to track tables with non-compliant GraphQL names (#313)
* server: use only the valid tables in the node parser

* add test

GitOrigin-RevId: 90edf001220c7d78eaab86ff565ee4311844b5d3
2021-01-12 08:13:58 +00:00

65 lines
1.4 KiB
YAML

type: bulk
args:
- type: run_sql
args:
sql: |
CREATE TABLE author (
id SERIAL PRIMARY KEY,
name TEXT UNIQUE,
remarks TEXT
);
CREATE TABLE article (
id SERIAL PRIMARY KEY,
title TEXT,
author_id INTEGER REFERENCES author(id)
);
CREATE TABLE test1 (
id SERIAL PRIMARY KEY
);
CREATE TABLE test2 (
id SERIAL PRIMARY KEY
);
CREATE TABLE hge_tests.resident (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
age INTEGER NOT NULL
);
INSERT INTO author (name) VALUES
('Author 1'),
('Author 2');
INSERT INTO article (title, author_id) VALUES
('Lorem ipsum dolor sit amet', 1),
('lolcats: an anthology', 2),
('consectetur adipiscing elit', 1);
INSERT INTO hge_tests.resident (name, age) VALUES
('Resident 1', 23),
('Resident 2', 31);
CREATE MATERIALIZED VIEW articles AS
SELECT article.title, author.name
FROM article
LEFT JOIN author ON author.id = article.author_id
;
CREATE OR REPLACE FUNCTION test1()
RETURNS SETOF test2 AS $$
SELECT * FROM test2
$$ LANGUAGE sql STABLE;
CREATE TABLE "users address" (
id serial primary key,
user_id int,
address text
);