pg-dump-parser 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,736 @@
1
+ import { parsePgDump } from './parsePgDump';
2
+ import multiline from 'multiline-ts';
3
+ import { expect, test } from 'vitest';
4
+
5
+ const dump = multiline`
6
+ --
7
+ -- PostgreSQL database dump
8
+ --
9
+
10
+ -- Dumped from database version 16.2 (Debian 16.2-1.pgdg120+2)
11
+ -- Dumped by pg_dump version 16.2 (Debian 16.2-1.pgdg120+2)
12
+
13
+ SET statement_timeout = 0;
14
+ SET lock_timeout = 0;
15
+ SET idle_in_transaction_session_timeout = 0;
16
+ SET client_encoding = 'UTF8';
17
+ SET standard_conforming_strings = on;
18
+ SELECT pg_catalog.set_config('search_path', '', false);
19
+ SET check_function_bodies = false;
20
+ SET xmloption = content;
21
+ SET client_min_messages = warning;
22
+ SET row_security = off;
23
+
24
+ --
25
+ -- Name: quux; Type: SCHEMA; Schema: -; Owner: postgres
26
+ --
27
+
28
+ CREATE SCHEMA quux;
29
+
30
+
31
+ ALTER SCHEMA quux OWNER TO postgres;
32
+
33
+ --
34
+ -- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
35
+ --
36
+
37
+ CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
38
+
39
+
40
+ --
41
+ -- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner:
42
+ --
43
+
44
+ COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';
45
+
46
+
47
+ --
48
+ -- Name: status; Type: TYPE; Schema: public; Owner: postgres
49
+ --
50
+
51
+ CREATE TYPE public.status AS ENUM (
52
+ 'ACTIVE',
53
+ 'INACTIVE'
54
+ );
55
+
56
+
57
+ ALTER TYPE public.status OWNER TO postgres;
58
+
59
+ --
60
+ -- Name: CAST (text AS integer); Type: CAST; Schema: -; Owner: -
61
+ --
62
+
63
+ CREATE CAST (text AS integer) WITH INOUT AS IMPLICIT;
64
+
65
+
66
+ --
67
+ -- Name: add_two_numbers(integer, integer); Type: FUNCTION; Schema: public; Owner: postgres
68
+ --
69
+
70
+ CREATE FUNCTION public.add_two_numbers(a integer, b integer) RETURNS integer
71
+ LANGUAGE plpgsql
72
+ AS $$
73
+ BEGIN
74
+ RETURN a + b;
75
+ END;
76
+ $$;
77
+
78
+
79
+ ALTER FUNCTION public.add_two_numbers(a integer, b integer) OWNER TO postgres;
80
+
81
+ --
82
+ -- Name: notify_foo_insert(); Type: FUNCTION; Schema: public; Owner: postgres
83
+ --
84
+
85
+ CREATE FUNCTION public.notify_foo_insert() RETURNS trigger
86
+ LANGUAGE plpgsql
87
+ AS $$
88
+ BEGIN
89
+ RAISE NOTICE 'A new row was inserted into the foo table with id: %', NEW.id;
90
+ RETURN NEW;
91
+ END;
92
+ $$;
93
+
94
+
95
+ ALTER FUNCTION public.notify_foo_insert() OWNER TO postgres;
96
+
97
+ --
98
+ -- Name: say_hello(character varying); Type: PROCEDURE; Schema: public; Owner: postgres
99
+ --
100
+
101
+ CREATE PROCEDURE public.say_hello(IN name_param character varying)
102
+ LANGUAGE plpgsql
103
+ AS $$
104
+ BEGIN
105
+ RAISE NOTICE 'Hello, %!', name_param;
106
+ END;
107
+ $$;
108
+
109
+
110
+ ALTER PROCEDURE public.say_hello(IN name_param character varying) OWNER TO postgres;
111
+
112
+ --
113
+ -- Name: my_sum(integer); Type: AGGREGATE; Schema: public; Owner: postgres
114
+ --
115
+
116
+ CREATE AGGREGATE public.my_sum(integer) (
117
+ SFUNC = public.add_two_numbers,
118
+ STYPE = integer
119
+ );
120
+
121
+
122
+ ALTER AGGREGATE public.my_sum(integer) OWNER TO postgres;
123
+
124
+ SET default_tablespace = '';
125
+
126
+ SET default_table_access_method = heap;
127
+
128
+ --
129
+ -- Name: bar; Type: TABLE; Schema: public; Owner: postgres
130
+ --
131
+
132
+ CREATE TABLE public.bar (
133
+ id integer NOT NULL,
134
+ uid text NOT NULL,
135
+ foo_id integer
136
+ );
137
+
138
+
139
+ ALTER TABLE public.bar OWNER TO postgres;
140
+
141
+ --
142
+ -- Name: bar_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
143
+ --
144
+
145
+ ALTER TABLE public.bar ALTER COLUMN id ADD GENERATED ALWAYS AS IDENTITY (
146
+ SEQUENCE NAME public.bar_id_seq
147
+ START WITH 1
148
+ INCREMENT BY 1
149
+ NO MINVALUE
150
+ NO MAXVALUE
151
+ CACHE 1
152
+ );
153
+
154
+
155
+ --
156
+ -- Name: baz; Type: VIEW; Schema: public; Owner: postgres
157
+ --
158
+
159
+ CREATE VIEW public.baz AS
160
+ SELECT id,
161
+ uid AS name
162
+ FROM public.bar;
163
+
164
+
165
+ ALTER VIEW public.baz OWNER TO postgres;
166
+
167
+ --
168
+ -- Name: corge; Type: TABLE; Schema: public; Owner: postgres
169
+ --
170
+
171
+ CREATE TABLE public.corge (
172
+ id integer,
173
+ name text
174
+ );
175
+
176
+
177
+ ALTER TABLE public.corge OWNER TO postgres;
178
+
179
+ --
180
+ -- Name: corge_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
181
+ --
182
+
183
+ CREATE SEQUENCE public.corge_id_seq
184
+ START WITH 1000
185
+ INCREMENT BY 1
186
+ NO MINVALUE
187
+ NO MAXVALUE
188
+ CACHE 1;
189
+
190
+
191
+ ALTER SEQUENCE public.corge_id_seq OWNER TO postgres;
192
+
193
+ --
194
+ -- Name: corge_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
195
+ --
196
+
197
+ ALTER SEQUENCE public.corge_id_seq OWNED BY public.corge.id;
198
+
199
+
200
+ --
201
+ -- Name: foo; Type: TABLE; Schema: public; Owner: postgres
202
+ --
203
+
204
+ CREATE TABLE public.foo (
205
+ id integer NOT NULL,
206
+ name text NOT NULL
207
+ );
208
+
209
+
210
+ ALTER TABLE public.foo OWNER TO postgres;
211
+
212
+ --
213
+ -- Name: TABLE foo; Type: COMMENT; Schema: public; Owner: postgres
214
+ --
215
+
216
+ COMMENT ON TABLE public.foo IS 'Table comment x';
217
+
218
+
219
+ --
220
+ -- Name: COLUMN foo.id; Type: COMMENT; Schema: public; Owner: postgres
221
+ --
222
+
223
+ COMMENT ON COLUMN public.foo.id IS 'Column comment x';
224
+
225
+
226
+ --
227
+ -- Name: foo_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
228
+ --
229
+
230
+ ALTER TABLE public.foo ALTER COLUMN id ADD GENERATED ALWAYS AS IDENTITY (
231
+ SEQUENCE NAME public.foo_id_seq
232
+ START WITH 1
233
+ INCREMENT BY 1
234
+ NO MINVALUE
235
+ NO MAXVALUE
236
+ CACHE 1
237
+ );
238
+
239
+
240
+ --
241
+ -- Name: SEQUENCE foo_id_seq; Type: COMMENT; Schema: public; Owner: postgres
242
+ --
243
+
244
+ COMMENT ON SEQUENCE public.foo_id_seq IS 'Sequence comment x';
245
+
246
+
247
+ --
248
+ -- Name: qux; Type: MATERIALIZED VIEW; Schema: public; Owner: postgres
249
+ --
250
+
251
+ CREATE MATERIALIZED VIEW public.qux AS
252
+ SELECT id,
253
+ uid AS name
254
+ FROM public.bar
255
+ WITH NO DATA;
256
+
257
+
258
+ ALTER MATERIALIZED VIEW public.qux OWNER TO postgres;
259
+
260
+ --
261
+ -- Name: corge id; Type: DEFAULT; Schema: public; Owner: postgres
262
+ --
263
+
264
+ ALTER TABLE ONLY public.corge ALTER COLUMN id SET DEFAULT nextval('public.corge_id_seq'::regclass);
265
+
266
+
267
+ --
268
+ -- Name: bar bar_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
269
+ --
270
+
271
+ ALTER TABLE ONLY public.bar
272
+ ADD CONSTRAINT bar_pkey PRIMARY KEY (id);
273
+
274
+
275
+ --
276
+ -- Name: foo foo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
277
+ --
278
+
279
+ ALTER TABLE ONLY public.foo
280
+ ADD CONSTRAINT foo_pkey PRIMARY KEY (id);
281
+
282
+
283
+ --
284
+ -- Name: bar_uid_idx; Type: INDEX; Schema: public; Owner: postgres
285
+ --
286
+
287
+ CREATE UNIQUE INDEX bar_uid_idx ON public.bar USING btree (uid);
288
+
289
+
290
+ --
291
+ -- Name: INDEX foo_pkey; Type: COMMENT; Schema: public; Owner: postgres
292
+ --
293
+
294
+ COMMENT ON INDEX public.foo_pkey IS 'Index comment x';
295
+
296
+
297
+ --
298
+ -- Name: foo foo_insert_trigger; Type: TRIGGER; Schema: public; Owner: postgres
299
+ --
300
+
301
+ CREATE TRIGGER foo_insert_trigger AFTER INSERT ON public.foo FOR EACH ROW EXECUTE FUNCTION public.notify_foo_insert();
302
+
303
+
304
+ --
305
+ -- Name: bar bar_foo_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
306
+ --
307
+
308
+ ALTER TABLE ONLY public.bar
309
+ ADD CONSTRAINT bar_foo_id_fkey FOREIGN KEY (foo_id) REFERENCES public.foo(id) ON DELETE CASCADE;
310
+
311
+
312
+ --
313
+ -- Name: foo_publication; Type: PUBLICATION; Schema: -; Owner: postgres
314
+ --
315
+
316
+ CREATE PUBLICATION foo_publication FOR ALL TABLES WITH (publish = 'insert, update, delete');
317
+
318
+
319
+ ALTER PUBLICATION foo_publication OWNER TO postgres;
320
+
321
+ --
322
+ -- Name: COLUMN foo.name; Type: ACL; Schema: public; Owner: postgres
323
+ --
324
+
325
+ GRANT SELECT(name) ON TABLE public.foo TO postgres;
326
+
327
+
328
+ --
329
+ -- PostgreSQL database dump complete
330
+ --
331
+ `;
332
+
333
+ test('extracts SEQUENCE', async () => {
334
+ const schemaObjects = parsePgDump(dump);
335
+
336
+ expect(schemaObjects).toContainEqual({
337
+ header: {
338
+ Name: 'bar_id_seq',
339
+ Owner: 'postgres',
340
+ Schema: 'public',
341
+ Type: 'SEQUENCE',
342
+ },
343
+ sql: multiline`
344
+ ALTER TABLE public.bar ALTER COLUMN id ADD GENERATED ALWAYS AS IDENTITY (
345
+ SEQUENCE NAME public.bar_id_seq
346
+ START WITH 1
347
+ INCREMENT BY 1
348
+ NO MINVALUE
349
+ NO MAXVALUE
350
+ CACHE 1
351
+ );
352
+ `,
353
+ });
354
+ });
355
+
356
+ test('extracts TABLE', async () => {
357
+ const schemaObjects = parsePgDump(dump);
358
+
359
+ expect(schemaObjects).toContainEqual({
360
+ header: {
361
+ Name: 'foo',
362
+ Owner: 'postgres',
363
+ Schema: 'public',
364
+ Type: 'TABLE',
365
+ },
366
+ sql: multiline`
367
+ CREATE TABLE public.foo (
368
+ id integer NOT NULL,
369
+ name text NOT NULL
370
+ );
371
+ `,
372
+ });
373
+ });
374
+
375
+ test('extracts CONSTRAINT', async () => {
376
+ const schemaObjects = parsePgDump(dump);
377
+
378
+ expect(schemaObjects).toContainEqual({
379
+ header: {
380
+ Name: 'foo foo_pkey',
381
+ Owner: 'postgres',
382
+ Schema: 'public',
383
+ Type: 'CONSTRAINT',
384
+ },
385
+ sql: multiline`
386
+ ALTER TABLE ONLY public.foo
387
+ ADD CONSTRAINT foo_pkey PRIMARY KEY (id);
388
+ `,
389
+ });
390
+ });
391
+
392
+ test('extracts COMMENT on TABLE', async () => {
393
+ const schemaObjects = parsePgDump(dump);
394
+
395
+ expect(schemaObjects).toContainEqual({
396
+ header: {
397
+ Name: 'TABLE foo',
398
+ Owner: 'postgres',
399
+ Schema: 'public',
400
+ Type: 'COMMENT',
401
+ },
402
+ sql: multiline`
403
+ COMMENT ON TABLE public.foo IS 'Table comment x';
404
+ `,
405
+ });
406
+ });
407
+
408
+ test('extracts COMMENT on COLUMN', async () => {
409
+ const schemaObjects = parsePgDump(dump);
410
+
411
+ expect(schemaObjects).toContainEqual({
412
+ header: {
413
+ Name: 'COLUMN foo.id',
414
+ Owner: 'postgres',
415
+ Schema: 'public',
416
+ Type: 'COMMENT',
417
+ },
418
+ sql: multiline`
419
+ COMMENT ON COLUMN public.foo.id IS 'Column comment x';
420
+ `,
421
+ });
422
+ });
423
+
424
+ test('extracts COMMENT on INDEX', async () => {
425
+ const schemaObjects = parsePgDump(dump);
426
+
427
+ expect(schemaObjects).toContainEqual({
428
+ header: {
429
+ Name: 'INDEX foo_pkey',
430
+ Owner: 'postgres',
431
+ Schema: 'public',
432
+ Type: 'COMMENT',
433
+ },
434
+ sql: multiline`
435
+ COMMENT ON INDEX public.foo_pkey IS 'Index comment x';
436
+ `,
437
+ });
438
+ });
439
+
440
+ test('extracts COMMENT on SEQUENCE', async () => {
441
+ const schemaObjects = parsePgDump(dump);
442
+
443
+ expect(schemaObjects).toContainEqual({
444
+ header: {
445
+ Name: 'SEQUENCE foo_id_seq',
446
+ Owner: 'postgres',
447
+ Schema: 'public',
448
+ Type: 'COMMENT',
449
+ },
450
+ sql: multiline`
451
+ COMMENT ON SEQUENCE public.foo_id_seq IS 'Sequence comment x';
452
+ `,
453
+ });
454
+ });
455
+
456
+ test('extracts PUBLICATION', async () => {
457
+ const schemaObjects = parsePgDump(dump);
458
+
459
+ expect(schemaObjects).toContainEqual({
460
+ header: {
461
+ Name: 'foo_publication',
462
+ Owner: 'postgres',
463
+ Schema: null,
464
+ Type: 'PUBLICATION',
465
+ },
466
+ sql: multiline`
467
+ CREATE PUBLICATION foo_publication FOR ALL TABLES WITH (publish = 'insert, update, delete');
468
+ `,
469
+ });
470
+ });
471
+
472
+ test('extracts SCHEMA', async () => {
473
+ const schemaObjects = parsePgDump(dump);
474
+
475
+ expect(schemaObjects).toContainEqual({
476
+ header: {
477
+ Name: 'quux',
478
+ Owner: 'postgres',
479
+ Schema: null,
480
+ Type: 'SCHEMA',
481
+ },
482
+ sql: multiline`
483
+ CREATE SCHEMA quux;
484
+ `,
485
+ });
486
+ });
487
+
488
+ test('extracts VIEW', async () => {
489
+ const schemaObjects = parsePgDump(dump);
490
+
491
+ expect(schemaObjects).toContainEqual({
492
+ header: {
493
+ Name: 'baz',
494
+ Owner: 'postgres',
495
+ Schema: 'public',
496
+ Type: 'VIEW',
497
+ },
498
+ sql: multiline`
499
+ CREATE VIEW public.baz AS
500
+ SELECT id,
501
+ uid AS name
502
+ FROM public.bar;
503
+ `,
504
+ });
505
+ });
506
+
507
+ test('extracts MATERIALIZED VIEW', async () => {
508
+ const schemaObjects = parsePgDump(dump);
509
+
510
+ expect(schemaObjects).toContainEqual({
511
+ header: {
512
+ Name: 'qux',
513
+ Owner: 'postgres',
514
+ Schema: 'public',
515
+ Type: 'MATERIALIZED VIEW',
516
+ },
517
+ sql: multiline`
518
+ CREATE MATERIALIZED VIEW public.qux AS
519
+ SELECT id,
520
+ uid AS name
521
+ FROM public.bar
522
+ WITH NO DATA;
523
+ `,
524
+ });
525
+ });
526
+
527
+ test('extracts FUNCTION', async () => {
528
+ const schemaObjects = parsePgDump(dump);
529
+
530
+ expect(schemaObjects).toContainEqual({
531
+ header: {
532
+ Name: 'add_two_numbers(integer, integer)',
533
+ Owner: 'postgres',
534
+ Schema: 'public',
535
+ Type: 'FUNCTION',
536
+ },
537
+ sql: multiline`
538
+ CREATE FUNCTION public.add_two_numbers(a integer, b integer) RETURNS integer
539
+ LANGUAGE plpgsql
540
+ AS $$
541
+ BEGIN
542
+ RETURN a + b;
543
+ END;
544
+ $$;
545
+ `,
546
+ });
547
+ });
548
+
549
+ test('extracts PROCEDURE', async () => {
550
+ const schemaObjects = parsePgDump(dump);
551
+
552
+ expect(schemaObjects).toContainEqual({
553
+ header: {
554
+ Name: 'say_hello(character varying)',
555
+ Owner: 'postgres',
556
+ Schema: 'public',
557
+ Type: 'PROCEDURE',
558
+ },
559
+ sql: multiline`
560
+ CREATE PROCEDURE public.say_hello(IN name_param character varying)
561
+ LANGUAGE plpgsql
562
+ AS $$
563
+ BEGIN
564
+ RAISE NOTICE 'Hello, %!', name_param;
565
+ END;
566
+ $$;
567
+ `,
568
+ });
569
+ });
570
+
571
+ test('extracts TRIGGER', async () => {
572
+ const schemaObjects = parsePgDump(dump);
573
+
574
+ expect(schemaObjects).toContainEqual({
575
+ header: {
576
+ Name: 'foo foo_insert_trigger',
577
+ Owner: 'postgres',
578
+ Schema: 'public',
579
+ Type: 'TRIGGER',
580
+ },
581
+ sql: multiline`
582
+ CREATE TRIGGER foo_insert_trigger AFTER INSERT ON public.foo FOR EACH ROW EXECUTE FUNCTION public.notify_foo_insert();
583
+ `,
584
+ });
585
+ });
586
+
587
+ test('extracts TYPE', async () => {
588
+ const schemaObjects = parsePgDump(dump);
589
+
590
+ expect(schemaObjects).toContainEqual({
591
+ header: {
592
+ Name: 'status',
593
+ Owner: 'postgres',
594
+ Schema: 'public',
595
+ Type: 'TYPE',
596
+ },
597
+ sql: multiline`
598
+ CREATE TYPE public.status AS ENUM (
599
+ 'ACTIVE',
600
+ 'INACTIVE'
601
+ );
602
+ `,
603
+ });
604
+ });
605
+
606
+ test('extracts AGGREGATE', async () => {
607
+ const schemaObjects = parsePgDump(dump);
608
+
609
+ expect(schemaObjects).toContainEqual({
610
+ header: {
611
+ Name: 'my_sum(integer)',
612
+ Owner: 'postgres',
613
+ Schema: 'public',
614
+ Type: 'AGGREGATE',
615
+ },
616
+ sql: multiline`
617
+ CREATE AGGREGATE public.my_sum(integer) (
618
+ SFUNC = public.add_two_numbers,
619
+ STYPE = integer
620
+ );
621
+ `,
622
+ });
623
+ });
624
+
625
+ test('extracts FK CONSTRAINT', async () => {
626
+ const schemaObjects = parsePgDump(dump);
627
+
628
+ expect(schemaObjects).toContainEqual({
629
+ header: {
630
+ Name: 'bar bar_foo_id_fkey',
631
+ Owner: 'postgres',
632
+ Schema: 'public',
633
+ Type: 'FK CONSTRAINT',
634
+ },
635
+ sql: multiline`
636
+ ALTER TABLE ONLY public.bar
637
+ ADD CONSTRAINT bar_foo_id_fkey FOREIGN KEY (foo_id) REFERENCES public.foo(id) ON DELETE CASCADE;
638
+ `,
639
+ });
640
+ });
641
+
642
+ test('extracts INDEX', async () => {
643
+ const schemaObjects = parsePgDump(dump);
644
+
645
+ expect(schemaObjects).toContainEqual({
646
+ header: {
647
+ Name: 'bar_uid_idx',
648
+ Owner: 'postgres',
649
+ Schema: 'public',
650
+ Type: 'INDEX',
651
+ },
652
+ sql: multiline`
653
+ CREATE UNIQUE INDEX bar_uid_idx ON public.bar USING btree (uid);
654
+ `,
655
+ });
656
+ });
657
+
658
+ test('extracts CAST', async () => {
659
+ const schemaObjects = parsePgDump(dump);
660
+
661
+ expect(schemaObjects).toContainEqual({
662
+ header: {
663
+ Name: 'CAST (text AS integer)',
664
+ Owner: null,
665
+ Schema: null,
666
+ Type: 'CAST',
667
+ },
668
+ sql: multiline`
669
+ CREATE CAST (text AS integer) WITH INOUT AS IMPLICIT;
670
+ `,
671
+ });
672
+ });
673
+
674
+ test('extracts EXTENSION', async () => {
675
+ const schemaObjects = parsePgDump(dump);
676
+
677
+ expect(schemaObjects).toContainEqual({
678
+ header: {
679
+ Name: 'pgcrypto',
680
+ Owner: null,
681
+ Schema: null,
682
+ Type: 'EXTENSION',
683
+ },
684
+ sql: multiline`
685
+ CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
686
+ `,
687
+ });
688
+ });
689
+
690
+ test('extracts ACL', async () => {
691
+ const schemaObjects = parsePgDump(dump);
692
+
693
+ expect(schemaObjects).toContainEqual({
694
+ header: {
695
+ Name: 'COLUMN foo.name',
696
+ Owner: 'postgres',
697
+ Schema: 'public',
698
+ Type: 'ACL',
699
+ },
700
+ sql: multiline`
701
+ GRANT SELECT(name) ON TABLE public.foo TO postgres;
702
+ `,
703
+ });
704
+ });
705
+
706
+ test('extracts DEFAULT', async () => {
707
+ const schemaObjects = parsePgDump(dump);
708
+
709
+ expect(schemaObjects).toContainEqual({
710
+ header: {
711
+ Name: 'corge id',
712
+ Owner: 'postgres',
713
+ Schema: 'public',
714
+ Type: 'DEFAULT',
715
+ },
716
+ sql: multiline`
717
+ ALTER TABLE ONLY public.corge ALTER COLUMN id SET DEFAULT nextval('public.corge_id_seq'::regclass);
718
+ `,
719
+ });
720
+ });
721
+
722
+ test('extracts SEQUENCE OWNED BY', async () => {
723
+ const schemaObjects = parsePgDump(dump);
724
+
725
+ expect(schemaObjects).toContainEqual({
726
+ header: {
727
+ Name: 'corge_id_seq',
728
+ Owner: 'postgres',
729
+ Schema: 'public',
730
+ Type: 'SEQUENCE OWNED BY',
731
+ },
732
+ sql: multiline`
733
+ ALTER SEQUENCE public.corge_id_seq OWNED BY public.corge.id;
734
+ `,
735
+ });
736
+ });