🚀 Socket Launch Week 🚀 Day 5: Introducing Socket Fix.Learn More
Socket
Sign inDemoInstall
Socket

knex-types-generator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knex-types-generator

Generates TypeScript definitions (types) from a (PostgreSQL) database schema.

0.3.4
latest
Source
npm
Version published
Weekly downloads
3
-72.73%
Maintainers
1
Weekly downloads
 
Created
Source

Knex.js types generator

NPM Version NPM Downloads TypeScript Donate Discord

An utility module for Knex.js that generates TypeScript definitions (types) from a PostgreSQL database schema.

$ npm install knex
$ npm install knex-types --dev

Usage Example

const { knex } = require("knex");
const { updateTypes } = require("knex-types");

const db = knex(require("./knexfile"));

updateTypes(db, { output: "src/types/knex.d.ts" }).catch((err) => {
  console.error(err);
  process.exit(1);
});

Find an example of generated types in ./main.test.ts.

License

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.

Keywords

database

FAQs

Package last updated on 02 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts