|
xale-db 1.0
minimal SQL engine, written in c++
|
Mutable and persistent dataset. More...
#include <Table.h>


Public Member Functions | |
| Table (const std::string &name) | |
| Constructor. | |
| const std::string & | getName () const override |
| Get table name. | |
| const std::vector< ColumnDefinition > & | getSchema () const override |
| Get schema. | |
| const std::vector< Row > & | getRows () const override |
| Get all rows. | |
| size_t | getRowCount () const override |
| Get row count. | |
| size_t | getColumnCount () const override |
| Get column count. | |
| bool | isEmpty () const override |
| Check if empty. | |
| bool | isMutable () const override |
| Check if mutable. | |
| void | addColumn (const ColumnDefinition &column) |
| Add column definition. | |
| bool | insertRow (const Row &row) |
| Insert a row. | |
| size_t | updateRows (const std::string &columnName, const FieldValue &value, const std::unordered_map< std::string, FieldValue > &updates) |
| Update rows matching condition. | |
| size_t | deleteRows (const std::string &columnName, const FieldValue &value) |
| Delete rows matching condition. | |
| std::vector< Row > | findRows (const std::string &columnName, const FieldValue &value) const |
| Find rows by condition. | |
| std::vector< char > | serialize () const |
| Serialize table to binary format. | |
Static Public Member Functions | |
| static Table | deserialize (const std::vector< char > &data) |
| Deserialize table from binary format. | |
Mutable and persistent dataset.
|
explicit |
Constructor.
| name | Table name |
| void Xale::DataStructure::Table::addColumn | ( | const ColumnDefinition & | column | ) |
Add column definition.
| column | Column definition |
| size_t Xale::DataStructure::Table::deleteRows | ( | const std::string & | columnName, |
| const FieldValue & | value ) |
Delete rows matching condition.
| columnName | Column to filter |
| value | Value to match |
|
static |
Deserialize table from binary format.
| data | Vector of bytes containing serialized table |
| std::vector< Row > Xale::DataStructure::Table::findRows | ( | const std::string & | columnName, |
| const FieldValue & | value ) const |
Find rows by condition.
| columnName | Column name to filter |
| value | Value to match |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
| bool Xale::DataStructure::Table::insertRow | ( | const Row & | row | ) |
Insert a row.
| row | Row to insert |
| DbException | if validation fails |
|
overridevirtual |
|
overridevirtual |
| std::vector< char > Xale::DataStructure::Table::serialize | ( | ) | const |
Serialize table to binary format.
| size_t Xale::DataStructure::Table::updateRows | ( | const std::string & | columnName, |
| const FieldValue & | value, | ||
| const std::unordered_map< std::string, FieldValue > & | updates ) |
Update rows matching condition.
| columnName | Column to filter |
| value | Value to match |
| updates | Map of column names to new values |