Belle II Software light-2406-ragdoll
sqlite Namespace Reference

C++ wrapper around the sqlite C Api for convenient use of SQLite statements in C++. More...

Classes

class  Connection
 Simple wrapper for a SQLite database connection. More...
 
class  ObjectStatement
 SQLite prepared statement wrapper. More...
 
class  SQLiteError
 Simple error class to be thrown if there is any sqlite error on any of the operations. More...
 

Typedefs

template<class ... Columns>
using Statement = ObjectStatement< std::tuple< Columns... >, Columns... >
 Basic Statement returning a tuple of columns.
 
template<class T >
using SimpleStatement = ObjectStatement< T, T >
 Simple statement for only one column where the value is returned as is.
 

Detailed Description

C++ wrapper around the sqlite C Api for convenient use of SQLite statements in C++.

This namespace contains a header only interface to the sqlite library. It mainly consists of of a Connection class to wrap the underlying C api sqlite object in a safe way. It is intended for comfortable read only access to sqlite files.

It also contains three classes to handle SQL statements in sqlite files in a type safe way:

  • Statement: execute statement and return rows as std::tuple<Columns...>
  • ObjectStatement: execute statement and return rows as any object with a constructor accepting all elements of the std::tuple<Columns...>
  • SimpleStatement: execute a statement returning a single column and return that column without any wrapper.

Typedef Documentation

◆ SimpleStatement

Simple statement for only one column where the value is returned as is.

Definition at line 291 of file sqlite.h.

◆ Statement

using Statement = ObjectStatement<std::tuple<Columns...>, Columns...>

Basic Statement returning a tuple of columns.

In this case the result for each row is a std::tuple with all columns

Definition at line 289 of file sqlite.h.