Expand description
Shared SQL document storage helpers for Valence SQL backends.
Structs§
- Write
Ensure Cache - Per-backend cache of tables/fields already ensured for writes.
Constants§
- EDGES_
TABLE - Edge junction table shared by SQL backends.
- ID_
COLUMN - Primary key column name.
Functions§
- apply_
ttl_ policy_ postgres - Idempotent non-unique index on
__valence_expire_atfor platform TTL sweep discovery. - apply_
ttl_ policy_ sqlite - Idempotent non-unique index on
__valence_expire_atfor platform TTL sweep discovery. - assert_
safe_ table - create_
record_ postgres - create_
record_ sqlite - decode_
select_ rows - Parse SELECT results from generic JSON rows returned by driver layer.
- define_
unique_ index_ postgres - define_
unique_ index_ sqlite - delete_
record_ postgres - delete_
record_ sqlite - ensure_
edges_ postgres - ensure_
edges_ sqlite - ensure_
edges_ table - ensure_
table - Ensure a table exists (caller runs DDL via sqlx).
- ensure_
table_ postgres - ensure_
table_ sqlite - ensure_
typed_ table_ postgres - Ensure typed table exists (Postgres).
- ensure_
typed_ table_ sqlite - Ensure typed table exists (SQLite).
- execute_
select_ postgres - execute_
select_ sqlite - extract_
ids - Extract id strings from SELECT id queries.
- first_
count - Extract count from first row.
- get_
edge_ sources_ postgres - get_
edge_ sources_ sqlite - get_
edge_ targets - get_
edge_ targets_ postgres - get_
edge_ targets_ sqlite - get_
record_ postgres - get_
record_ sqlite - inspect_
typed_ layout_ postgres - Inspect live Postgres columns.
- inspect_
typed_ layout_ sqlite - Inspect live SQLite columns →
valence_core::storage_layout::StorageLayout(storage kinds inferred coarsely). - json_
merge - Shallow merge
patchintobase. - merge_
record_ postgres - merge_
record_ sqlite - prepare_
compiled - Normalize compiled query for SQLite execution (
?placeholders). - prepare_
compiled_ postgres - Normalize compiled query for Postgres execution (
$1,$2, … placeholders). - read_
schema_ version_ postgres - Read stamped schema version for
table(Postgres). - read_
schema_ version_ sqlite - Read stamped schema version for
table(SQLite). - relate_
edge - relate_
edge_ postgres - relate_
edge_ sqlite - rewrite_
value_ id_ unique_ probe_ for_ document_ sql - Rewrite Surreal-shaped
SELECT VALUE id FROM …probes to plain SQLSELECT id. - row_
from_ body - Build a JSON row object from flat fields + id (Valence wire shape).
- row_
to_ json - Decode a SQL row
(id, body)into Valence JSON record shape. - sql_
capabilities - storage_
id - sync_
typed_ table_ postgres - Additive sync for Postgres (includes safe nullability/default tweaks).
- sync_
typed_ table_ sqlite - Additive sync for SQLite.
- ttl_
deferred - unrelate_
edge - unrelate_
edge_ postgres - unrelate_
edge_ sqlite - update_
record_ postgres - update_
record_ sqlite - upsert_
body_ fields - Merge content fields into a map for insert/update.
- write_
schema_ version_ postgres - Upsert stamped schema version (Postgres).
- write_
schema_ version_ sqlite - Upsert stamped schema version (SQLite).