Skip to main content

Built and signed on GitHub Actions

Generate Model types from Knex

This package works with Node.jsIt is unknown whether this package works with Cloudflare Workers, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
70%
Published
6 months ago (0.0.5)
Package root>readme.md
# @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)