15 Sql::Sql(sqlite3 *sqlite_db,
const std::string &statement)
21 const bool success =
Init(sqlite_db, statement);
72 unsigned int rows = 0;
77 const unsigned int cols = sqlite3_column_count(
statement_);
79 for (
unsigned int col = 0; col < cols; ++col) {
80 const char *name = sqlite3_column_name(
statement_, col);
82 if (col + 1 < cols) line +=
" | ";
84 result += line +
"\n";
89 for (
unsigned int col = 0; col < cols; ++col) {
99 line +=
reinterpret_cast<const char *
>(
RetrieveText(col));
102 line +=
"[BLOB data]";
108 if (col + 1 < cols) line +=
" | ";
111 result += line +
"\n";
132 bool Sql::Init(
const sqlite3 *database,
const std::string &statement) {
133 database_ =
const_cast<sqlite3 *
>(database);
134 return Init(statement.c_str());
160 database_ =
const_cast<sqlite3 *
>(database);
165 std::string msg = sqlite3_errmsg(
database_);
const char * query_string_
std::string GetLastErrorMsg() const
bool Init(const sqlite3 *database, const std::string &statement)
double RetrieveDouble(const int idx_column) const
assert((mem||(size==0))&&"Out Of Memory")
std::string DebugResultTable()
string StringifyDouble(const double value)
void DeferredInit(const sqlite3 *database, const char *statement)
sqlite3_int64 RetrieveInt64(const int idx_column) const
string StringifyInt(const int64_t value)
sqlite3_stmt * statement_
const unsigned char * RetrieveText(const int idx_column) const
CVMFS_EXPORT void LogCvmfs(const LogSource source, const int mask, const char *format,...)