0.0.5 • Published 2 months ago

@barelyhuman/knex-types v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@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

MIT

0.0.5

2 months ago

0.0.4

2 months ago

0.0.3

2 months ago

0.0.2

2 months ago

0.0.1

2 months ago