Coming soon. This is not available yet. The page is a sketch, here for review.
Rindle directly supports the Zero sync framework. Your schemas, queries, mutators and
useQuery components stay the same. The only thing that changes is performance – Rindle is much faster.
Architecture
With Zero, the browser talks to zero-cache, which calls your server and follows Postgres. With Rindle, the browser talks to your server, and your server talks to Rindle, the same shape as Architecture. Postgres is optional.
Client
Change one import. cacheURL points at your server instead of zero-cache.
-import { Zero } from "@rocicorp/zero";
+import { Zero } from "@rindle/zero";
const zero = new Zero({ schema, mutators, cacheURL: "/api/zero", auth, userID });React components keep useQuery from @rindle/zero/react.
Server
Your /query and /mutate endpoints keep their auth, their routes, and the bodies of every query
and mutator. Only the glue changes:
-import { handleMutateRequest, handleQueryRequest } from "@rocicorp/zero/server";
+import { createZeroApiServer } from "@rindle/zero/server";
+
+const api = createZeroApiServer({ schema, queries, mutators }); // reads RINDLE_URL
export async function POST(request: Request) {
const user = await getUser(request); // your auth
- return handleQueryRequest(/* … */);
+ return api.handleQuery(request, { user });
}Your data
- Rindle is the database. Run
rindle upand write migrations in SQL. Mutators write to Rindle. - Postgres stays the database. Mutators keep writing to Postgres through your existing connection (drizzle, kysely, prisma, postgres.js). Rindle follows it with logical replication.