Quickstart
This page is the smallest generic setup path for trying CrateStack in a Rust service.1. Include A Schema
Example schema:db = Postgres is the argument for a schema with a real datasource { provider = "postgresql" } block. A schema declaring datasource { provider = "none" } instead pairs with db = None — see Procedures-only servers below. The two must agree: passing db = Postgres against a provider = "none" schema (or vice versa) is a compile-time macro error, not a runtime one.
Embedded (mobile / desktop / browser-via-OPFS) and HTTP-client crates use different macros — see Offline-First Embedded SQLite and the client-runtime docs respectively.
2. Build The Generated Runtime
3. Use Delegates Directly
You can use CrateStack without mounting the generated REST layer.4. Optionally Bind Auth For Internal Callers
5. Optionally Mount Generated Routers
() in second position is the computed-field resolver. A schema with no
@computed fields needs no resolver at all, and the macro generates
impl ComputedFieldResolver for () so the unit type satisfies the bound. Replace it
with your own resolver once you declare a computed field — see
Computed Fields.
Procedures-only servers (no database)
Not every server owns a database — see Procedures-Only Servers with No Database fordatasource { provider = "none" }, db = None, and the cratestack-api facade.
Read Next
../guides/auth-providerfor the host auth boundary../architecture/transport-architecturefor codec, framing, and envelope rules../overview/banking-readinessfor the regulated-workload primitives../guides/offline-first-sqliteif you want to run the same schema embedded against a local SQLite database — same.cstackfile, sync API on native, OPFS-backed in the browser, no tokio../guides/no-database-proceduresfor procedures-only servers with no database at all