-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathpg_dump.ts
286 lines (286 loc) · 7.64 KB
/
pg_dump.ts
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
const completionSpec: Fig.Spec = {
name: "pg_dump",
description: "Dumps a database as a text file or to other formats",
options: [
{
name: ["--help", "-?"],
description: "Show help for pg_dump",
},
{
name: ["--file", "-f"],
description: "Output file or directory name",
args: { name: "filename" },
},
{
name: ["--format", "-F"],
description: "Output file format",
args: {
name: "format",
suggestions: [
{ name: "c", displayName: "custom" },
{ name: "d", displayName: "directory" },
{ name: "t", displayName: "tar" },
{ name: "p", displayName: "plain text" },
],
},
},
{
name: ["--jobs", "-j"],
description: "Number of parallel job to dump",
args: { name: "num" },
},
{
name: ["--verbose", "-v"],
description: "Verbose mode",
},
{
name: ["--version", "-V"],
description: "Output version information",
},
{
name: ["--compress", "-Z"],
description: "Compression level for compressed formats",
args: {
name: "level",
suggestions: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
},
},
{
name: "--lock-wait-timeout",
description: "Fail after waiting <timeout> for a table lock",
args: { name: "timeout" },
},
{
name: "--no-sync",
description: "Do not wait for changes to be written safely to disk",
},
{
name: ["--data-only", "-a"],
description: "Dump only the data, not the schema",
},
{
name: ["--blobs", "-b"],
description: "Include large objects in dump",
},
{
name: ["--no-blobs", "-B"],
description: "Exclude large objects in dump",
},
{
name: ["--clean", "-c"],
description: "Clean (drop) database objects before recreating",
},
{
name: ["--create", "-C"],
description: "Include commands to create database in dump",
},
{
name: ["--extension", "-e"],
description: "Dump the specified extension(s) only",
args: { name: "pattern" },
isRepeatable: true,
},
{
name: ["--encoding", "-E"],
description: "Dump the data in encoding <encoding>",
args: { name: "encoding" },
},
{
name: ["--schema", "-n"],
description: "Dump the specified schema(s) only",
args: { name: "pattern" },
isRepeatable: true,
},
{
name: ["--exclude-schema", "-N"],
description: "Do NOT dump the specified schema(s)",
args: { name: "pattern" },
isRepeatable: true,
},
{
name: ["--no-owner", "-O"],
description: "Skip restoration of object ownership in plain-text format",
},
{
name: ["--schema-only", "-s"],
description: "Dump only the schema, no data",
},
{
name: ["--superuser", "-S"],
description: "Superuser user name to use in plain-text format",
args: { name: "name" },
},
{
name: ["--table", "-t"],
description: "Dump the specified table(s) only",
args: { name: "table" },
isRepeatable: true,
},
{
name: ["--exclude-table", "-T"],
description: "Do NOT dump the specified table(s)",
args: { name: "table" },
isRepeatable: true,
},
{
name: ["--no-privileges", "-x", "--no-acl"],
description: "Do not dump privileges (grant/revoke)",
},
{
name: "--binary-upgrade",
description: "For use by upgrade utilities only",
},
{
name: ["--column-inserts", "--attribute-inserts"],
description: "Dump data as INSERT commands with column names",
},
{
name: "--disable-dollar-quoting",
description: "Disable dollar quoting, use SQL standard quoting",
},
{
name: "--disable-triggers",
description: "Disable triggers during data-only restore",
},
{
name: "--enable-row-security",
description: "Enable row security (dump only content user has access to)",
},
{
name: "--exclude-table-data",
description: "Do NOT dump data for the specified table(s)",
args: { name: "table" },
isRepeatable: true,
},
{
name: "--extra-float-digits",
description: "Override default setting for extra_float_digits",
args: { name: "num" },
},
{
name: "--if-exists",
description: "Use IF EXISTS when dropping objects",
},
{
name: "--include-foreign-data",
description:
"Include data of foreign tables on foreign servers matching PATTERN",
args: { name: "pattern" },
},
{
name: "--inserts",
description: "Dump data as INSERT commands, rather than COPY",
},
{
name: "--load-via-partition-root",
description: "Load partitions via the root table",
},
{
name: "--no-comments",
description: "Do not dump comments",
},
{
name: "--no-publications",
description: "Do not dump publications",
},
{
name: "--no-security-labels",
description: "Do not dump security label assignments",
},
{
name: "--no-subscriptions",
description: "Do not dump subscriptions",
},
{
name: "--no-synchronized-snapshots",
description: "Do not use synchronized snapshots in parallel jobs",
},
{
name: "--no-tablespaces",
description: "Do not dump tablespace assignments",
},
{
name: "--no-toast-compression",
description: "Do not dump TOAST compression methods",
},
{
name: "--no-unlogged-table-data",
description: "Do not dump unlogged table data",
},
{
name: "--on-conflict-do-nothing",
description: "Add ON CONFLICT DO NOTHING to INSERT commands",
},
{
name: "--quote-all-identifiers",
description: "Quote all identifiers, even if not key words",
},
{
name: "--rows-per-insert",
description: "Number of rows per INSERT; implies --inserts",
args: { name: "numbers" },
},
{
name: "--section",
description: "Dump named section (pre-data, data, or post-data)",
args: { name: "section" },
},
{
name: "--serializable-deferrable",
description: "Wait until the dump can run without anomalies",
},
{
name: "--snapshot",
description: "Use given snapshot for the dump",
args: { name: "snapshot" },
},
{
name: "--strict-names",
description:
"Require table and/or schema include patterns to match at least one entity each",
},
{
name: "--use-set-session-authorization",
description:
"Use SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to set ownership",
},
{
name: ["--dbname", "-d"],
description: "Database to dump",
args: { name: "database" },
},
{
name: ["--host", "-h"],
description: "Database server host or socket directory",
args: { name: "host" },
},
{
name: ["--port", "-p"],
description: "Database server port number",
args: { name: "number" },
},
{
name: ["--username", "-U"],
description: "Connect as specified database user",
args: { name: "name" },
},
{
name: ["--no-password", "-w"],
description: "Never prompt for password",
},
{
name: ["--password", "-W"],
description: "Force password prompt (should happen automatically)",
},
{
name: "--role",
description: "Do SET ROLE before dump",
args: { name: "name" },
},
],
args: {
name: "dbname",
description: "Name of the database to dump",
},
};
export default completionSpec;