Installation¶
Library¶
Add surql as a dependency:
Or, in Cargo.toml:
Feature flags¶
Short overview; the full matrix and recipes live on the Feature flags page.
| Feature | Default | What it adds |
|---|---|---|
client | yes | Async SurrealDB client (tokio, surrealdb 3.x) with native-tls. |
client-rustls | no | Same client surface but with pure-Rust TLS (no openssl-sys). |
client-grpc | no | The gRPC transport (grpc://, grpcs://, SurrealDB 3.3+), on top of client-rustls. |
cli | no | surql binary (implies client, orchestration, settings). |
cache | no | In-process MemoryCache backend + CacheManager. |
cache-redis | no | Redis backend for the cache manager (implies cache). |
settings | no | Layered Settings / SettingsBuilder. |
orchestration | no | Multi-database deployment strategies + environment registry. |
watcher | no | Filesystem watcher for schema / migration files. |
[dependencies]
# library-only, no client
oneiriq-surql = { version = "0.2", default-features = false }
# binary + client
oneiriq-surql = { version = "0.2", features = ["cli"] }
# async client, pure-Rust TLS (no libssl-dev on the build host)
oneiriq-surql = { version = "0.2", default-features = false, features = ["client-rustls"] }
CLI¶
Subcommand reference: CLI.
Requirements¶
- Rust 1.95 or newer.
- For the
clientfeature: SurrealDB 3.0 or newer, plus a system TLS stack (libssl-devon Linux,Security.frameworkon macOS). - For the
client-rustlsfeature: SurrealDB 3.0 or newer. No system TLS stack required. - Server versions: the crate is built and tested against SurrealDB 3.3, and a 3.0 server works with two exceptions. Values nested more than 16 levels deep need 3.1 (
encoding::json::decode). The 3.3 additions need 3.3:LIGHTWEIGHTrelations,INLINEcaches and fields, the accessAUDIENCEandCONTEXTclauses,SELECT ... FOR UPDATE, thesegmenttokenizer and the gRPC transport.
What's next¶
- Quick Start -- your first schema and migration.
- Schema Definition -- the full schema DSL reference.
- Feature flags -- picking the right profile.