Public Member Functions | List of all members
cyclus::SqliteBack Class Reference

Detailed Description

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>

Inheritance diagram for cyclus::SqliteBack:
cyclus::FullBackend cyclus::QueryableBackend cyclus::RecBackend

Public Member Functions

void Close ()
virtual std::map< std::string, DbTypesColumnTypes (std::string table)
SqliteDbdb ()
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 ()

Constructor & Destructor Documentation

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.

paththe filepath (including name) to write the sqlite file.

Definition at line 47 of file

cyclus::SqliteBack::~SqliteBack ( )

Definition at line 38 of file

Member Function Documentation

void cyclus::SqliteBack::Close ( )

Closes the backend, if approriate.

Implements cyclus::RecBackend.

Definition at line 37 of file sqlite_back.h.

std::map< std::string, DbTypes > cyclus::SqliteBack::ColumnTypes ( std::string  table)

Return a map of column names of the specified table to the associated database type.

Implements cyclus::QueryableBackend.

Definition at line 129 of file

SqliteDb & cyclus::SqliteBack::db ( )

Returns the underlying sqlite database.

Only use this if you really know what you are doing.

Definition at line 150 of file

void cyclus::SqliteBack::Flush ( )

Executes all pending commands.

Implements cyclus::RecBackend.

Definition at line 91 of file

std::string cyclus::SqliteBack::Name ( )

Returns a unique name for this backend.

Implements cyclus::RecBackend.

Definition at line 172 of file

void cyclus::SqliteBack::Notify ( DatumList  data)

Writes Datum objects immediately to the database as a single transaction.

datagroup of Datum objects to write to the database together.

Implements cyclus::RecBackend.

Definition at line 70 of file

QueryResult cyclus::SqliteBack::Query ( std::string  table,
std::vector< Cond > *  conds 

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 93 of file

std::set< std::string > cyclus::SqliteBack::Tables ( )

Return a set of all table names currently in the database.

Implements cyclus::QueryableBackend.

Definition at line 137 of file

The documentation for this class was generated from the following files: