|
xale-db 1.0
minimal SQL engine, written in c++
|
Represents a mutable and persistent dataset (table). More...
#include <Table.h>


Public Member Functions | |
| Table (const std::string &name) | |
| Construct a new Table with the given name. | |
| const std::string & | getName () const override |
| const std::vector< ColumnDefinition > & | getSchema () const override |
| const std::vector< Row > & | getRows () const override |
| size_t | getRowCount () const override |
| size_t | getColumnCount () const override |
| bool | isEmpty () const override |
| bool | isMutable () const override |
| void | addColumn (const ColumnDefinition &column) |
| Add a new column to the table schema. | |
| bool | insertRow (const Row &row) |
| Insert a new row into the table. | |
| size_t | updateRows (const std::string &columnName, const FieldValue &value, const std::unordered_map< std::string, FieldValue > &updates) |
| Update rows matching a condition. | |
| size_t | deleteRows (const std::string &columnName, const FieldValue &value) |
| Delete rows matching a condition. | |
| std::vector< Row > | findRows (const std::string &columnName, const FieldValue &value) const |
| Find rows matching a condition. | |
| std::vector< char > | serialize () const |
| Serialize the table to a byte vector. | |
Static Public Member Functions | |
| static Table | deserialize (const std::vector< char > &data) |
| Deserialize a table from a byte vector. | |
Represents a mutable and persistent dataset (table).
Provides methods for schema definition, row manipulation, and serialization.
|
explicit |
Construct a new Table with the given name.
| name | Name of the table |
| void Xale::DataStructure::Table::addColumn | ( | const ColumnDefinition & | column | ) |
Add a new column to the table schema.
| column | Column definition to add |
| size_t Xale::DataStructure::Table::deleteRows | ( | const std::string & | columnName, |
| const FieldValue & | value ) |
Delete rows matching a condition.
| columnName | Name of the column to match |
| value | Value to match in the column |
|
static |
Deserialize a table from a byte vector.
| data | Serialized data |
| std::vector< Row > Xale::DataStructure::Table::findRows | ( | const std::string & | columnName, |
| const FieldValue & | value ) const |
Find rows matching a condition.
| columnName | Name of the column to match |
| value | Value to match in the column |
|
overridevirtual |
Implements Xale::DataStructure::IDataTemplate.
|
overridevirtual |
Implements Xale::DataStructure::IDataTemplate.
|
overridevirtual |
Implements Xale::DataStructure::IDataTemplate.
|
overridevirtual |
Implements Xale::DataStructure::IDataTemplate.
|
overridevirtual |
Implements Xale::DataStructure::IDataTemplate.
| bool Xale::DataStructure::Table::insertRow | ( | const Row & | row | ) |
Insert a new row into the table.
| row | Row to insert |
|
overridevirtual |
Implements Xale::DataStructure::IDataTemplate.
|
overridevirtual |
Implements Xale::DataStructure::IDataTemplate.
| std::vector< char > Xale::DataStructure::Table::serialize | ( | ) | const |
Serialize the table to a byte vector.
| size_t Xale::DataStructure::Table::updateRows | ( | const std::string & | columnName, |
| const FieldValue & | value, | ||
| const std::unordered_map< std::string, FieldValue > & | updates ) |
Update rows matching a condition.
| columnName | Name of the column to match |
| value | Value to match in the column |
| updates | Map of column names to new values |