CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
history::HistoryDatabase Class Reference

#include <history_sql.h>

Inheritance diagram for history::HistoryDatabase:
Collaboration diagram for history::HistoryDatabase:

Public Member Functions

bool CreateEmptyDatabase ()
 
bool InsertInitialValues (const std::string &repository_name)
 
bool ContainsRecycleBin () const
 
bool CheckSchemaCompatibility ()
 
bool LiveSchemaUpgradeIfNecessary ()
 
bool CompactDatabase () const
 
- Public Member Functions inherited from sqlite::Database< HistoryDatabase >
bool IsEqualSchema (const float value, const float compare) const
 
bool BeginTransaction () const
 
bool CommitTransaction () const
 
GetProperty (const std::string &key) const
 
GetPropertyDefault (const std::string &key, const T default_value) const
 
bool SetProperty (const std::string &key, const T value)
 
bool HasProperty (const std::string &key) const
 
sqlite3 * sqlite_db () const
 
const std::string & filename () const
 
float schema_version () const
 
unsigned schema_revision () const
 
bool read_write () const
 
unsigned GetModifiedRowCount () const
 
double GetFreePageRatio () const
 
void GetMemStatistics (MemStatistics *stats) const
 
bool Vacuum () const
 
void PrintSqlError (const std::string &error_msg)
 
std::string GetLastErrorMsg () const
 
void TakeFileOwnership ()
 
void DropFileOwnership ()
 
bool OwnsFile () const
 
void EnforceSchema (float version, unsigned revision)
 

Static Public Attributes

static const float kLatestSchema = 1.0
 
static const float kLatestSupportedSchema = 1.0
 
static const unsigned kLatestSchemaRevision = 3
 
static const std::string kFqrnKey = "fqrn"
 
- Static Public Attributes inherited from sqlite::Database< HistoryDatabase >
static const float kSchemaEpsilon
 

Protected Member Functions

 HistoryDatabase (const std::string &filename, const OpenMode open_mode)
 
- Protected Member Functions inherited from sqlite::Database< HistoryDatabase >
 Database (const std::string &filename, const OpenMode open_mode)
 
bool Initialize ()
 
bool CreatePropertiesTable ()
 
bool PrepareCommonQueries ()
 
bool OpenDatabase (const int sqlite_open_flags)
 
bool Configure ()
 
bool FileReadAhead ()
 
void ReadSchemaRevision ()
 
bool StoreSchemaRevision ()
 
void set_schema_version (const float ver)
 
void set_schema_revision (const unsigned rev)
 

Private Member Functions

bool CreateTagsTable ()
 
bool CreateRecycleBinTable ()
 
bool CreateBranchesTable ()
 
bool UpgradeSchemaRevision_10_1 ()
 
bool UpgradeSchemaRevision_10_2 ()
 
bool UpgradeSchemaRevision_10_3 ()
 

Friends

class sqlite::Database< HistoryDatabase >
 

Additional Inherited Members

- Public Types inherited from sqlite::Database< HistoryDatabase >
enum  OpenMode
 
- Static Public Member Functions inherited from sqlite::Database< HistoryDatabase >
static HistoryDatabase * Create (const std::string &filename)
 
static HistoryDatabase * Open (const std::string &filename, const OpenMode open_mode)
 

Detailed Description

This class wraps the database structure of the History SQLite database files. For that it inherits from sqlite::Database<>, please look there for further details.

Definition at line 20 of file history_sql.h.

Constructor & Destructor Documentation

history::HistoryDatabase::HistoryDatabase ( const std::string &  filename,
const OpenMode  open_mode 
)
inlineprotected

Definition at line 41 of file history_sql.h.

Member Function Documentation

bool history::HistoryDatabase::CheckSchemaCompatibility ( )

Definition at line 98 of file history_sql.cc.

Here is the call graph for this function:

bool history::HistoryDatabase::CompactDatabase ( ) const
inline

Definition at line 36 of file history_sql.h.

bool history::HistoryDatabase::ContainsRecycleBin ( ) const

Definition at line 93 of file history_sql.cc.

Here is the call graph for this function:

bool history::HistoryDatabase::CreateBranchesTable ( )
private

Definition at line 66 of file history_sql.cc.

Referenced by CreateEmptyDatabase(), and UpgradeSchemaRevision_10_3().

Here is the call graph for this function:

Here is the caller graph for this function:

bool history::HistoryDatabase::CreateEmptyDatabase ( )

This method creates a new database file and initializes the database schema.

Definition at line 35 of file history_sql.cc.

Here is the call graph for this function:

bool history::HistoryDatabase::CreateRecycleBinTable ( )
private

Definition at line 58 of file history_sql.cc.

Referenced by CreateEmptyDatabase(), and UpgradeSchemaRevision_10_2().

Here is the call graph for this function:

Here is the caller graph for this function:

bool history::HistoryDatabase::CreateTagsTable ( )
private

Definition at line 48 of file history_sql.cc.

Referenced by CreateEmptyDatabase().

Here is the call graph for this function:

Here is the caller graph for this function:

bool history::HistoryDatabase::InsertInitialValues ( const std::string &  repository_name)

Definition at line 87 of file history_sql.cc.

Here is the call graph for this function:

bool history::HistoryDatabase::LiveSchemaUpgradeIfNecessary ( )

Definition at line 104 of file history_sql.cc.

Here is the call graph for this function:

bool history::HistoryDatabase::UpgradeSchemaRevision_10_1 ( )
private

Definition at line 128 of file history_sql.cc.

Referenced by LiveSchemaUpgradeIfNecessary().

Here is the call graph for this function:

Here is the caller graph for this function:

bool history::HistoryDatabase::UpgradeSchemaRevision_10_2 ( )
private

Definition at line 144 of file history_sql.cc.

Referenced by LiveSchemaUpgradeIfNecessary().

Here is the call graph for this function:

Here is the caller graph for this function:

bool history::HistoryDatabase::UpgradeSchemaRevision_10_3 ( )
private

Definition at line 159 of file history_sql.cc.

Referenced by LiveSchemaUpgradeIfNecessary().

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class sqlite::Database< HistoryDatabase >
friend

Definition at line 40 of file history_sql.h.

Member Data Documentation

const std::string history::HistoryDatabase::kFqrnKey = "fqrn"
static

Database Schema ChangeLog:

Schema Version 1.0 -> Revision 3: deprecate (flush) table 'recycle_bin' add table 'branches' add column 'branch' to table tags -> Revision 2: add table 'recycle_bin' -> Revision 1: add field 'size'

Definition at line 27 of file history_sql.h.

Referenced by InsertInitialValues().

const float history::HistoryDatabase::kLatestSchema = 1.0
static

Definition at line 22 of file history_sql.h.

Referenced by CheckSchemaCompatibility(), and LiveSchemaUpgradeIfNecessary().

const unsigned history::HistoryDatabase::kLatestSchemaRevision = 3
static

Definition at line 25 of file history_sql.h.

Referenced by LiveSchemaUpgradeIfNecessary().

const float history::HistoryDatabase::kLatestSupportedSchema = 1.0
static

Definition at line 23 of file history_sql.h.

Referenced by CheckSchemaCompatibility().


The documentation for this class was generated from the following files: