Expand description
PostgreSQL storage backend for JACS documents.
This crate provides PostgresStorage, a PostgreSQL-backed implementation of
JACS storage traits:
StorageDocumentTraits– basic document CRUDDatabaseDocumentTraits– database-specific query capabilitiesSearchProvider– fulltext search via PostgreSQL tsvector
§Dual-Column Strategy
Uses TEXT + JSONB dual-column storage:
raw_contents(TEXT): Preserves exact JSON bytes for signature verificationfile_contents(JSONB): Enables efficient queries and indexing
§Append-Only Model with Soft Delete
Documents are immutable once stored. New versions create new rows
keyed by (jacs_id, jacs_version). The only UPDATE operation is
soft-delete via remove_document, which sets tombstoned = true
rather than physically deleting rows.
§Usage
ⓘ
use jacs_postgresql::PostgresStorage;
use jacs::storage::StorageDocumentTraits;
use jacs::storage::DatabaseDocumentTraits;
let storage = PostgresStorage::new(&database_url, None, None, None)?;
storage.run_migrations()?;Structs§
- Postgres
Storage - PostgreSQL storage backend for JACS documents.