vkdb
A time series database engine in C++.
Loading...
Searching...
No Matches
vkdb::Table Class Reference

Represents a table in vkdb. More...

#include <table.h>

Public Member Functions

 Table ()=delete
 Deleted default constructor.
 
 Table (const FilePath &db_path, const TableName &name)
 Construct a new Table object.
 
 Table (Table &&) noexcept=default
 Move-construct a new Table object.
 
Tableoperator= (Table &&) noexcept=default
 Move-assign a new Table object.
 
 Table (const Table &)=delete
 Deleted copy constructor.
 
Tableoperator= (const Table &)=delete
 Deleted copy assignment operator.
 
 ~Table () noexcept=default
 Destroy the Table object.
 
TablesetTagColumns (const TagColumns &tag_columns) noexcept
 Set the TagColumns object.
 
TableaddTagColumn (const TagKey &tag_column)
 Add a tag column.
 
TableremoveTagColumn (const TagKey &tag_column)
 Remove a tag column.
 
void clear () const noexcept
 Clear the table.
 
FriendlyQueryBuilder< double > query () noexcept
 Get a FriendlyQueryBuilder object.
 
TableName name () const noexcept
 Get the name of the table.
 
TagColumns tagColumns () const noexcept
 Get the TagColumns object.
 
FilePath path () const noexcept
 Get the path to the table directory.
 

Detailed Description

Represents a table in vkdb.

Definition at line 32 of file table.h.

Constructor & Destructor Documentation

◆ Table()

vkdb::Table::Table ( const FilePath & db_path,
const TableName & name )
explicit

Construct a new Table object.

Loads the table if it exists.

Parameters
db_pathPath to the database directory.
nameName of the table.
Exceptions
std::runtime_errorIf loading the table fails.

Definition at line 6 of file table.cpp.

Member Function Documentation

◆ addTagColumn()

Table & vkdb::Table::addTagColumn ( const TagKey & tag_column)

Add a tag column.

Parameters
tag_columnTag column.
Returns
Table& Reference to the table.
Exceptions
std::runtime_errorIf the table has previously been populated with data or the tag column already exists.

Definition at line 18 of file table.cpp.

◆ clear()

void vkdb::Table::clear ( ) const
noexcept

Clear the table.

Clears the table directory.

Definition at line 54 of file table.cpp.

◆ name()

TableName vkdb::Table::name ( ) const
nodiscardnoexcept

Get the name of the table.

Returns
TableName Name of the table.

Definition at line 63 of file table.cpp.

◆ path()

FilePath vkdb::Table::path ( ) const
nodiscardnoexcept

Get the path to the table directory.

Returns
FilePath Path to the directory.

Definition at line 71 of file table.cpp.

◆ query()

FriendlyQueryBuilder< double > vkdb::Table::query ( )
nodiscardnoexcept

Get a FriendlyQueryBuilder object.

Returns
FriendlyQueryBuilder<double> Friendly query builder.

Definition at line 59 of file table.cpp.

◆ removeTagColumn()

Table & vkdb::Table::removeTagColumn ( const TagKey & tag_column)

Remove a tag column.

Parameters
tag_columnTag column.
Returns
Table& Reference to the table.
Exceptions
std::runtime_errorIf the table has previously been populated with data or the tag column does not exist.

Definition at line 36 of file table.cpp.

◆ setTagColumns()

Table & vkdb::Table::setTagColumns ( const TagColumns & tag_columns)
noexcept

Set the TagColumns object.

Parameters
tag_columnsTag columns.
Returns
Table& Reference to the table.

Definition at line 13 of file table.cpp.

◆ tagColumns()

TagColumns vkdb::Table::tagColumns ( ) const
nodiscardnoexcept

Get the TagColumns object.

Returns
TagColumns Tag columns.

Definition at line 67 of file table.cpp.


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