5#ifndef TABLEAU_HYPER_CATALOG_HPP
6#define TABLEAU_HYPER_CATALOG_HPP
10#include <hyperapi/impl/infra.hpp>
11#include <hyperapi/hyperapi.h>
14#include <unordered_set>
The catalog class gives access to the metadata of the attached databases of a connection.
void createDatabaseIfNotExists(const std::string &databasePath)
Creates a database file with the given path if it doesn't exist yet.
void attachDatabase(const std::string &databasePath, const DatabaseName &databaseName)
Attaches a database file databasePath to the underlying connection under the name databaseName.
std::unordered_set< TableName > getTableNames(const SchemaName &schema) const
Gets the names of all tables in the given schema.
std::unordered_set< SchemaName > getSchemaNames(const DatabaseName &database) const
Gets the names of all schemas in database.
bool hasTable(const TableName &table) const
Checks whether a table with the given name exists.
void createSchema(const SchemaName &schemaName) const
Creates a SQL schema with the given name.
void detachAllDatabases()
Detaches all databases from the underlying connection.
void createDatabase(const std::string &databasePath)
Creates a database file with the given path.
void createTable(const hyperapi::TableDefinition &table_definition) const
Creates a SQL table with the given table definition.
Connection & getConnection() const noexcept
Returns the underlying connection.
void detachDatabase(const DatabaseName &databaseName)
Detaches a database from the underlying connection.
void attachDatabase(const std::string &databasePath)
Attaches a database file databasePath to the underlying connection.
void createTableIfNotExists(const hyperapi::TableDefinition &table_definition) const
Creates a SQL table with the given table definition.
std::unordered_set< SchemaName > getSchemaNames() const
Gets the name of all schemas in the first database in the database search path.
TableDefinition getTableDefinition(const TableName &tableName) const
Gets the table definition for an existing table.
void dropDatabaseIfExists(const std::string &databasePath)
Drops the database with the given path.
void dropDatabase(const std::string &databasePath)
Drops the database with the given path.
void createSchemaIfNotExists(const SchemaName &schemaName) const
Creates a SQL schema with the given name.
Defines a Hyper connection.
Represents an escaped SQL database name.
Represents an escaped SQL schema name.
Represents an escaped SQL table name.
The primary namespace of the Hyper API for C++.