45 return static_cast<sqlite3*
>(conn.
db_);
49 namespace SqliteHelper
76 bool columnExists(sqlite3* db,
const std::string& tablename,
const std::string& colname);
101 void prepareStatement(sqlite3* db, sqlite3_stmt** stmt,
const std::string& prepare_statement);
120 void executeBindStatement(sqlite3* db,
const std::string& prepare_statement,
const std::vector<std::string>& data);
125 template <
typename T>
128 static_assert(std::is_same<T, std::false_type>::value,
"Wrong input type to clearSignBit(). Please pass unsigned 64bit ints!");
134 return value & ~(1ULL << 63);
183 template <
typename ValueType>
A method or algorithm argument contains illegal values.
Definition Exception.h:633
File adapter for Sqlite files.
Definition SqliteConnector.h:41
void * db_
Definition SqliteConnector.h:132
int64_t Int64
Signed integer type (64bit)
Definition Types.h:40
uint64_t UInt64
Unsigned integer type (64bit)
Definition Types.h:47
bool extractBool(sqlite3_stmt *stmt, int pos)
char extractChar(sqlite3_stmt *stmt, int pos)
double extractDouble(sqlite3_stmt *stmt, int pos)
float extractFloat(sqlite3_stmt *stmt, int pos)
convenience function; note: in SQL there is no float, just double. So this might be narrowing.
std::string extractString(sqlite3_stmt *stmt, int pos)
int extractInt(sqlite3_stmt *stmt, int pos)
Int64 extractInt64(sqlite3_stmt *stmt, int pos)
SqlState nextRow(sqlite3_stmt *stmt, SqlState current=SqlState::SQL_ROW)
retrieves the next row from a prepared statement
void executeBindStatement(sqlite3 *db, const std::string &prepare_statement, const std::vector< std::string > &data)
Executes raw data SQL statements (insert statements)
SqlState
Definition SqliteConnector_impl.h:139
@ SQL_ERROR
includes SQLITE_BUSY, SQLITE_ERROR, SQLITE_MISUSE
bool extractValue< int >(int *dst, sqlite3_stmt *stmt, int pos)
bool extractValue< std::string >(std::string *dst, sqlite3_stmt *stmt, int pos)
void prepareStatement(sqlite3 *db, sqlite3_stmt **stmt, const std::string &prepare_statement)
Converts an SQL statement into a prepared statement.
sqlite3 * getNativeHandle(SqliteConnector &conn)
Retrieve the typed native SQLite handle behind a SqliteConnector.
Definition SqliteConnector_impl.h:52
void executeStatement(sqlite3 *db, const std::string &statement)
Executes a given SQL statement (insert statement)
bool tableExists(sqlite3 *db, const std::string &tablename)
Checks whether the given table exists.
bool extractValue< Int64 >(Int64 *dst, sqlite3_stmt *stmt, int pos)
UInt64 clearSignBit(T)
Definition SqliteConnector_impl.h:126
bool extractValue< double >(double *dst, sqlite3_stmt *stmt, int pos)
bool columnExists(sqlite3 *db, const std::string &tablename, const std::string &colname)
Checks whether the given table contains a certain column.
bool extractValueIntStr(std::string *dst, sqlite3_stmt *stmt, int pos)
Special case where an integer should be stored in a std::string field.
bool extractValue(ValueType *, sqlite3_stmt *, int)
Extracts a specific value from an SQL column.
Definition SqliteConnector_impl.h:184
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition SqliteConnector_impl.h:42
static sqlite3 * handle(SqliteConnector &conn)
Definition SqliteConnector_impl.h:43