Skip to content

Commit d7b8892

Browse files
committed
Added a new configuration key include-generated-columns (or environment variable DB_DUMP_INCLUDE_GENERATED_COLUMNS) to allow users to control whether generated columns should be included in database dumps.
Signed-off-by: chenen <itfunx@hotmail.com>
1 parent f59e17c commit d7b8892

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

pkg/core/dumpoptions.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ import (
1111
)
1212

1313
type DumpOptions struct {
14-
Targets []storage.Storage
15-
Safechars bool
16-
DBNames []string
17-
DBConn *database.Connection
18-
Compressor compression.Compressor
19-
Encryptor encrypt.Encryptor
20-
Exclude []string
21-
PreBackupScripts string
22-
PostBackupScripts string
23-
Compact bool
24-
Triggers bool
25-
Routines bool
26-
SuppressUseDatabase bool
27-
SkipExtendedInsert bool
14+
Targets []storage.Storage
15+
Safechars bool
16+
DBNames []string
17+
DBConn *database.Connection
18+
Compressor compression.Compressor
19+
Encryptor encrypt.Encryptor
20+
Exclude []string
21+
PreBackupScripts string
22+
PostBackupScripts string
23+
Compact bool
24+
Triggers bool
25+
Routines bool
26+
SuppressUseDatabase bool
27+
SkipExtendedInsert bool
2828
IncludeGeneratedColumns bool
29-
MaxAllowedPacket int
30-
Run uuid.UUID
31-
FilenamePattern string
29+
MaxAllowedPacket int
30+
Run uuid.UUID
31+
FilenamePattern string
3232
// PostDumpDelay inafter each dump is complete, while holding connection open. Do not use outside of tests.
3333
PostDumpDelay time.Duration
3434
// Parallelism how many databases to back up at once, consuming that number of threads

pkg/database/mysql/dump.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ Data struct to configure dump behavior
3939
LockTables: Lock all tables for the duration of the dump
4040
*/
4141
type Data struct {
42-
Out io.Writer
43-
Connection *sql.DB
44-
IgnoreTables []string
45-
MaxAllowedPacket int
46-
LockTables bool
47-
Schema string
48-
Compact bool
49-
Triggers bool
50-
Routines bool
51-
Host string
52-
SuppressUseDatabase bool
53-
SkipExtendedInsert bool
54-
Charset string
55-
Collation string
56-
PostDumpDelay time.Duration
42+
Out io.Writer
43+
Connection *sql.DB
44+
IgnoreTables []string
45+
MaxAllowedPacket int
46+
LockTables bool
47+
Schema string
48+
Compact bool
49+
Triggers bool
50+
Routines bool
51+
Host string
52+
SuppressUseDatabase bool
53+
SkipExtendedInsert bool
54+
Charset string
55+
Collation string
56+
PostDumpDelay time.Duration
5757
IncludeGeneratedColumns bool
5858

5959
tx *sql.Tx

0 commit comments

Comments
 (0)