@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
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.
- Sqlite
- Postgres (Partial)
- MSSQL (Partial)
- Oracle (Partial)
Usage
// in CJS import { generateTypes } from "@barelyhuman/knex-types"; const knexInstance = knex(config); generateTypes(knexInstance, { output: "./types.d.ts", }).then((d) => { // Done });
// in ESM import { generateTypes } from "@barelyhuman/knex-types"; const knexInstance = knex(config); await generateTypes(knexInstance, { output: "./types.d.ts", });
License
Built and signed on
View transparency logGitHub Actions
Add Package
deno add jsr:@barelyhuman/knex-types
Import symbol
import * as mod from "@barelyhuman/knex-types";
---- OR ----
Import directly with a jsr specifier
import * as mod from "jsr:@barelyhuman/knex-types";
Add Package
npx jsr add @barelyhuman/knex-types
Import symbol
import * as mod from "@barelyhuman/knex-types";
Add Package
yarn dlx jsr add @barelyhuman/knex-types
Import symbol
import * as mod from "@barelyhuman/knex-types";
Add Package
pnpm dlx jsr add @barelyhuman/knex-types
Import symbol
import * as mod from "@barelyhuman/knex-types";
Add Package
bunx jsr add @barelyhuman/knex-types
Import symbol
import * as mod from "@barelyhuman/knex-types";