Skip to content

Commit 448a382

Browse files
committed
add test cases for #204
1 parent c2982c6 commit 448a382

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

__fixtures__/generated/generated.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21237,6 +21237,19 @@
2123721237
"misc/pg_catalog-15.sql": "SELECT array_agg(id) FROM (VALUES (1), (2), (3)) AS t(id)",
2123821238
"misc/pg_catalog-16.sql": "SELECT string_agg(name, ', ') FROM (VALUES ('Alice'), ('Bob'), ('Carol')) AS t(name)",
2123921239
"misc/pg_catalog-17.sql": "SELECT json_agg(name) FROM (VALUES ('A'), ('B')) AS t(name)",
21240+
"misc/pg_catalog-timestamp-etc-1.sql": "CREATE TABLE public.\"ACTIVITY\" (\n \"ACTIVITY_ID\" bigint NOT NULL,\n \"PUBLISHED\" timestamp(2) with time zone\n)",
21241+
"misc/pg_catalog-timestamp-etc-2.sql": "CREATE TABLE public.\"ACTIVITY\" (\n \"ACTIVITY_ID\" bigint NOT NULL,\n \"PUBLISHED\" timestamp(2)\n)",
21242+
"misc/pg_catalog-timestamp-etc-3.sql": "CREATE TABLE public.\"EXAMPLE\" (\n \"MESSAGE\" text\n)",
21243+
"misc/pg_catalog-timestamp-etc-4.sql": "CREATE TABLE public.\"EXAMPLE_TIME\" (\n \"START_TIME\" time\n)",
21244+
"misc/pg_catalog-timestamp-etc-5.sql": "CREATE TABLE public.\"EXAMPLE_TIMETZ\" (\n \"START_TIME\" time with time zone\n)",
21245+
"misc/pg_catalog-timestamp-etc-6.sql": "CREATE TABLE public.\"EXAMPLE_TIME_PRECISION\" (\n \"START_TIME\" time(3)\n)",
21246+
"misc/pg_catalog-timestamp-etc-7.sql": "CREATE TABLE public.\"EXAMPLE_TIMETZ_PRECISION\" (\n \"START_TIME\" time(3) with time zone\n)",
21247+
"misc/pg_catalog-timestamp-etc-8.sql": "CREATE TABLE public.\"EXAMPLE_TIMESTAMP\" (\n \"CREATED_AT\" timestamp\n)",
21248+
"misc/pg_catalog-timestamp-etc-9.sql": "CREATE TABLE public.\"EXAMPLE_TIMESTAMPTZ\" (\n \"CREATED_AT\" timestamp with time zone\n)",
21249+
"misc/pg_catalog-timestamp-etc-10.sql": "CREATE TABLE public.\"EXAMPLE_INTERVAL\" (\n \"DURATION\" interval\n)",
21250+
"misc/pg_catalog-timestamp-etc-11.sql": "CREATE TABLE public.\"EXAMPLE_INTERVAL_PRECISION\" (\n \"DURATION\" interval(2)\n)",
21251+
"misc/pg_catalog-timestamp-etc-12.sql": "CREATE TABLE public.\"EXAMPLE_DATE\" (\n \"BIRTHDAY\" date\n)",
21252+
"misc/pg_catalog-timestamp-etc-13.sql": "CREATE TABLE public.\"EXAMPLE_BOOL\" (\n \"IS_ACTIVE\" boolean\n)",
2124021253
"misc/launchql-ext-types-1.sql": "CREATE DOMAIN attachment AS jsonb CHECK ( value ?& ARRAY['url', 'mime'] AND (value->>'url') ~ '^(https?)://[^\\s/$.?#].[^\\s]*$' )",
2124121254
"misc/launchql-ext-types-2.sql": "COMMENT ON DOMAIN attachment IS E'@name launchqlInternalTypeAttachment'",
2124221255
"misc/launchql-ext-types-3.sql": "CREATE DOMAIN email AS citext CHECK ( value ~ '^[a-zA-Z0-9.!#$%&''*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$' )",
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
-- timestamp(2) with time zone
2+
CREATE TABLE public."ACTIVITY" (
3+
"ACTIVITY_ID" bigint NOT NULL,
4+
"PUBLISHED" timestamp(2) with time zone
5+
);
6+
7+
-- timestamp(2)
8+
CREATE TABLE public."ACTIVITY" (
9+
"ACTIVITY_ID" bigint NOT NULL,
10+
"PUBLISHED" timestamp(2)
11+
);
12+
13+
-- text
14+
CREATE TABLE public."EXAMPLE" (
15+
"MESSAGE" text
16+
);
17+
18+
-- TIME WITHOUT TIME ZONE
19+
CREATE TABLE public."EXAMPLE_TIME" (
20+
"START_TIME" time
21+
);
22+
23+
-- TIME WITH TIME ZONE (aka timetz)
24+
CREATE TABLE public."EXAMPLE_TIMETZ" (
25+
"START_TIME" time with time zone
26+
);
27+
28+
-- TIME(n) WITHOUT TIME ZONE
29+
CREATE TABLE public."EXAMPLE_TIME_PRECISION" (
30+
"START_TIME" time(3)
31+
);
32+
33+
-- TIME(n) WITH TIME ZONE (aka timetz(n))
34+
CREATE TABLE public."EXAMPLE_TIMETZ_PRECISION" (
35+
"START_TIME" time(3) with time zone
36+
);
37+
38+
-- TIMESTAMP WITHOUT TIME ZONE (alias of timestamp)
39+
CREATE TABLE public."EXAMPLE_TIMESTAMP" (
40+
"CREATED_AT" timestamp
41+
);
42+
43+
-- TIMESTAMP WITH TIME ZONE (alias of timestamptz)
44+
CREATE TABLE public."EXAMPLE_TIMESTAMPTZ" (
45+
"CREATED_AT" timestamp with time zone
46+
);
47+
48+
-- INTERVAL
49+
CREATE TABLE public."EXAMPLE_INTERVAL" (
50+
"DURATION" interval
51+
);
52+
53+
-- INTERVAL with precision
54+
CREATE TABLE public."EXAMPLE_INTERVAL_PRECISION" (
55+
"DURATION" interval(2)
56+
);
57+
58+
-- DATE
59+
CREATE TABLE public."EXAMPLE_DATE" (
60+
"BIRTHDAY" date
61+
);
62+
63+
-- BOOLEAN
64+
CREATE TABLE public."EXAMPLE_BOOL" (
65+
"IS_ACTIVE" boolean
66+
);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
import { FixtureTestUtils } from '../../test-utils';
3+
const fixtures = new FixtureTestUtils();
4+
5+
it('misc-pg_catalog-timestamp-etc', async () => {
6+
await fixtures.runFixtureTests([
7+
"misc/pg_catalog-timestamp-etc-1.sql",
8+
"misc/pg_catalog-timestamp-etc-2.sql",
9+
"misc/pg_catalog-timestamp-etc-3.sql",
10+
"misc/pg_catalog-timestamp-etc-4.sql",
11+
"misc/pg_catalog-timestamp-etc-5.sql",
12+
"misc/pg_catalog-timestamp-etc-6.sql",
13+
"misc/pg_catalog-timestamp-etc-7.sql",
14+
"misc/pg_catalog-timestamp-etc-8.sql",
15+
"misc/pg_catalog-timestamp-etc-9.sql",
16+
"misc/pg_catalog-timestamp-etc-10.sql",
17+
"misc/pg_catalog-timestamp-etc-11.sql",
18+
"misc/pg_catalog-timestamp-etc-12.sql",
19+
"misc/pg_catalog-timestamp-etc-13.sql"
20+
]);
21+
});

0 commit comments

Comments
 (0)