|
iceberg-cpp
|
CatalogStore backed by a concrete sqlpp23 connection source.
More...
#include <catalog_store_sqlpp23_internal.h>
Public Member Functions | |
| template<typename... SourceArgs> | |
| Sqlpp23CatalogStore (std::string catalog_name, SourceArgs &&... source_args) | |
| Status | Initialize () override |
| Create the backing tables if they do not already exist. | |
| Result< std::vector< std::string > > | ListNamespaceNames () override |
| Return the distinct namespace identifiers known to this catalog. | |
| Result< std::vector< NamespaceProperty > > | GetNamespaceProperties (std::string_view ns) override |
Return all property rows stored for ns. | |
| Status | InsertNamespaceProperty (std::string_view ns, std::string_view key, std::optional< std::string_view > value) override |
Insert one property row for ns. | |
| Status | DeleteNamespaceProperty (std::string_view ns, std::string_view key) override |
Delete the property row identified by (ns, key), if present. | |
| Result< int64_t > | DeleteNamespace (std::string_view ns) override |
Delete all property rows for ns. | |
| Result< std::vector< std::string > > | ListTableNames (std::string_view ns) override |
Return the table names stored directly under ns. | |
| Result< bool > | TableExists (std::string_view ns, std::string_view name) override |
Whether a row exists for the table (ns, name). | |
| Result< std::optional< std::string > > | GetTableMetadataLocation (std::string_view ns, std::string_view name) override |
Return the current metadata location of (ns, name). | |
| Status | InsertTable (std::string_view ns, std::string_view name, std::string_view metadata_location) override |
| Insert a new table row with the given metadata location. | |
| Result< int64_t > | UpdateTableMetadataLocation (std::string_view ns, std::string_view name, std::string_view new_location, std::string_view new_previous_location, std::string_view expected_current_location) override |
| Conditionally update a table's metadata location (optimistic CAS). | |
| Result< int64_t > | DeleteTable (std::string_view ns, std::string_view name) override |
Delete the table row (ns, name), if present. | |
| Result< int64_t > | RenameTable (std::string_view from_ns, std::string_view from_name, std::string_view to_ns, std::string_view to_name) override |
| Move a table row to a new namespace and/or name. | |
| Status | RunInTransaction (const std::function< Status()> &body) override |
Execute body atomically inside a single transaction. | |
CatalogStore backed by a concrete sqlpp23 connection source.
| ConnectionSource | A single connection or pooled connection source. |
| Traits | A policy type providing static bool IsUniqueViolation(const std::exception&) and optionally static bool IsDuplicateColumn(const std::exception&). |
|
inlineoverridevirtual |
Delete all property rows for ns.
| ns | A namespace identifier in the store's string form. |
Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Delete the property row identified by (ns, key), if present.
| ns | A namespace identifier in the store's string form. |
| key | Property key. |
Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Delete the table row (ns, name), if present.
| ns | A namespace identifier in the store's string form. |
| name | Table name. |
Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Return all property rows stored for ns.
| ns | A namespace identifier in the store's string form. |
Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Return the current metadata location of (ns, name).
| ns | A namespace identifier in the store's string form. |
| name | Table name. |
std::nullopt if the table has no row or its metadata_location column is NULL. Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Create the backing tables if they do not already exist.
Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Insert one property row for ns.
A primary-key collision (same namespace + key) must be reported as ErrorKind::kAlreadyExists.
| ns | A namespace identifier in the store's string form. |
| key | Property key. |
| value | Property value, or std::nullopt for SQL NULL. |
Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Insert a new table row with the given metadata location.
The previous_metadata_location column is set to NULL. A primary-key collision must be reported as ErrorKind::kAlreadyExists.
| ns | A namespace identifier in the store's string form. |
| name | Table name. |
| metadata_location | Table metadata location. |
Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Return the distinct namespace identifiers known to this catalog.
Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Return the table names stored directly under ns.
| ns | A namespace identifier in the store's string form. |
Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Move a table row to a new namespace and/or name.
A primary-key collision with an existing target must be reported as ErrorKind::kAlreadyExists.
| from_ns | Source namespace identifier in the store's string form. |
| from_name | Source table name. |
| to_ns | Target namespace identifier in the store's string form. |
| to_name | Target table name. |
Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Execute body atomically inside a single transaction.
The implementation begins a transaction, invokes body (which issues store operations on this same instance), then commits if body returns success or rolls back otherwise. Implementations are not required to support nesting.
| body | Transaction body to execute. |
body, or a transaction error. Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Whether a row exists for the table (ns, name).
| ns | A namespace identifier in the store's string form. |
| name | Table name. |
Implements iceberg::sql::CatalogStore.
|
inlineoverridevirtual |
Conditionally update a table's metadata location (optimistic CAS).
The update only applies when the stored metadata_location still equals expected_current_location.
| ns | A namespace identifier in the store's string form. |
| name | Table name. |
| new_location | New table metadata location. |
| new_previous_location | New previous metadata location. |
| expected_current_location | Expected current metadata location. |
Implements iceberg::sql::CatalogStore.