- Notifications
You must be signed in to change notification settings - Fork23
Generate TypeScript definitions (types) from a PostgreSQL database schema.
License
NotificationsYou must be signed in to change notification settings
kriasoft/knex-types
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
An utility module forKnex.js that generates TypeScriptdefinitions (types) from a PostgreSQL database schema.
$ npm install knex$ npm install knex-types --dev
const{ knex}=require("knex");const{ updateTypes}=require("knex-types");constdb=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
.
- GraphQL API Starter Kit — monorepo template, pre-configured with TypeScript, GraphQL.js, React, and Relay
- Node.js API Starter Kit — Node.js project template (PostgreSQL, Knex, OAuth 2.0, emails, Cloud Functions)
Please create aPR or send me a message onDiscord.
Copyright © 2021-present Kriasoft. This source code is licensed under the MIT license found in theLICENSE file.
Made with ♥ by Konstantin Tarkus (@koistya,blog)andcontributors.
About
Generate TypeScript definitions (types) from a PostgreSQL database schema.