Repository navigation
somnia v0.5.2
Completes the P1 roadmap tier. Every change is API-additive (new builders,
methods, a defaulted trait method, and new SurrealQL impls), so this stays a
patch release; the only behavioral shift is that collection fields now emit a
more precise array<…> type in generated DDL.
Added (0.5.2)
- Recursive graph paths — the
Pathnode gainedrecurse_all()(@.{..}),
recurse_up_to(n)(@.{..n}),recurse_range(min, max)(@.{min..max}), and
recurse_exact(n)(@.{n}), rendering SurrealDB's recursive traversal syntax
(relative@.{…}or, withfrom_record, record-anchored). Validated against a
live in-memory engine. DEFINE INDEX— a runtimeDefineIndexbuilder (plain, composite,
unique(),search(analyzer),hnsw/mtreevector,comment,
concurrently,overwrite, andDefineIndex::remove) plus a repeatable derive
attribute#[index(name = "…", fields = "a, b", unique)]. Derived indexes flow
into the newSurrealSchema::define_indexes()and are emitted byup()after
the field definitions. A live test confirms aUNIQUEindex rejects duplicates.- Richer field types — the derive maps Rust types via real recursive
syn::Typeanalysis instead of substring matching: typed arrays
(Vec<T>/VecDeque/HashSet/slices →array<…>), arrays of records, nested
Option,duration, anddecimal. AddsSurrealQLliteral impls for
Vec<T>(renders[…]) andstd::time::Duration(renders e.g.1s500000000ns).
Changed (0.5.2)
SurrealSchemagained a defaulteddefine_indexes()method; existing manual
implementations are unaffected.- The derive emits a precise
array<…>element type for collection fields
(previously a barearray). Generated DDL only; no Rust API change.