Skip to main content

Crate oxgraph_postgres

Crate oxgraph_postgres 

Source
Expand description

Postgres-backed [OxGraph] engine library.

Owns catalog modeling, relational build into OXGTOPO snapshots, artifact I/O, active engine state, overlays, sync replay, and query algorithms. SPI, triggers, and SQL facades live in oxgraph-pgrx.

Structs§

BuildEstimate
Estimated build sizes for registration UIs.
Catalog
In-memory catalog of registered tables, edges, and filter columns.
Config
Library-side operational configuration (GUC values are registered in oxgraph-pgrx).
CscNodeId
Dense node id in an inbound CSC view.
CscSnapshotGraph
Borrowed inbound adjacency (transpose-CSR / CSC layout).
DualTopologySnapshot
Forward CSR plus inbound CSC snapshot bytes with Postgres metadata.
EdgeId
Stable identifier for a registered edge mapping.
EdgeRow
One edge endpoint pair supplied by a caller scanning source tables.
Engine
Active [OxGraph] backend state loaded from OXGTOPO bytes.
EngineBuilder
Configures and builds a loaded Engine from OXGTOPO bytes.
EngineStatus
Runtime status returned by admin/discovery surfaces.
EngineStatusReport
Engine status JSON payload for admin surfaces.
FilterColumn
Column used for filter/search indexing at query time.
ForwardCsr
Outgoing adjacency — foundation CSR topology sections only.
GraphTopology
Both topology views borrowing the same snapshot backing.
InboundCsc
Incoming adjacency — Postgres inbound CSC sections only.
NodeKey
External node key supplied by a registered table row.
OverlayEdge
Edge insertion applied on top of the frozen artifact.
OverlayState
Mutable overlay state for sync replay and query freshness.
PostgresMetadata
Fixed-layout Postgres metadata stored in snapshot section payloads.
RegisteredEdge
Registered directed edge between two node tables.
RegisteredTable
Registered node table metadata.
SnapshotRebuild
Orchestrates relational snapshot rebuild from registration metadata and edge rows.
SyncHealth
Returns a coarse health summary for sync surfaces.
SyncHealthReport
Sync health JSON payload.
SyncRow
One sync log row with monotonic sequence metadata.
TableId
Stable identifier for a registered source table.
TraverseLimits
Limits for a single traverse query (result cap and optional hop bound).

Enums§

BuildError
Relational build or snapshot export failures.
CatalogError
Catalog validation failures.
ConfigError
Operational configuration failures.
CscSnapshotError
Errors while opening inbound CSC sections from a snapshot.
GraphRole
Role required for graph operations.
PostgresGraphError
Errors returned by the Postgres graph engine library.
PostgresSectionError
Errors while reading Postgres-owned snapshot sections.
QueryError
Query input or limit failures.
QueryFreshness
Freshness policy when overlays and sync rows are present.
SearchPredicate
Search predicate over dense node ids (extension hydrates external columns).
SyncAction
One durable sync row interpreted by the library.
SyncActionCodec
Persisted sync-log action type ids shared with trigger SQL.
SyncActionWire
Persisted sync-log action before dense-node resolution.
SyncError
Sync replay ordering failures.
TraversalDirection
Traversal direction matching pgGraph direction semantics.

Constants§

SNAPSHOT_KIND_PG_CATALOG
Section kind for serialized catalog blobs owned by Postgres.
SNAPSHOT_KIND_PG_INBOUND_OFFSETS_U32
Postgres-owned inbound offsets section (0x0201).
SNAPSHOT_KIND_PG_INBOUND_TARGETS_U32
Postgres-owned inbound targets section (0x0202).
SNAPSHOT_KIND_PG_METADATA
Section kind for Postgres engine metadata (0x0200 reserved range).

Functions§

attach_metadata
Appends or replaces the Postgres metadata section on CSR topology bytes.
attach_postgres_sections
Appends or replaces Postgres-owned sections on CSR topology bytes.
dense_node_map_for_sync_resolution
Builds the dense node assignment used when replaying sync rows.
dense_node_map_from_edges
Builds the dense node-id assignment used by DualTopologySnapshot::from_edge_rows.
edge_id_from_i32
Parses a registered edge id from SPI/catalog storage.
edge_row_from_scan
Maps scanned SQL primary-key values to an EdgeRow for one registered edge mapping.
estimate_build
Estimates node and edge counts for a build without exporting a snapshot.
load_snapshot_bytes
Validates and borrows snapshot bytes without copying the payload region.
read_metadata
Reads Postgres-owned metadata from a validated snapshot.
resolve_sync_action
Resolves one wire sync action into dense engine coordinates.
resolve_sync_rows
Resolves persisted sync rows using the current relational edge scan.
table_id_from_i32
Parses a registered table id from SPI/catalog storage.
validate_primary_key
Validates a SQL primary-key value for NodeKey::registered.
validate_snapshot_bytes
Returns owned snapshot bytes unchanged after validation.
validate_sql_ident
Returns whether ident is safe for double-quoted SQL identifiers.
write_snapshot_bytes
Writes validated snapshot bytes suitable for BYTEA/LO persistence.

Type Aliases§

RawSyncRow
Raw sync-log row scanned from SPI before dense resolution.