/
sql_data.go
159 lines (120 loc) · 3.71 KB
/
sql_data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
package testutil
// TestPGDump is a simple example pgdump file for a table containing a few cars
const TestPGDump = `
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.1 (Debian 11.1-1.pgdg90+1)
-- Dumped by pg_dump version 11.1 (Debian 11.1-1.pgdg90+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: cars; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.cars (
make character varying(50),
model character varying(50),
year smallint,
note character varying(100) DEFAULT 'literally a rocket'::character varying
);
ALTER TABLE public.cars OWNER TO postgres;
--
-- Data for Name: cars; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.cars (make, model, year, note) FROM stdin;
Tesla Roadster 2008 literally a rocket
Bugatti Chiron 2016 literally a rocket
Dodge Viper 2015 literally a rocket
Honda Civic 1998 only a rocket if it has a spoiler
Toyota Corolla 2005 greatest car ever made
\.
--
-- PostgreSQL database dump complete
--
`
// TestPGDumpNewRows is the same as TestPGDump, except that it has two new rows
const TestPGDumpNewRows = `
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.1 (Debian 11.1-1.pgdg90+1)
-- Dumped by pg_dump version 11.1 (Debian 11.1-1.pgdg90+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: cars; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.cars (
make character varying(50),
model character varying(50),
year smallint,
note character varying(100) DEFAULT 'literally a rocket'::character varying
);
ALTER TABLE public.cars OWNER TO postgres;
--
-- Data for Name: cars; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.cars (make, model, year, note) FROM stdin;
Fiat Panda 1981 If you extend the middle, it makes a great limo
Little Tikes Cozy Coupe 2018 Roomier than the panda, but the headlights are actually eyes
Sun Fresh Russet 2019 literally a potato
\.
--
-- PostgreSQL database dump complete
--
`
// TestPGDumpNewHeader has no rows, but has a new header
const TestPGDumpNewHeader = `
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.1 (Debian 11.1-1.pgdg90+1)
-- Dumped by pg_dump version 11.1 (Debian 11.1-1.pgdg90+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: cars; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.cars (
make character varying(50),
model character varying(50),
year smallint,
note character varying(100) DEFAULT 'literally a potato'::character varying
);
ALTER TABLE public.cars OWNER TO postgres;
--
-- Data for Name: cars; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.cars (make, model, year, note) FROM stdin;
\.
--
-- PostgreSQL database dump complete
--
`