Audacity 3.2.0
Classes | Macros | Variables
DBConnection.cpp File Reference

Implements DBConnection. More...

#include "DBConnection.h"
#include "sqlite3.h"
#include <wx/string.h>
#include "AudacityLogger.h"
#include "BasicUI.h"
#include "FileNames.h"
#include "Internat.h"
#include "Project.h"
#include "FileException.h"
#include "wxFileNameWrapper.h"
#include "SentryHelper.h"
#include "TransactionScope.h"
Include dependency graph for DBConnection.cpp:

Go to the source code of this file.

Classes

struct  DBConnectionTransactionScopeImpl
 

Macros

#define AUDACITY_PROJECT_PAGE_SIZE   65536
 
#define xstr(a)   str(a)
 
#define str(a)   #a
 

Variables

static const char * PageSizeConfig
 
static const char * SafeConfig
 
static const char * FastConfig
 
static TransactionScope::Factory::Scope scope
 
static const AudacityProject::AttachedObjects::RegisteredFactory sConnectionPtrKey
 

Detailed Description

Implements DBConnection.


Audacity: A Digital Audio Editor

Paul Licameli – split from ProjectFileIO.cpp

Definition in file DBConnection.cpp.

Macro Definition Documentation

◆ AUDACITY_PROJECT_PAGE_SIZE

#define AUDACITY_PROJECT_PAGE_SIZE   65536

Definition at line 27 of file DBConnection.cpp.

◆ str

#define str (   a)    #a

Definition at line 30 of file DBConnection.cpp.

◆ xstr

#define xstr (   a)    str(a)

Definition at line 29 of file DBConnection.cpp.

Variable Documentation

◆ FastConfig

const char* FastConfig
static
Initial value:
=
"PRAGMA <schema>.busy_timeout = 5000;"
"PRAGMA <schema>.locking_mode = SHARED;"
"PRAGMA <schema>.synchronous = OFF;"
"PRAGMA <schema>.journal_mode = OFF;"

Definition at line 45 of file DBConnection.cpp.

Referenced by DBConnection::FastMode().

◆ PageSizeConfig

const char* PageSizeConfig
static
Initial value:
=
"PRAGMA <schema>.page_size = " xstr(AUDACITY_PROJECT_PAGE_SIZE) ";"
"VACUUM;"
#define AUDACITY_PROJECT_PAGE_SIZE
#define xstr(a)

Definition at line 32 of file DBConnection.cpp.

Referenced by DBConnection::SetPageSize().

◆ SafeConfig

const char* SafeConfig
static
Initial value:
=
"PRAGMA <schema>.busy_timeout = 5000;"
"PRAGMA <schema>.locking_mode = SHARED;"
"PRAGMA <schema>.synchronous = NORMAL;"
"PRAGMA <schema>.journal_mode = WAL;"
"PRAGMA <schema>.wal_autocheckpoint = 0;"

Definition at line 37 of file DBConnection.cpp.

Referenced by DBConnection::OpenStepByStep(), and DBConnection::SafeMode().

◆ sConnectionPtrKey

Initial value:
{
[]( AudacityProject & ){
auto result = std::make_shared< ConnectionPtr >();
return result;
}
}
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90

Definition at line 714 of file DBConnection.cpp.

Referenced by ConnectionPtr::Get().

◆ scope

Initial value:
{
[](AudacityProject &project) -> std::unique_ptr<TransactionScopeImpl> {
auto &connectionPtr = ConnectionPtr::Get(project);
if (auto pConnection = connectionPtr.mpConnection.get())
return
std::make_unique<DBConnectionTransactionScopeImpl>(*pConnection);
else
return nullptr;
} }
const auto project
static ConnectionPtr & Get(AudacityProject &project)

Definition at line 614 of file DBConnection.cpp.