-
Notifications
You must be signed in to change notification settings - Fork 8
/
cli.go
67 lines (64 loc) · 3.17 KB
/
cli.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
package pgdump
const (
binary = "pg_dump"
)
type Options struct {
Flags *Flags
AdditionalArgs []string
}
type Flags struct {
File string `flag:"--file="`
Format string `flag:"--format="`
LockWaitTimeout string `flag:"--lock-wait-timeout="`
Encoding string `flag:"--encoding="`
Schema string `flag:"--schema="`
ExcludeSchema string `flag:"--exclude-schema="`
Superuser string `flag:"--superuser="`
Table string `flag:"--table="`
ExcludeTable string `flag:"--exclude-table="`
ExcludeTableData string `flag:"--exclude-table-data="`
Section string `flag:"--section="`
Snapshots string `flag:"--snapshot="`
DBName string `flag:"--dbname="`
Host string `flag:"--host="`
Username string `flag:"--username="`
// unfortunately pg_dump has no cli-option to specify the password
// therefore we have to workaround by setting the corresponding password env-var
Password string `flag:"-" env:"PGPASSWORD"`
Role string `flag:"--role="`
Jobs int `flag:"--jobs="`
Compress int `flag:"--compress="`
ExtraFloatDigits int `flag:"--extra-float-digits="`
RowsPerInsert int `flag:"--rows-per-insert="`
Port int `flag:"--port="`
Verbose bool `flag:"--verbose"`
NoSync bool `flag:"--no-sync"`
DataOnly bool `flag:"--data-only"`
Blobs bool `flag:"--blobs"`
Clean bool `flag:"--clean"`
Create bool `flag:"--create"`
NoOwner bool `flag:"--no-owner"`
SchemaOnly bool `flag:"--schema-only"`
NoPrivileges bool `flag:"--no-privileges"`
BinaryUpgrade bool `flag:"--binary-upgrade"`
ColumnInserts bool `flag:"--column-inserts"`
DisableDollarQuoting bool `flag:"--disable-dollar-quoting"`
DisableTriggers bool `flag:"--disable-triggers"`
EnableRowSecurity bool `flag:"--enable-row-security"`
IfExists bool `flag:"--if-exists"`
Inserts bool `flag:"--inserts"`
LoadViaPartitionRoot bool `flag:"--load-via-partition-root"`
NoComments bool `flag:"--no-comments"`
NoPublications bool `flag:"--no-publications"`
NoSecurityLabels bool `flag:"--no-security-labels"`
NoSubscriptions bool `flag:"--no-subscriptions"`
NoSynchronizedSnapshots bool `flag:"--no-synchronized-snapshots"`
NoTablespaces bool `flag:"--no-tablespaces"`
NoUnloggedTableData bool `flag:"--no-unlogged-table-data"`
OnConflictDoNothing bool `flag:"--on-conflict-do-nothing"`
QuoteAllIdentifiers bool `flag:"--quote-all-identifiers"`
SerializableDeferrable bool `flag:"--serializable-deferrable"`
StrictNames bool `flag:"--strict-names"`
UseSetSessionAuthorization bool `flag:"--use-set-session-authorization"`
NoPassword bool `flag:"--no-password"`
}