Skip to main content

Crate valence_backend_sql

Crate valence_backend_sql 

Source
Expand description

Shared SQL document storage helpers for Valence SQL backends.

Structs§

WriteEnsureCache
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_at for platform TTL sweep discovery.
apply_ttl_policy_sqlite
Idempotent non-unique index on __valence_expire_at for 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 patch into base.
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 SQL SELECT 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).