Skip to content

Commit f54ffa4

Browse files
committed
test for issue #124
1 parent d5fd839 commit f54ffa4

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

__fixtures__/generated/generated.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21090,6 +21090,7 @@
2109021090
"misc/issues-4.sql": "CREATE TABLE new_style (\n id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,\n val1 TEXT NOT NULL,\n val2 TEXT NULL\n)",
2109121091
"misc/issues-5.sql": "ALTER TABLE new_style ADD CONSTRAINT uq_val1_val2_new UNIQUE NULLS NOT DISTINCT (val1, val2)",
2109221092
"misc/issues-6.sql": "INSERT INTO\n public.people (id, name, epithet, is_great, gender, type_id, date_of_birth, date_of_death, place_of_birth, place_of_death, biography, canonical_status_id, image_url, source_url)\nVALUES\n (1, 'Asterius', 'of Amasea', FALSE, 'M', 1, '0350-01-01', '0410-01-01', 'Cappadocia', 'Amasea', NULL, 1, NULL, NULL),\n (2, 'Ausonius', NULL, FALSE, 'M', 1, '0310-01-01', '0395-01-01', 'Burdigala', NULL, NULL, NULL, NULL, NULL)\nON CONFLICT DO NOTHING",
21093+
"misc/issues-7.sql": "COMMENT ON COLUMN \"foo\".\"whatever\" IS $$\nSomething blah, this data may have chars like '\\n' and '\\r' in it.\n$$",
2109321094
"misc/inflection-1.sql": "CREATE SCHEMA inflection",
2109421095
"misc/inflection-2.sql": "GRANT USAGE ON SCHEMA inflection TO PUBLIC",
2109521096
"misc/inflection-3.sql": "ALTER DEFAULT PRIVILEGES IN SCHEMA inflection \n GRANT EXECUTE ON FUNCTIONS TO PUBLIC",

__fixtures__/kitchen-sink/misc/issues.sql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,9 @@ INSERT INTO
2424
VALUES
2525
(1, 'Asterius', 'of Amasea', FALSE, 'M', 1, '0350-01-01', '0410-01-01', 'Cappadocia', 'Amasea', NULL, 1, NULL, NULL),
2626
(2, 'Ausonius', NULL, FALSE, 'M', 1, '0310-01-01', '0395-01-01', 'Burdigala', NULL, NULL, NULL, NULL, NULL)
27-
ON CONFLICT DO NOTHING;
27+
ON CONFLICT DO NOTHING;
28+
29+
-- https://github.com/launchql/pgsql-parser/issues/124
30+
COMMENT ON COLUMN "foo"."whatever" IS $$
31+
Something blah, this data may have chars like '\n' and '\r' in it.
32+
$$;

packages/deparser/__tests__/kitchen-sink/misc-issues.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ it('misc-issues', async () => {
99
"misc/issues-3.sql",
1010
"misc/issues-4.sql",
1111
"misc/issues-5.sql",
12-
"misc/issues-6.sql"
12+
"misc/issues-6.sql",
13+
"misc/issues-7.sql"
1314
]);
1415
});

0 commit comments

Comments
 (0)