pub struct KeyValueCatalog { /* private fields */ }Implementations§
Source§impl KeyValueCatalog
impl KeyValueCatalog
pub fn new(store: Arc<dyn KeyValueStore>) -> Self
pub fn store(&self) -> Arc<dyn KeyValueStore> ⓘ
Trait Implementations§
Source§impl CatalogFacade for KeyValueCatalog
impl CatalogFacade for KeyValueCatalog
Source§fn record_revisions(
&self,
records: &[CatalogRecordRef<'_>],
) -> StorageBackendResult<Option<Vec<Option<CatalogRecordRevision>>>>
fn record_revisions( &self, records: &[CatalogRecordRef<'_>], ) -> StorageBackendResult<Option<Vec<Option<CatalogRecordRevision>>>>
Read selected catalog-record identities from one committed/private boundary, in request order and without loading table data. An outer
None means this provider has no exact record tracking; an inner None means the selected record is absent. Callers must not interpret unavailable tracking as an unchanged object.Source§fn transaction_model(&self) -> StorageTransactionModel
fn transaction_model(&self) -> StorageTransactionModel
Transaction model and database incarnation shared with the paired backend. Wrappers must forward this with the session affinity.
Source§fn transaction_affinity(&self) -> Option<StorageSessionAffinity>
fn transaction_affinity(&self) -> Option<StorageSessionAffinity>
Identity shared with the paired data backend’s transaction context. Wrappers must delegate this when their underlying catalog reports an identity.
Source§fn clear_path_index_data(&self, index: &str) -> StorageBackendResult<()>
fn clear_path_index_data(&self, index: &str) -> StorageBackendResult<()>
Durable reachability records, paged lexicographically by (source, target).
Building calls clear, bounded saves, then finish inside one transaction.
Graph mutations invalidate the materialization atomically; definitions remain.
fn save_path_index_pairs( &self, index: &str, sequence: &str, pairs: &[(u64, u64)], ) -> StorageBackendResult<()>
fn finish_path_index_data( &self, index: &str, graph: &str, definition: &str, ) -> StorageBackendResult<()>
fn path_index_data_is_current( &self, index: &str, definition: &str, ) -> StorageBackendResult<bool>
fn path_index_pairs( &self, index: &str, sequence: &str, after: Option<(u64, u64)>, limit: usize, ) -> StorageBackendResult<Vec<(u64, u64)>>
Source§fn graph_vertex(&self, id: u64) -> StorageBackendResult<Option<GraphVertexRow>>
fn graph_vertex(&self, id: u64) -> StorageBackendResult<Option<GraphVertexRow>>
Read one entity without loading any other graph payload.
fn graph_edge(&self, id: u64) -> StorageBackendResult<Option<EdgeRow>>
Source§fn graph_entity_ids(
&self,
filter: GraphEntityFilter<'_>,
after: Option<u64>,
limit: usize,
) -> StorageBackendResult<Vec<u64>>
fn graph_entity_ids( &self, filter: GraphEntityFilter<'_>, after: Option<u64>, limit: usize, ) -> StorageBackendResult<Vec<u64>>
Read a bounded, strictly ascending identity page from the pinned
storage snapshot. Filters must be applied before the page limit.
fn graph_entity_count( &self, filter: GraphEntityFilter<'_>, ) -> StorageBackendResult<u64>
fn graph_entity_max_id( &self, kind: GraphEntityKind, ) -> StorageBackendResult<Option<u64>>
fn graph_entity_memberships( &self, kind: GraphEntityKind, id: u64, ) -> StorageBackendResult<Vec<String>>
fn graph_has_membership( &self, kind: GraphEntityKind, id: u64, graph: &str, ) -> StorageBackendResult<bool>
fn set_metadata(&self, key: &str, value: &str) -> StorageBackendResult<()>
Source§fn delete_metadata(&self, key: &str) -> StorageBackendResult<()>
fn delete_metadata(&self, key: &str) -> StorageBackendResult<()>
Remove one metadata record, retaining its private deletion and write precondition until transaction end.
fn get_metadata(&self, key: &str) -> StorageBackendResult<Option<String>>
Source§fn metadata_has_private_changes(&self, key: &str) -> StorageBackendResult<bool>
fn metadata_has_private_changes(&self, key: &str) -> StorageBackendResult<bool>
Whether this metadata key has a transaction-private replacement in the current session.
Source§fn metadata_with_prefix(
&self,
prefix: &str,
) -> StorageBackendResult<Vec<(String, String)>>
fn metadata_with_prefix( &self, prefix: &str, ) -> StorageBackendResult<Vec<(String, String)>>
Read matching metadata keys from one catalog snapshot; the prefix is literal, including NUL and wildcard characters.
Source§fn save_statistics_maintenance(
&self,
table: &str,
state: &StatisticsMaintenance,
) -> StorageBackendResult<()>
fn save_statistics_maintenance( &self, table: &str, state: &StatisticsMaintenance, ) -> StorageBackendResult<()>
Persist evaluated maintenance state. Concurrent providers merge its counters under their existing record-publication boundary; serialized providers use an ordinary metadata replacement.
Source§fn migrate_relation_namespace(&self) -> StorageBackendResult<()>
fn migrate_relation_namespace(&self) -> StorageBackendResult<()>
Atomically migrate the former flat relation namespace into typed,
schema-owned catalog objects. Implementations must reject normalized
or cross-kind collisions instead of merging either object.
fn save_schema_row(&self, schema: &SchemaRow) -> StorageBackendResult<()>
Source§fn schema_has_private_changes(&self, name: &str) -> StorageBackendResult<bool>
fn schema_has_private_changes(&self, name: &str) -> StorageBackendResult<bool>
Whether this exact schema has a private creation, replacement or deletion in the current session.
fn drop_schema(&self, name: &str) -> StorageBackendResult<()>
fn load_schema_rows(&self) -> StorageBackendResult<Vec<SchemaRow>>
fn save_table(&self, schema: &TableSchema) -> StorageBackendResult<()>
fn load_tables(&self) -> StorageBackendResult<Vec<TableSchema>>
fn drop_table(&self, name: &str) -> StorageBackendResult<()>
Source§fn drop_table_and_data(&self, name: &str) -> StorageBackendResult<()>
fn drop_table_and_data(&self, name: &str) -> StorageBackendResult<()>
Remove a table definition and every catalog/data row owned by it as
one atomic catalog operation.
fn purge_table_data(&self, name: &str) -> StorageBackendResult<()>
fn rename_table_data(&self, from: &str, to: &str) -> StorageBackendResult<()>
fn drop_column_data( &self, table_name: &str, column_name: &str, ) -> StorageBackendResult<()>
fn rename_column_data( &self, table_name: &str, from: &str, to: &str, ) -> StorageBackendResult<()>
fn save_model(&self, name: &str, json: &str) -> StorageBackendResult<()>
fn load_models(&self) -> StorageBackendResult<Vec<(String, String)>>
fn load_model(&self, name: &str) -> StorageBackendResult<Option<String>>
fn drop_model(&self, name: &str) -> StorageBackendResult<()>
fn save_scoring_params( &self, name: &str, params_json: &str, ) -> StorageBackendResult<()>
fn load_scoring_params( &self, name: &str, ) -> StorageBackendResult<Option<String>>
fn load_all_scoring_params(&self) -> StorageBackendResult<Vec<(String, String)>>
fn drop_scoring_params(&self, name: &str) -> StorageBackendResult<()>
Source§fn create_sequence_row(
&self,
sequence: &SequenceRow,
) -> StorageBackendResult<bool>
fn create_sequence_row( &self, sequence: &SequenceRow, ) -> StorageBackendResult<bool>
Create a sequence’s definition and the value record of its definition generation, which starts at the value state of
sequence.Source§fn replace_sequence_row(
&self,
sequence: &SequenceRow,
) -> StorageBackendResult<bool>
fn replace_sequence_row( &self, sequence: &SequenceRow, ) -> StorageBackendResult<bool>
Replace a sequence’s definition, ownership and security. A row that keeps its object identity and definition generation leaves the generation’s value record, which only value operations move; a row with a new generation replaces the old generation’s value record with one that starts at the value state of
sequence.Source§fn rename_sequence_row(
&self,
from: &str,
to: &str,
) -> StorageBackendResult<bool>
fn rename_sequence_row( &self, from: &str, to: &str, ) -> StorageBackendResult<bool>
Atomically move one sequence catalog row and its shared relation claim while preserving object identity and the generation’s value record.
Source§fn drop_sequence_row(&self, name: &str) -> StorageBackendResult<bool>
fn drop_sequence_row(&self, name: &str) -> StorageBackendResult<bool>
Remove a sequence’s definition together with the value record of its generation.
Source§fn load_sequence_rows(&self) -> StorageBackendResult<Vec<SequenceRow>>
fn load_sequence_rows(&self) -> StorageBackendResult<Vec<SequenceRow>>
Sequence definitions, each with the value state of its generation’s value record.
Source§fn sequence_has_private_changes(
&self,
relation: &RelationIdentity,
_object_id: [u8; 16],
) -> StorageBackendResult<bool>
fn sequence_has_private_changes( &self, relation: &RelationIdentity, _object_id: [u8; 16], ) -> StorageBackendResult<bool>
Whether this sequence’s definition has transaction-private changes, including creation, rename, deletion and definition replacement, which the transaction’s own catalog reads must select.
Source§fn sequence_value_has_private_changes(
&self,
object_id: [u8; 16],
definition_generation: [u8; 16],
) -> StorageBackendResult<bool>
fn sequence_value_has_private_changes( &self, object_id: [u8; 16], definition_generation: [u8; 16], ) -> StorageBackendResult<bool>
Whether the value record of this definition generation has transaction-private changes, which holds exactly when the current transaction created the generation. Values of such a generation are allocated in the transaction, since no other session can see it; the value record of a committed generation is moved only outside any transaction, as
PostgreSQL moves a sequence’s state whatever happens to the transaction that drew from it.Source§fn migrate_sequence_values(&self) -> StorageBackendResult<()>
fn migrate_sequence_values(&self) -> StorageBackendResult<()>
Move the value state that earlier releases kept in sequence definitions into value records. Only an initial open runs this, inside its catalog preparation.
Source§fn reserve_sequence_values(
&self,
name: &str,
object_id: [u8; 16],
definition_generation: [u8; 16],
) -> StorageBackendResult<SequenceReservationResult>
fn reserve_sequence_values( &self, name: &str, object_id: [u8; 16], definition_generation: [u8; 16], ) -> StorageBackendResult<SequenceReservationResult>
Reserve the next block of values from the value record of this generation of
object_id, whatever name the sequence currently has. DefinitionChanged reports that another generation of the sequence has replaced this one, and Missing that the sequence no longer exists.Source§fn set_sequence_value(
&self,
name: &str,
object_id: [u8; 16],
definition_generation: [u8; 16],
value: i64,
called: bool,
log_count: i64,
) -> StorageBackendResult<SequenceSetValueResult>
fn set_sequence_value( &self, name: &str, object_id: [u8; 16], definition_generation: [u8; 16], value: i64, called: bool, log_count: i64, ) -> StorageBackendResult<SequenceSetValueResult>
Replace the value state in the value record of this generation of
object_id, with the results reserve_sequence_values reports.Source§fn log_sequence_values(
&self,
name: &str,
object_id: [u8; 16],
definition_generation: [u8; 16],
expected: (i64, bool),
logged: SequenceValuePosition,
) -> StorageBackendResult<SequenceLogResult>
fn log_sequence_values( &self, name: &str, object_id: [u8; 16], definition_generation: [u8; 16], expected: (i64, bool), logged: SequenceValuePosition, ) -> StorageBackendResult<SequenceLogResult>
Move the durable position in the value record of this generation of
object_id to logged when its value and called flag still are expected. Nothing is written otherwise, and Changed reports the position the record holds. A caller that hands out values at or below a logged value records that value here before it hands any of them out.fn save_view(&self, view: &ViewRow) -> StorageBackendResult<()>
Source§fn rename_view(
&self,
from: &RelationIdentity,
to: &RelationIdentity,
) -> StorageBackendResult<bool>
fn rename_view( &self, from: &RelationIdentity, to: &RelationIdentity, ) -> StorageBackendResult<bool>
Atomically move one view catalog row and its shared relation claim.
fn drop_view(&self, relation: &RelationIdentity) -> StorageBackendResult<bool>
fn load_views(&self) -> StorageBackendResult<Vec<ViewRow>>
fn save_named_graph(&self, name: &str) -> StorageBackendResult<()>
Source§fn guard_graph_definition(
&self,
graph: Option<&str>,
) -> StorageBackendResult<()>
fn guard_graph_definition( &self, graph: Option<&str>, ) -> StorageBackendResult<()>
Bind graph mutations to their definition and allocation generation while allowing independent data writers to share the definition. Concurrent backends and catalog wrappers must implement this capability.
Source§fn load_named_graph_snapshot(
&self,
name: &str,
) -> StorageBackendResult<Option<GraphSnapshot>>
fn load_named_graph_snapshot( &self, name: &str, ) -> StorageBackendResult<Option<GraphSnapshot>>
Explicit bulk snapshot/export of one named graph. The caller pins
the storage transaction. Engine startup, sessions, and query handles
use direct access methods instead of retaining this owned copy.
fn drop_named_graph(&self, name: &str) -> StorageBackendResult<()>
fn load_named_graphs(&self) -> StorageBackendResult<Vec<String>>
fn named_graph_exists(&self, name: &str) -> StorageBackendResult<bool>
fn save_vertex( &self, vertex_id: u64, label: &str, properties_json: &str, ) -> StorageBackendResult<()>
fn delete_vertex(&self, vertex_id: u64) -> StorageBackendResult<()>
fn load_vertices(&self) -> StorageBackendResult<Vec<(u64, String, String)>>
fn save_edge( &self, edge_id: u64, source_id: u64, target_id: u64, label: &str, properties_json: &str, ) -> StorageBackendResult<()>
fn delete_edge(&self, edge_id: u64) -> StorageBackendResult<()>
fn load_edges(&self) -> StorageBackendResult<Vec<EdgeRow>>
fn save_graph_membership( &self, entity_type: &str, entity_id: u64, graph_name: &str, ) -> StorageBackendResult<()>
fn delete_graph_membership( &self, entity_type: &str, entity_id: u64, graph_name: &str, ) -> StorageBackendResult<()>
fn delete_graph_membership_for_graph( &self, graph_name: &str, ) -> StorageBackendResult<()>
fn load_graph_memberships( &self, ) -> StorageBackendResult<Vec<(String, u64, String)>>
fn purge_orphan_graph_entities(&self) -> StorageBackendResult<()>
fn replace_named_graph( &self, graph_name: &str, snapshot: &GraphSnapshot, ) -> StorageBackendResult<()>
fn drop_named_graph_data(&self, graph_name: &str) -> StorageBackendResult<()>
fn save_analyzer( &self, name: &str, config_json: &str, ) -> StorageBackendResult<()>
fn drop_analyzer(&self, name: &str) -> StorageBackendResult<()>
fn load_analyzers(&self) -> StorageBackendResult<Vec<(String, String)>>
Source§fn save_analyzer_revision(
&self,
name: &str,
config_json: &str,
descriptor_json: &str,
) -> StorageBackendResult<()>
fn save_analyzer_revision( &self, name: &str, config_json: &str, descriptor_json: &str, ) -> StorageBackendResult<()>
Save a named definition’s resolved descriptor with its diagnostic configuration in the same transaction.
Source§fn load_analyzer_descriptors(
&self,
) -> StorageBackendResult<Vec<(String, String)>>
fn load_analyzer_descriptors( &self, ) -> StorageBackendResult<Vec<(String, String)>>
Resolved named descriptors; legacy definitions appear only in
load_analyzers until migrated.Source§fn replace_table_field_analyzer_binding(
&self,
table: &str,
field: &str,
phase: &str,
name: &str,
binding_json: &str,
) -> StorageBackendResult<()>
fn replace_table_field_analyzer_binding( &self, table: &str, field: &str, phase: &str, name: &str, binding_json: &str, ) -> StorageBackendResult<()>
Atomically replace a field’s complete independent binding and its compatibility label. An empty label denotes the physical field’s unnamed default.
Source§fn load_table_field_analyzer_bindings(
&self,
) -> StorageBackendResult<Vec<(String, String, String)>>
fn load_table_field_analyzer_bindings( &self, ) -> StorageBackendResult<Vec<(String, String, String)>>
(table, field, binding JSON) rows. Each field has one complete binding envelope.fn save_table_field_analyzer( &self, table_name: &str, field: &str, phase: &str, analyzer_name: &str, ) -> StorageBackendResult<()>
fn replace_table_field_analyzer( &self, table_name: &str, field: &str, phase: &str, analyzer_name: &str, ) -> StorageBackendResult<()>
fn drop_table_field_analyzer_field( &self, table_name: &str, field: &str, ) -> StorageBackendResult<()>
fn drop_table_field_analyzers( &self, table_name: &str, ) -> StorageBackendResult<()>
fn load_table_field_analyzers( &self, ) -> StorageBackendResult<Vec<(String, String, String, String)>>
fn save_foreign_server( &self, name: &str, fdw_type: &str, options_json: &str, ) -> StorageBackendResult<()>
fn drop_foreign_server(&self, name: &str) -> StorageBackendResult<()>
fn load_foreign_servers( &self, ) -> StorageBackendResult<Vec<(String, String, String)>>
Source§fn save_foreign_server_row(
&self,
row: &ForeignServerRow,
) -> StorageBackendResult<()>
fn save_foreign_server_row( &self, row: &ForeignServerRow, ) -> StorageBackendResult<()>
Atomically replace a complete foreign-server row. A catalog without metadata support must reject it instead of discarding the metadata.
Source§fn load_foreign_server_rows(
&self,
) -> StorageBackendResult<Vec<ForeignServerRow>>
fn load_foreign_server_rows( &self, ) -> StorageBackendResult<Vec<ForeignServerRow>>
Read definitions and their metadata from one catalog view. Legacy implementations expose absent metadata explicitly.
fn save_foreign_table(&self, row: &ForeignTableRow) -> StorageBackendResult<()>
Source§fn rename_foreign_table(
&self,
from: &RelationIdentity,
to: &RelationIdentity,
) -> StorageBackendResult<bool>
fn rename_foreign_table( &self, from: &RelationIdentity, to: &RelationIdentity, ) -> StorageBackendResult<bool>
Atomically move one foreign-table catalog row and its shared relation claim.
fn update_foreign_table_security( &self, relation: &RelationIdentity, security: &RelationSecurityRow, ) -> StorageBackendResult<bool>
fn drop_foreign_table( &self, relation: &RelationIdentity, ) -> StorageBackendResult<()>
fn load_foreign_tables(&self) -> StorageBackendResult<Vec<ForeignTableRow>>
fn save_catalog_index_row( &self, index: &CatalogIndexRow, ) -> StorageBackendResult<()>
fn drop_catalog_index( &self, relation: &RelationIdentity, ) -> StorageBackendResult<()>
fn drop_catalog_indexes_for_table( &self, table_name: &str, ) -> StorageBackendResult<()>
fn load_catalog_indexes(&self) -> StorageBackendResult<Vec<CatalogIndexRow>>
fn save_path_index( &self, graph_name: &str, label_sequences_json: &str, ) -> StorageBackendResult<()>
fn drop_path_index(&self, graph_name: &str) -> StorageBackendResult<()>
fn load_path_indexes(&self) -> StorageBackendResult<Vec<(String, String)>>
fn save_column_stats( &self, stats: ColumnStatsInput<'_>, ) -> StorageBackendResult<()>
Source§fn replace_column_stats(
&self,
table_name: &str,
stats: &[ColumnStatsInput<'_>],
) -> StorageBackendResult<()>
fn replace_column_stats( &self, table_name: &str, stats: &[ColumnStatsInput<'_>], ) -> StorageBackendResult<()>
Atomically replace the complete statistics snapshot for one table.
Implementations must leave the prior snapshot intact if any row fails.
fn load_column_stats( &self, table_name: &str, ) -> StorageBackendResult<Vec<ColumnStatsRow>>
fn delete_column_stats(&self, table_name: &str) -> StorageBackendResult<()>
Source§fn initialize_storage(&self) -> StorageBackendResult<()>
fn initialize_storage(&self) -> StorageBackendResult<()>
Prepare durable catalog storage inside the backend’s owning initial-restore transaction. Already initialized catalogs may keep the default.
Source§fn cache_revisions(&self) -> StorageBackendResult<Option<CatalogCacheRevisions>>
fn cache_revisions(&self) -> StorageBackendResult<Option<CatalogCacheRevisions>>
Read transactional cache generations without loading schemas or column
statistics. Providers without change tracking use conservative reloads.
Source§fn save_relation_acl(
&self,
relation: &RelationIdentity,
column: Option<&str>,
entry: &RelationAclTuple,
) -> StorageBackendResult<()>
fn save_relation_acl( &self, relation: &RelationIdentity, column: Option<&str>, entry: &RelationAclTuple, ) -> StorageBackendResult<()>
Replace one already bound relation or attribute ACL without rewriting its definition. The caller holds the relation lifetime and catalog tuple locks until transaction end.
fn fts_storage_was_reset(&self) -> bool
fn save_schema(&self, name: &str) -> StorageBackendResult<()>
fn load_schemas(&self) -> StorageBackendResult<Vec<String>>
Source§fn next_sequence_value(
&self,
name: &str,
object_id: [u8; 16],
) -> StorageBackendResult<Option<i64>>
fn next_sequence_value( &self, name: &str, object_id: [u8; 16], ) -> StorageBackendResult<Option<i64>>
Compatibility allocation API for callers that do not retain a session cache. A cached reservation’s unused values are intentionally abandoned, just as when a
PostgreSQL session disconnects.Source§fn for_each_graph_vertex_borrowed(
&self,
_ids: &[u64],
_visit: &mut dyn FnMut(u64, Option<&GraphVertexRow>) -> bool,
) -> StorageBackendResult<Option<usize>>
fn for_each_graph_vertex_borrowed( &self, _ids: &[u64], _visit: &mut dyn FnMut(u64, Option<&GraphVertexRow>) -> bool, ) -> StorageBackendResult<Option<usize>>
Visit requested vertices on the pinned view, including missing rows and
duplicates in caller order. The internal callback must not reenter
storage. A false result stops before the next identity is admitted.
None declines the capability without invoking the callback; Some
counts all invocations, including the one that stopped the read.fn save_catalog_index( &self, relation: &RelationIdentity, index_type: &str, table_name: &str, columns_json: &str, parameters_json: &str, ) -> StorageBackendResult<()>
Auto Trait Implementations§
impl !RefUnwindSafe for KeyValueCatalog
impl !UnwindSafe for KeyValueCatalog
impl Freeze for KeyValueCatalog
impl Send for KeyValueCatalog
impl Sync for KeyValueCatalog
impl Unpin for KeyValueCatalog
impl UnsafeUnpin for KeyValueCatalog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more