CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
history_sql.cc File Reference
#include "history_sql.h"
#include <cassert>
#include "util/string.h"
Include dependency graph for history_sql.cc:

Go to the source code of this file.

Namespaces

 history
 

Macros

#define DB_FIELDS_V1R0
 
#define DB_FIELDS_V1R1
 
#define DB_FIELDS_V1R3
 
#define DB_PLACEHOLDERS
 
#define ROLLBACK_COND
 
#define MAKE_STATEMENT(STMT_TMPL, REV)
 
#define MAKE_STATEMENTS(STMT_TMPL)
 
#define DEFERRED_INIT(DB, REV)   DeferredInit((DB)->sqlite_db(), (REV).c_str())
 
#define DEFERRED_INITS(DB)
 

Macro Definition Documentation

#define DB_FIELDS_V1R0
Value:
"name, hash, revision, timestamp, channel, " \
"description, 0, ''"

Definition at line 196 of file history_sql.cc.

#define DB_FIELDS_V1R1
Value:
"name, hash, revision, timestamp, channel, " \
"description, size, ''"

Definition at line 198 of file history_sql.cc.

#define DB_FIELDS_V1R3
Value:
"name, hash, revision, timestamp, channel, " \
"description, size, branch"

Definition at line 200 of file history_sql.cc.

#define DB_PLACEHOLDERS
Value:
":name, :hash, :revision, :timestamp, :channel, " \
":description, :size, :branch"

Definition at line 202 of file history_sql.cc.

#define DEFERRED_INIT (   DB,
  REV 
)    DeferredInit((DB)->sqlite_db(), (REV).c_str())

Definition at line 222 of file history_sql.cc.

#define DEFERRED_INITS (   DB)
Value:
if ((DB)->IsEqualSchema((DB)->schema_version(), 1.0f) && \
(DB)->schema_revision() == 0) { \
DEFERRED_INIT((DB), V1R0); \
} else if ((DB)->schema_revision() < 3) { \
DEFERRED_INIT((DB), V1R1); \
} else { \
DEFERRED_INIT((DB), V1R3); \
}
#define DEFERRED_INIT(DB, REV)
Definition: history_sql.cc:222

Definition at line 225 of file history_sql.cc.

Referenced by history::SqlFindBranchHead::SqlFindBranchHead(), history::SqlFindTag::SqlFindTag(), history::SqlFindTagByDate::SqlFindTagByDate(), history::SqlInsertTag::SqlInsertTag(), history::SqlListRollbackTags::SqlListRollbackTags(), history::SqlListTags::SqlListTags(), and history::SqlRollbackTag::SqlRollbackTag().

#define MAKE_STATEMENT (   STMT_TMPL,
  REV 
)
Value:
static const std::string REV = \
ReplaceAll(STMT_TMPL, \
"@DB_FIELDS@", DB_FIELDS_ ## REV), \
"@DB_PLACEHOLDERS@", DB_PLACEHOLDERS), \
"@ROLLBACK_COND@", ROLLBACK_COND)
#define DB_PLACEHOLDERS
Definition: history_sql.cc:202
string ReplaceAll(const string &haystack, const string &needle, const string &replace_by)
Definition: string.cc:484
#define ROLLBACK_COND
Definition: history_sql.cc:204

Definition at line 208 of file history_sql.cc.

#define ROLLBACK_COND
Value:
"(revision > :target_rev OR " \
" name = :target_name) " \
"AND branch = ''"

Definition at line 204 of file history_sql.cc.