You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(dump): add includeGeneratedColumns config option and docs" -m "Add CLI flag and config/docs support for including generated/default columns in dumps.
- Add `--include-generated-columns` flag and pass through to dump
- Document and example configuration
- Adjust table column filtering to include generated columns when enabled
- Remove temporary changelog file
Signed-off-by: chenen <itfunx@hotmail.com>
Copy file name to clipboardExpand all lines: docs/configuration.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,7 @@ The following are the environment variables, CLI flags and configuration file op
73
73
| names of databases to exclude from the dump | B | `exclude` | `DB_DUMP_EXCLUDE` | `dump.exclude` | |
74
74
| do not include `USE <database>;` statement in the dump | B | `no-database-name` | `DB_DUMP_NO_DATABASE_NAME` | `dump.noDatabaseName` | `false` |
75
75
| Replace single long INSERT statement per table with one INSERT statement per line | B | `skip-extended-insert` | `DB_DUMP_SKIP_EXTENDED_INSERT` | `dump.skipExtendedInsert` | `false` |
76
+
| Include generated columns in dump (not virtual columns) | B | `include-generated-columns` | `DB_DUMP_INCLUDE_GENERATED_COLUMNS` | `dump.includeGeneratedColumns` | `false` |
76
77
| restore to a specific database | R | `restore --database` | `RESTORE_DATABASE` | `restore.database` | |
77
78
| how often to do a dump or prune, in minutes | BP | `dump --frequency` | `DB_DUMP_FREQUENCY` | `dump.schedule.frequency` | `1440` (in minutes), i.e. once per day |
78
79
| what time to do the first dump or prune | BP | `dump --begin` | `DB_DUMP_BEGIN` | `dump.schedule.begin` | `0`, i.e. immediately |
@@ -139,8 +140,29 @@ for details of each.
139
140
* `once`: boolean, run once and exit
140
141
* `compression`: string, the compression to use
141
142
* `compact`: boolean, compact the dump
143
+
* `includeGeneratedColumns`: boolean, include columns marked as `GENERATED` in the dump (does not include `VIRTUAL` columns)
142
144
* `triggersAndFunctions`: boolean, include triggers and functions and procedures in the dump
143
145
* `maxAllowedPacket`: int, max packet size
146
+
147
+
When `includeGeneratedColumns` is enabled, columns that are defined with a `GENERATED` attribute or have a default expression
148
+
will be included in the row data that is emitted as `INSERT` statements in the dump. Note that `VIRTUAL` columns remain excluded
149
+
because they are computed and cannot be restored from dumped values.
150
+
151
+
Usage example:
152
+
153
+
Suppose a table has a column defined as:
154
+
155
+
```sql
156
+
`create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
157
+
```
158
+
159
+
When `includeGeneratedColumns` is turned on, rows for this table will contain the `create_time` value in the `INSERT` statements, e.g.:
0 commit comments