@barelyhuman/knex-types@0.0.5Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
barelyhuman/knex-typesGenerate Model types from Knex
This package works with Node.jsIt is unknown whether this package works with Cloudflare Workers, Deno, Bun, Browsers
JSR Score
70%
Published
6 months ago (0.0.5)
# @barelyhuman/knex-types > Generate Model types from Knex - [@barelyhuman/knex-types](#barelyhumanknex-types) - [Schema Support](#schema-support) - [Usage](#usage) - [License](#license) ## Schema Support While the below checklist mentions **Partial**, most of what the library can generate should be usable. It says partial because things like `enum` and other constraints that can be used to generate better types and models for knex are still not done. - [x] Sqlite - [ ] Postgres (Partial) - [ ] MSSQL (Partial) - [ ] Oracle (Partial) ## Usage ```js // in CJS import { generateTypes } from "@barelyhuman/knex-types"; const knexInstance = knex(config); generateTypes(knexInstance, { output: "./types.d.ts", }).then((d) => { // Done }); ``` ```js // in ESM import { generateTypes } from "@barelyhuman/knex-types"; const knexInstance = knex(config); await generateTypes(knexInstance, { output: "./types.d.ts", }); ``` ## License [MIT](/LICENSE)