1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Clarify documentation regarding the --recovery-db option to ".recover" and

the magic 789 configuration option it is associated with.

FossilOrigin-Name: f6fa0cffa921ccde8910e7fa4a63c2e4ef8ddb376c8ce99e436b27ac332c4498
This commit is contained in:
drh
2022-11-02 14:08:26 +00:00
parent 12de518db4
commit 2cdcc7f01a
5 changed files with 26 additions and 19 deletions

View File

@ -1000,15 +1000,13 @@ static int recoverSqlCb(void *pCtx, const char *zSql){
** This function is called to recover data from the database.
*/
static int recoverDatabase(sqlite3 *db){
int rc = SQLITE_OK;
const char *zRecoveryDb = ""; /* Name of "recovery" database */
const char *zLAF = "lost_and_found";
int bFreelist = 1;
int bRowids = 1;
sqlite3_recover *p = 0;
int rc; /* Return code from this routine */
const char *zLAF = "lost_and_found"; /* Name of "lost_and_found" table */
int bFreelist = 1; /* True to scan the freelist */
int bRowids = 1; /* True to restore ROWID values */
sqlite3_recover *p; /* The recovery object */
p = sqlite3_recover_init_sql(db, "main", recoverSqlCb, 0);
sqlite3_recover_config(p, 789, (void*)zRecoveryDb);
sqlite3_recover_config(p, SQLITE_RECOVER_LOST_AND_FOUND, (void*)zLAF);
sqlite3_recover_config(p, SQLITE_RECOVER_ROWIDS, (void*)&bRowids);
sqlite3_recover_config(p, SQLITE_RECOVER_FREELIST_CORRUPT,(void*)&bFreelist);