@rippledb/cli
v0.1.1
Published
CLI tools for RippleDB - schema codegen and utilities
Maintainers
Readme
@rippledb/cli
CLI tools for RippleDB - schema codegen and utilities.
👉 Config files are validated at runtime using a tiny valibot schema, so
typos/missing keys fail fast before generation runs.
Installation
pnpm add -D @rippledb/cliUsage
Generate RippleDB schema from Drizzle
- Create a config file
ripple.config.ts:
import { defineConfig } from "@rippledb/cli/config";
export default defineConfig({
codegen: {
drizzle: {
entities: "./src/db/ripple-entities.ts",
output: "./src/shared/schema.ts",
},
},
});- Create an entities file that exports the Drizzle tables you want in RippleDB:
// src/db/ripple-entities.ts
export { todos, users } from "./schema";- Run the codegen:
npx rippledb generateThis will generate a RippleDB schema file at the specified output path.
Configuration
codegen.drizzle
| Option | Type | Description |
| ---------- | -------- | ------------------------------------- |
| entities | string | Path to file exporting Drizzle tables |
| output | string | Output path for generated schema |
Generated Output
The generated file will look like:
// AUTO-GENERATED by @rippledb/cli - DO NOT EDIT
import { defineSchema, type InferSchema, s } from "@rippledb/core";
export const schema = defineSchema({
todos: {
id: s.string(),
title: s.string(),
done: s.boolean(),
},
users: {
id: s.string(),
name: s.string(),
email: s.string(),
},
});
export type Schema = InferSchema<typeof schema>;