CYCLUS
|
An Recorder backend that writes data to an sqlite database.
Identically named Datum objects have their data placed as rows in a single table. Handles the following datum value types: int, float, double, std::string, cyclus::Blob. Unsupported value types are stored as an empty string.
Definition at line 17 of file sqlite_back.h.
#include <sqlite_back.h>
Public Member Functions | |
void | Close () |
virtual std::map< std::string, DbTypes > | ColumnTypes (std::string table) |
SqliteDb & | db () |
void | Flush () |
std::string | Name () |
virtual void | Notify (DatumList data) |
virtual QueryResult | Query (std::string table, std::vector< Cond > *conds) |
SqliteBack (std::string path) | |
virtual std::set< std::string > | Tables () |
virtual | ~SqliteBack () |
Public Member Functions inherited from cyclus::FullBackend | |
virtual | ~FullBackend () |
Public Member Functions inherited from cyclus::QueryableBackend | |
virtual | ~QueryableBackend () |
Public Member Functions inherited from cyclus::RecBackend | |
virtual | ~RecBackend () |
cyclus::SqliteBack::SqliteBack | ( | std::string | path | ) |
Creates a new sqlite backend that will write to the database file specified by path.
If the file doesn't exist, a new one is created.
path | the filepath (including name) to write the sqlite file. |
Definition at line 47 of file sqlite_back.cc.
|
virtual |
Definition at line 38 of file sqlite_back.cc.
|
inlinevirtual |
Closes the backend, if approriate.
Implements cyclus::RecBackend.
Definition at line 37 of file sqlite_back.h.
|
virtual |
Return a map of column names of the specified table to the associated database type.
Implements cyclus::QueryableBackend.
Definition at line 139 of file sqlite_back.cc.
SqliteDb & cyclus::SqliteBack::db | ( | ) |
Returns the underlying sqlite database.
Only use this if you really know what you are doing.
Definition at line 161 of file sqlite_back.cc.
|
virtual |
Executes all pending commands.
Implements cyclus::RecBackend.
Definition at line 91 of file sqlite_back.cc.
|
virtual |
Returns a unique name for this backend.
Implements cyclus::RecBackend.
Definition at line 183 of file sqlite_back.cc.
Writes Datum objects immediately to the database as a single transaction.
data | group of Datum objects to write to the database together. |
Implements cyclus::RecBackend.
Definition at line 70 of file sqlite_back.cc.
|
virtual |
Return a set of rows from the specificed table that match all given conditions.
Conditions are AND'd together. conds may be NULL.
Implements cyclus::QueryableBackend.
Definition at line 103 of file sqlite_back.cc.
|
virtual |
Return a set of all table names currently in the database.
Implements cyclus::QueryableBackend.
Definition at line 147 of file sqlite_back.cc.