5#ifndef TABLEAU_HYPER_TABLEDEFINITION_HPP
6#define TABLEAU_HYPER_TABLEDEFINITION_HPP
11#include <hyperapi/impl/infra.hpp>
16#include <hyperapi/hyperapi.h>
70 const std::string&
getCollation() const noexcept {
return collation_; }
100 const std::string collation_;
124 const std::vector<Column>&
getColumns() const noexcept {
return columns_; }
193 std::vector<Column> columns_;
195 friend class internal::HyperTableDefinition;
199#include <hyperapi/impl/TableDefinition.impl.hpp>
Represents an escaped SQL name.
A Column of a table definition.
const SqlType & getType() const noexcept
Returns the type of the column.
const Name & getName() const noexcept
Returns the name of the column.
const std::string & getCollation() const noexcept
Returns the collation of the column.
Nullability getNullability() const noexcept
Returns the Nullability of the column.
Column(Name name, SqlType type, Nullability nullability=Nullability::Nullable)
Creates a column.
Column(Name name, SqlType type, std::string collation, Nullability nullability=Nullability::Nullable)
Creates a column.
TableDefinition & setPersistence(Persistence p) noexcept
Sets the table's persistence.
size_t getColumnCount() const noexcept
Returns the numbers of columns.
TableDefinition & addColumn(Column &&c) noexcept
Adds a column to the definition.
TableDefinition(TableName name, Persistence persistence=Persistence::Permanent)
Creates a table definition with the given name and no columns.
optional< hyper_field_index_t > getColumnPositionByName(const Name &s) const noexcept
Returns the position of the column with the given name.
const Column * getColumnByName(const Name &s) const noexcept
Returns the column with the given name.
TableDefinition(TableName name, std::vector< Column > columns, Persistence persistence=Persistence::Permanent)
Creates a table definition with the given name and columns.
Persistence getPersistence() const noexcept
Returns the table persistence.
const Column & getColumn(hyper_field_index_t columnIndex) const
Returns the column at the given position.
TableDefinition & setTableName(TableName n) noexcept
Sets the table's name.
hyper_field_index_t column_index_type
Type of a column index.
TableDefinition & addColumn(const Column &c) noexcept
Adds a column to the definition.
const TableName & getTableName() const noexcept
Returns the name of the table.
const std::vector< Column > & getColumns() const noexcept
Returns all columns.
Represents an escaped SQL table name.
Surrogate for C++17 std::optional
The primary namespace of the Hyper API for C++.
Nullability
The nullability of a column.
@ NotNullable
The column cannot contain NULL values.
@ Nullable
The column can contain NULL values.
std::ostream & operator<<(std::ostream &os, const DatabaseName &name)
Stream output operator.
Persistence
Possible persistence levels for database objects.
@ Temporary
Temporary: Only available in the own session, not persisted.