{"id":15019677,"url":"https://github.com/kriasoft/knex-types","last_synced_at":"2025-04-07T07:08:10.837Z","repository":{"id":40544166,"uuid":"357881092","full_name":"kriasoft/knex-types","owner":"kriasoft","description":"Generate TypeScript definitions (types) from a PostgreSQL database schema.","archived":false,"fork":false,"pushed_at":"2024-08-16T07:29:47.000Z","size":3858,"stargazers_count":65,"open_issues_count":16,"forks_count":21,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-30T00:55:25.397Z","etag":null,"topics":["database","database-schema","definitions","graphql","javascript","knex","knexjs","nodejs","pg","postgres","postgresql","schema","strongly-typed","types","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kriasoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"koistya"}},"created_at":"2021-04-14T11:30:01.000Z","updated_at":"2024-10-17T11:09:07.000Z","dependencies_parsed_at":"2024-11-06T08:35:15.127Z","dependency_job_id":"20eb48b8-e147-4c69-abee-bb68b8005634","html_url":"https://github.com/kriasoft/knex-types","commit_stats":{"total_commits":22,"total_committers":6,"mean_commits":"3.6666666666666665","dds":0.6363636363636364,"last_synced_commit":"73a46301b7f1ef22c275e87e7815e6d7a7488cda"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Fknex-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Fknex-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Fknex-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Fknex-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kriasoft","download_url":"https://codeload.github.com/kriasoft/knex-types/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601598,"owners_count":20964890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","database-schema","definitions","graphql","javascript","knex","knexjs","nodejs","pg","postgres","postgresql","schema","strongly-typed","types","typescript"],"created_at":"2024-09-24T19:53:52.880Z","updated_at":"2025-04-07T07:08:10.818Z","avatar_url":"https://github.com/kriasoft.png","language":"TypeScript","funding_links":["https://patreon.com/koistya","https://img.shields.io/badge/dynamic/json?color=%23ff424d\u0026label=Patreon\u0026style=flat-square\u0026query=data.attributes.patron_count\u0026suffix=%20patrons\u0026url=https%3A%2F%2Fwww.patreon.com%2Fapi%2Fcampaigns%2F233228","http://patreon.com/koistya"],"categories":[],"sub_categories":[],"readme":"# Knex.js types generator\n\n[![NPM Version](https://img.shields.io/npm/v/knex-types?style=flat-square)](https://www.npmjs.com/package/knex-types)\n[![NPM Downloads](https://img.shields.io/npm/dm/knex-types?style=flat-square)](https://www.npmjs.com/package/knex-types)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg?style=flat-square)](http://www.typescriptlang.org/)\n[![Donate](https://img.shields.io/badge/dynamic/json?color=%23ff424d\u0026label=Patreon\u0026style=flat-square\u0026query=data.attributes.patron_count\u0026suffix=%20patrons\u0026url=https%3A%2F%2Fwww.patreon.com%2Fapi%2Fcampaigns%2F233228)](http://patreon.com/koistya)\n[![Discord](https://img.shields.io/discord/643523529131950086?label=Chat\u0026style=flat-square)](https://discord.gg/bSsv7XM)\n\nAn utility module for [Knex.js](https://knexjs.org/) that generates TypeScript\ndefinitions (types) from a PostgreSQL database schema.\n\n```\n$ npm install knex\n$ npm install knex-types --dev\n```\n\n## Usage Example\n\n```js\nconst { knex } = require(\"knex\");\nconst { updateTypes } = require(\"knex-types\");\n\nconst db = knex(require(\"./knexfile\"));\n\nupdateTypes(db, { output: \"./types.ts\" }).catch((err) =\u003e {\n  console.error(err);\n  process.exit(1);\n});\n```\n\nFind an example of generated types in [`./main.test.ts`](./main.test.ts).\n\n## Related Projects\n\n- [GraphQL API Starter Kit](https://github.com/kriasoft/graphql-starter) — monorepo template, pre-configured with TypeScript, GraphQL.js, React, and Relay\n- [Node.js API Starter Kit](https://github.com/kriasoft/node-starter-kit) — Node.js project template (PostgreSQL, Knex, OAuth 2.0, emails, Cloud Functions)\n\n## How to Contribute\n\nPlease create a [PR](https://docs.github.com/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request) or send me a message on [Discord](https://discord.gg/bSsv7XM).\n\n## License\n\nCopyright © 2021-present Kriasoft. This source code is licensed under the MIT license found in the\n[LICENSE](https://github.com/kriasoft/knex-types/blob/main/LICENSE) file.\n\n---\n\n\u003csup\u003eMade with ♥ by Konstantin Tarkus ([@koistya](https://twitter.com/koistya), [blog](https://medium.com/@koistya))\nand [contributors](https://github.com/kriasoft/knex-types/graphs/contributors).\u003c/sup\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriasoft%2Fknex-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkriasoft%2Fknex-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriasoft%2Fknex-types/lists"}