SQLamarr
The stand-alone ultra-fast simulation option for the LHCb experiment
SQLamarr::EditEventStore Class Reference

Execute a query non returning anything, but modifying the event store. More...

#include <EditEventStore.h>

Inheritance diagram for SQLamarr::EditEventStore:

Classes

class  EditEventStore
 Execute a transaction with multiple custom queries without returning any output. More...
 

Public Member Functions

 EditEventStore (SQLite3DB &db, const std::vector< std::string > &queries)
 Constructor. More...
 
void execute () override
 Execute the algorithm, cleaning the database. More...
 
- Public Member Functions inherited from SQLamarr::BaseSqlInterface
 BaseSqlInterface (SQLite3DB &db)
 Constructor, acquiring the database without ownership. More...
 
virtual ~BaseSqlInterface ()
 
void sync_database (const std::string &db_uri)
 
void invalidate_cache (void)
 Invalidate the cache of the queries. More...
 

Public Attributes

 argtypes
 
 restype
 

Additional Inherited Members

- Protected Member Functions inherited from SQLamarr::BaseSqlInterface
sqlite3_stmt * get_statement (const std::string &name, const std::string &query)
 Creates or retrieve from cache a statement. More...
 
void begin_transaction ()
 Begin an SQL transaction stopping update to disk util end_transaction() is issued
More...
 
void end_transaction ()
 End an SQL transaction re-enabling disk updates. More...
 
int last_insert_row ()
 Return the index of the last rows inserted in any table. More...
 
void using_sql_function (const std::string &name, int argc, void(*xFunc)(sqlite3_context *, int, sqlite3_value **))
 Register a static function in DB, enabling usage from SQL. More...
 
bool exec_stmt (sqlite3_stmt *)
 Execute a statement, possibly throwing an exception on failure. More...
 
- Protected Attributes inherited from SQLamarr::BaseSqlInterface
SQLite3DBm_database
 Reference to the SQLite database (not owned). More...
 

Detailed Description

Execute a query non returning anything, but modifying the event store.

Sometimes it may be necessary to modify the event model during the execution of a pipeline, for example to drop tables or to add columns to existing ones, or even to update some table.

EditEventStore provides a generic building block which enables executing arbitrary queries to the SQLite3 database, without storing the output, if any.

Definition at line 33 of file EditEventStore.h.

Constructor & Destructor Documentation

◆ EditEventStore()

SQLamarr::EditEventStore::EditEventStore ( SQLite3DB db,
const std::vector< std::string > &  queries 
)

Constructor.

Parameters
dbReference to the database
queriesVector of queries to be executed in a single transaction

Definition at line 26 of file EditEventStore.cpp.

Member Function Documentation

◆ execute()

void SQLamarr::EditEventStore::execute ( void  )
overridevirtual

Execute the algorithm, cleaning the database.

Implements SQLamarr::Transformer.

Definition at line 37 of file EditEventStore.cpp.

Member Data Documentation

◆ argtypes

SQLamarr.EditEventStore.argtypes

Definition at line 17 of file EditEventStore.py.

◆ restype

SQLamarr.EditEventStore.restype

Definition at line 22 of file EditEventStore.py.


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