|
iceberg-cpp
|
Semantic, driver-agnostic storage interface for the SQL catalog. More...
#include <catalog_store.h>
Public Member Functions | |
| virtual Status | Initialize ()=0 |
| Create the backing tables if they do not already exist. | |
| virtual Result< std::vector< std::string > > | ListNamespaceNames ()=0 |
| Return the distinct namespace identifiers known to this catalog. | |
| virtual Result< std::vector< NamespaceProperty > > | GetNamespaceProperties (std::string_view ns)=0 |
Return all property rows stored for ns. | |
| virtual Status | InsertNamespaceProperty (std::string_view ns, std::string_view key, std::optional< std::string_view > value)=0 |
Insert one property row for ns. | |
| virtual Status | DeleteNamespaceProperty (std::string_view ns, std::string_view key)=0 |
Delete the property row identified by (ns, key), if present. | |
| virtual Result< int64_t > | DeleteNamespace (std::string_view ns)=0 |
Delete all property rows for ns. | |
| virtual Result< std::vector< std::string > > | ListTableNames (std::string_view ns)=0 |
Return the table names stored directly under ns. | |
| virtual Result< bool > | TableExists (std::string_view ns, std::string_view name)=0 |
Whether a row exists for the table (ns, name). | |
| virtual Result< std::optional< std::string > > | GetTableMetadataLocation (std::string_view ns, std::string_view name)=0 |
Return the current metadata location of (ns, name). | |
| virtual Status | InsertTable (std::string_view ns, std::string_view name, std::string_view metadata_location)=0 |
| Insert a new table row with the given metadata location. | |
| virtual 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)=0 |
| Conditionally update a table's metadata location (optimistic CAS). | |
| virtual Result< int64_t > | DeleteTable (std::string_view ns, std::string_view name)=0 |
Delete the table row (ns, name), if present. | |
| virtual Result< int64_t > | RenameTable (std::string_view from_ns, std::string_view from_name, std::string_view to_ns, std::string_view to_name)=0 |
| Move a table row to a new namespace and/or name. | |
| virtual Status | RunInTransaction (const std::function< Status()> &body)=0 |
Execute body atomically inside a single transaction. | |
Semantic, driver-agnostic storage interface for the SQL catalog.
A store instance is scoped to one catalog name and persists namespace and table rows. Implementations must be safe for concurrent calls from SqlCatalog.
Unique or primary-key constraint violations from insert and rename operations must be reported as ErrorKind::kAlreadyExists. Other database failures should be reported as ErrorKind::kIOError.
|
pure virtual |
Delete all property rows for ns.
| ns | A namespace identifier in the store's string form. |
Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
Delete the property row identified by (ns, key), if present.
| ns | A namespace identifier in the store's string form. |
| key | Property key. |
Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
Delete the table row (ns, name), if present.
| ns | A namespace identifier in the store's string form. |
| name | Table name. |
Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
Return all property rows stored for ns.
| ns | A namespace identifier in the store's string form. |
Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
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. Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
Create the backing tables if they do not already exist.
Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
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. |
Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
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. |
Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
Return the distinct namespace identifiers known to this catalog.
Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
Return the table names stored directly under ns.
| ns | A namespace identifier in the store's string form. |
Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
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. |
Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
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. Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
Whether a row exists for the table (ns, name).
| ns | A namespace identifier in the store's string form. |
| name | Table name. |
Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.
|
pure virtual |
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. |
Implemented in iceberg::sql::Sqlpp23CatalogStore< ConnectionSource, Traits >.