zod-dbs-sqlite
v1.0.2
Published
SQLite provider for zod-dbs
Downloads
12
Maintainers
Readme
zod-dbs-sqlite
SQLite provider for zod-dbs.
Installation
npm install zod-dbs-sqliteNote: This package has a peer dependency on
better-sqlite3. If you don't already have it, you might need to install it (depending on your environment, package manager, etc):
npm install better-sqlite3Cli Usage
npm install zod-dbs-cli zod-dbs-sqlite better-sqlite3
npx zod-dbs --provider sqliteProvider Specific CLI Options
| Option | Description | Required |
| ------------------- | ---------------------------------------------------------- | -------- |
| --database <path> | Path to SQLite database file (or :memory: for in-memory) | true |
Programmatic Usage
npm install zod-dbs zod-dbs-sqlite better-sqlite3import { generateZodSchemas } from 'zod-dbs';
import { createProvider } from 'zod-dbs-sqlite';
const provider = createProvider();
await generateZodSchemas({
provider,
config: {
// See zod-dbs documentation for available options
// Example (SQLite):
// database: 'path/to/db.sqlite',
// outputDir: './zod-schemas',
},
});