@@ -112,12 +112,8 @@ CALL DOLT_COMMIT('-m', 'committing all changes');
112
112
113
113
## ` DOLT_BACKUP() `
114
114
115
- Sync with a configured backup. Other backup commands not supported
116
- via SQL yet.
117
-
118
- ``` sql
119
- CALL DOLT_BACKUP(' sync' , ' name' );
120
- ```
115
+ Add or remove a configured backup, sync with a configured backup, sync a backup
116
+ to a remote URL, restore a remote URL backup as a new database.
121
117
122
118
### Output Schema
123
119
@@ -129,14 +125,46 @@ CALL DOLT_BACKUP('sync', 'name');
129
125
+--------+------+---------------------------+
130
126
```
131
127
128
+ To sync the current database to configured backup:
129
+
130
+ ``` sql
131
+ CALL DOLT_BACKUP(' sync' , ' name' );
132
+ ```
133
+
134
+ To sync with a remote URL which is not configured as a backup:
135
+
136
+ ``` sql
137
+ CALL DOLT_BACKUP(' sync-url' , ' https://dolthub.com/some_organization/some_dolthub_repository' );
138
+ ```
139
+
140
+ To add and remove a configured backup:
141
+
142
+ ``` sql
143
+ CALL DOLT_BACKUP(' add' , ' dolthub' , ' https://dolthub.com/some_organization/some_dolthub_repository' );
144
+
145
+ CALL DOLT_BACKUP(' remove' , ' dolthub' );
146
+ ```
147
+
148
+ To restore a backup:
149
+
150
+ ``` sql
151
+ CALL DOLT_BACKUP(' restore' , ' https://dolthub.com/some_organization/some_dolthub_repository' , ' database_name' );
152
+ ```
153
+
132
154
### Example
133
155
134
156
``` sql
135
157
-- Set the current database for the session
136
158
USE mydb;
137
159
138
- -- Upload the current database contents to the named backup
160
+ -- Configure a backup to sync to.
161
+ CALL dolt_backup(' add' , ' my-backup' , ' https://dolthub.com/some_organization/some_dolthub_repository' );
162
+
163
+ -- Upload the current database contents to that named backup
139
164
CALL dolt_backup(' sync' , ' my-backup' )
165
+
166
+ -- Restore the uploaded database to a new database name
167
+ CALL dolt_backup(' restore' , ' https://dolthub.com/some_organization/some_dolthub_repository' , ' mydb_restored' );
140
168
```
141
169
142
170
## ` DOLT_BRANCH() `
0 commit comments