mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 22:28:47 -04:00
backup feature is only available for sqlite 3.6.11 and newer
This commit is contained in:
parent
52b266333e
commit
f26fd5cfe8
1 changed files with 14 additions and 4 deletions
18
dbdimp.c
18
dbdimp.c
|
@ -1761,12 +1761,13 @@ sqlite_db_set_authorizer(pTHX_ SV *dbh, SV *authorizer)
|
|||
int
|
||||
sqlite_db_backup_from_file(pTHX_ SV *dbh, char *filename)
|
||||
{
|
||||
D_imp_dbh(dbh);
|
||||
|
||||
#if SQLITE_VERSION_NUMBER >= 3006011
|
||||
int rc;
|
||||
sqlite3 *pFrom;
|
||||
sqlite3_backup *pBackup;
|
||||
|
||||
D_imp_dbh(dbh);
|
||||
|
||||
croak_if_db_is_null();
|
||||
|
||||
rc = sqlite_open(filename, &pFrom);
|
||||
|
@ -1789,6 +1790,10 @@ sqlite_db_backup_from_file(pTHX_ SV *dbh, char *filename)
|
|||
}
|
||||
|
||||
return TRUE;
|
||||
#else
|
||||
sqlite_error(dbh, SQLITE_ERROR, form("backup feature requires SQLite 3.6.11 and newer"));
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Accesses the SQLite Online Backup API, and copies the currently loaded
|
||||
|
@ -1799,12 +1804,13 @@ sqlite_db_backup_from_file(pTHX_ SV *dbh, char *filename)
|
|||
int
|
||||
sqlite_db_backup_to_file(pTHX_ SV *dbh, char *filename)
|
||||
{
|
||||
D_imp_dbh(dbh);
|
||||
|
||||
#if SQLITE_VERSION_NUMBER >= 3006011
|
||||
int rc;
|
||||
sqlite3 *pTo;
|
||||
sqlite3_backup *pBackup;
|
||||
|
||||
D_imp_dbh(dbh);
|
||||
|
||||
croak_if_db_is_null();
|
||||
|
||||
rc = sqlite_open(filename, &pTo);
|
||||
|
@ -1827,6 +1833,10 @@ sqlite_db_backup_to_file(pTHX_ SV *dbh, char *filename)
|
|||
}
|
||||
|
||||
return TRUE;
|
||||
#else
|
||||
sqlite_error(dbh, SQLITE_ERROR, form("backup feature requires SQLite 3.6.11 and newer"));
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* end */
|
||||
|
|
Loading…
Add table
Reference in a new issue