1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-02 09:54:42 +01:00

AUP3: Adds connection configuration and ...

Optimizes a couple of sample block copy loops by only preparing
the statement once outside the loop.

The connection configuration ensure that all connections use the same
settings...assuming you remember to configure it after opening. :-)

The possibly controversial setting is the "PRAGMA synchronous = off"
This commit is contained in:
Leland Lucius
2020-07-16 01:10:54 -05:00
parent e2f9090723
commit 6ffced4881
2 changed files with 158 additions and 69 deletions

View File

@@ -138,7 +138,10 @@ private:
void RestoreConnection();
// Use a connection that is already open rather than invoke OpenDB
void UseConnection( sqlite3 *db, const FilePath &filePath );
void UseConnection(sqlite3 *db, const FilePath &filePath);
// Make sure the connection/schema combo is configured the way we want
void ConfigConnection(sqlite3 *db, const wxString &schema = wxT("main"));
sqlite3 *OpenDB(FilePath fileName = {});
bool CloseDB();
@@ -153,7 +156,7 @@ private:
bool GetBlob(const char *sql, wxMemoryBuffer &buffer);
bool CheckVersion();
bool InstallSchema(sqlite3 *db, const char *dbname = "main");
bool InstallSchema(sqlite3 *db, const char *schema = "main");
bool UpgradeSchema();
// Write project or autosave XML (binary) documents
@@ -174,9 +177,6 @@ private:
void SetError(const TranslatableString & msg);
void SetDBError(const TranslatableString & msg);
using UpdateCB = std::function<void(int operation, char const *dbname, char const *table, long long rowid)>;
static void UpdateCallback(void *data, int operation, char const *dbname, char const *table, long long rowid);
unsigned long long CalculateUsage();
private: