Expand description
Logical data operations shared by apps and primary-backend implementations. App code supplies validated entity and field names; an adapter owns physical queries, connections, migrations, and durable transaction semantics.
Structs§
- Active
Session - An unrevoked browser session resolved against the caller’s clock.
- Aggregate
Query - One aggregate against an entity and optional filter.
- AppSchema
- The app-owned logical schema that every configured backend must implement.
- Claim
- Atomically selects one matching record and applies its lease or status fields. The adapter returns the selected numeric identity after the update commits.
- Entity
- One logical entity with declared uniqueness and lookup requirements.
- Field
- One logical field, independent of a SQL column or document representation.
- Index
- Indexes may be unique and conditional without embedding vendor SQL.
- Joined
Query - One bounded, backend-neutral join of two declared entities.
- Joined
Record - One join result retains the two entity namespaces to avoid field collisions.
- Managed
Business - One business visible through an active tenant membership.
- Migration
- One ordered migration whose checksum must match the committed ledger entry.
- Query
- A logical read; explicit fields and a bounded page prevent accidental scans.
- Query
Result Budget - Bounds one returned page without creating a second serialized copy of its records.
- Record
- One record in a bounded export page or import batch.
- Related
Rows Query - Declares one bounded relationship read independently of its configured adapter.
- Reservation
Expiry - Expiry transition applied before reservation capacity is measured.
- Session
Expiry - Validated UTC expiry used by each backend’s native session representation.
- Snapshot
Collector - Shared keyset pagination and accounting. Adapters must keep every page in the same database read transaction; separate calls to query are insufficient.
- Snapshot
Limits - Explicit resource bounds for a consistent operator snapshot.
- SortKey
- One sort key for a bounded read; ascending puts nulls first and descending last. Include a unique identity key to make equal-value paging deterministic.
- Transaction
- A transaction must commit every step or none, including guard decisions.
- Transaction
Result - Per-step affected row counts and numeric identities of inserted or ensured records.
- User
Credentials - Credentials and account status for shared password verification.
Enums§
- Aggregate
- Aggregates required by declared summaries and guarded writes.
- Database
Error - Stable failure categories; an unavailable backend never appears as empty data.
- Field
Constraint - Portable field checks retained when app SQL migrations become declarative.
- Field
Default - A portable schema default, including database-generated current time.
- Field
Type - Declared field types. Decimal values use an exact, two-place decimal string.
- Identity
- A generated numeric key or a declared compound primary key.
- Index
Key - A physical index key derived from a declared field.
- Mutation
- A mutation evaluated as one part of a durable transaction.
- OnDelete
- Referential action applied when a referenced record is deleted.
- Predicate
- A bounded, parameterized predicate over declared fields.
- Schema
Change - Additive schema changes with a backend-independent migration identity.
- Write
Value - A write value can refer to an earlier inserted or ensured record.
Constants§
- MAX_
TEXT_ LENGTH - Maximum declared text length; stored values also obey the one-MiB byte bound.
- MAX_
TRANSACTION_ STEPS - Maximum atomic write steps, independently bounded by the eight-MiB payload limit.
Traits§
- Database
Operations - Executable logical operations implemented by every registered adapter. App-facing services resolve this operation contract through the configured registry.
Functions§
- aggregate_
result_ kind - Identifies the logical type of an aggregate result for exact decoding.
- binary_
bytes - Decodes a logical byte array without interpreting ordinary JSON arrays as binary.
- bytes_
fingerprint - Computes a lowercase SHA-256 fingerprint without retaining source bytes.
- canonical_
json 🔒 - Writes JSON with recursively sorted object keys so migration and replay hashes cannot depend on map insertion order or Serde feature unification.
- canonical_
json_ value - Canonicalizes bounded JSON values so equivalent integral numeric representations and object-key order do not acquire backend-specific equality semantics. Arrays retain their order, and strings never undergo numeric coercion.
- canonical_
stored_ timestamp - Decodes persisted UTC timestamp text without losing fractional seconds. RFC 3339 represents logical timestamps; native UTC date-time storage may omit its zone. Adapters normalize that physical representation at adoption.
- canonical_
timestamp_ boundary - Encodes a whole-second comparison boundary using the canonical storage representation.
- decimal_
cents - Parses a bounded two-place decimal without floating-point arithmetic. JSON numbers are accepted at the input boundary; storage and reads use canonical strings so adapters cannot silently round monetary values.
- decimal_
from_ cents - Encodes scaled integer storage as the public exact decimal representation.
- decode_
aggregate_ text - Decodes a relational aggregate without guessing a text field’s logical type.
- entity
- Finds a declared entity without accepting a physical table name from a request.
- field_
value_ 🔒type_ matches - generated_
index_ name - Derives one portable physical index name from a declared logical key.
- guard_
read_ set - Guards a bounded read set while preserving transaction capacity for its writes. Complete identities permit grouped checks; projections without identities use single-row checks.
- identity_
page - Converts a primary-key cursor to a lexicographic page filter and ordering. Composite cursors carry every key field in one JSON object.
- materialize_
generated_ predicate - Replaces transaction-local identity references with identities produced by earlier steps.
- normalize_
stored_ record - Returns canonical typed values from an already-loaded projection without I/O.
- numeric_
constraint_ 🔒value - Converts a typed numeric constraint operand to its exact comparison unit.
- operation_
fingerprint - Computes a stable SHA-256 fingerprint for a serialized logical operation.
- query_
related_ rows - Reads a bounded relationship set using the contract’s operand and result limits. Duplicate keys are removed before paging; no vendor query escapes the operation interface.
- replace_
resource_ 🔒marker - Replaces only declared resource keys within bounded JSON nesting.
- reservation_
expiry_ filter - Combines reservation scope and expiry eligibility identically for every adapter.
- resolve_
field_ write - Resolves transaction-local expressions and validates the resulting field value before a physical adapter binds it. Template admission alone cannot certify the size or constraints of the generated result.
- resolve_
write_ value - Resolves generated references uniformly before any adapter binds parameters. JSON replacement matches the full declared resource marker, never substrings.
- stored_
session_ expiry_ epoch - Returns the first whole second at which an exact stored session expiry has passed.
- valid_
app_ 🔒identifier - Keeps app declarations separate from adapter metadata and derived storage keys.
- valid_
identifier - Accepts a name only if it is a bounded, portable identifier.
- valid_
tenant_ role - Accepts a bounded tenant role identifier without interpreting its authority.
- validate_
claim - Validates a bounded claim and its deterministic selection order.
- validate_
copy_ field - Validates a historical field copy before any backend updates existing records.
- validate_
field_ value - Checks a logical value before any adapter can map it to a driver parameter.
- validate_
generated_ 🔒predicate_ steps - Rejects an identity reference unless an earlier transaction step produces it.
- validate_
json_ value - Validates JSON depth, node count and encoded size without copying the value tree.
- validate_
managed_ business_ read - Bounds one managed-business read before any adapter executes a query.
- validate_
password_ hash_ update - Bounds a pre-hashed credential update before an adapter opens a connection.
- validate_
predicate - Validates a nested predicate against one declared entity and a fixed depth bound.
- validate_
query - Validates one bounded query before lowering it to a backend operation.
- validate_
rate_ limit_ event - Enforces audit row bounds without interpreting user input as query syntax.
- validate_
rate_ limit_ request - Enforces the same bounded security keys before any adapter touches storage.
- validate_
schema - Validates the logical schema before an adapter can execute it.
- validate_
session_ issue - Validates session input and preserves the exact expiry instant.
- validate_
session_ lookup - Reject malformed or unbounded session lookups before reaching a backend.
- validate_
stored_ record - Validates a projected stored record against the same typed contract as writes. Malformed persisted values indicate storage corruption, not invalid user input. This operates on already-loaded rows and performs no additional database reads.
- validate_
transaction - Validates a write transaction without exposing a backend statement surface.
- validate_
username_ lookup - validate_
value 🔒