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:
Inheritance graph

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

◆ SqliteBack()

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

◆ ~SqliteBack()

cyclus::SqliteBack::~SqliteBack ( )

Definition at line 38 of file

Member Function Documentation

◆ Close()

void cyclus::SqliteBack::Close ( )

Closes the backend, if approriate.

Implements cyclus::RecBackend.

Definition at line 37 of file sqlite_back.h.

◆ ColumnTypes()

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

◆ db()

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

◆ Flush()

void cyclus::SqliteBack::Flush ( )

Executes all pending commands.

Implements cyclus::RecBackend.

Definition at line 91 of file

◆ Name()

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

Returns a unique name for this backend.

Implements cyclus::RecBackend.

Definition at line 183 of file

◆ Notify()

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

◆ Query()

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

◆ Tables()

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

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

Implements cyclus::QueryableBackend.

Definition at line 147 of file

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