@kauza/knex-types
v4.0.1
Published
Generates TypeScript definitions (types) from a (PostgreSQL) database schema.
Downloads
177
Readme
Knex.js types generator
An utility module for Knex.js that generates TypeScript definitions (types) from a PostgreSQL database schema.
$ npm install knex
$ npm install knex-types --devUsage Example
const { knex } = require("knex");
const { updateTypes } = require("knex-types");
const db = knex(require("./knexfile"));
updateTypes(db, { output: "./types.ts" }).catch((err) => {
console.error(err);
process.exit(1);
});Find an example of generated types in ./main.test.ts.
Publishing
npm login # you need access to our kauza npm account
npm version <major|minor|patch>
npm publishLicense
Copyright © 2021-present Kriasoft. This source code is licensed under the MIT license found in the LICENSE file.
Made with ♥ by Konstantin Tarkus (@koistya, blog) and contributors.
