{"id":21665850,"url":"https://github.com/mattgson/gybson","last_synced_at":"2025-04-12T01:02:31.302Z","repository":{"id":39759347,"uuid":"278784202","full_name":"MattGson/Gybson","owner":"MattGson","description":"A type-safe, auto-generated, lazy loading ORM for Node.js. Designed to maximise developer productivity.","archived":false,"fork":false,"pushed_at":"2023-01-11T04:07:26.000Z","size":3688,"stargazers_count":5,"open_issues_count":32,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T01:01:44.157Z","etag":null,"topics":["graphql","mysql","nodejs","orm","postgresql","sql","typescript"],"latest_commit_sha":null,"homepage":"https://mattgson.github.io/Gybson/","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/MattGson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-11T04:00:39.000Z","updated_at":"2022-04-04T08:43:10.000Z","dependencies_parsed_at":"2023-02-09T01:15:42.935Z","dependency_job_id":null,"html_url":"https://github.com/MattGson/Gybson","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattGson%2FGybson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattGson%2FGybson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattGson%2FGybson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattGson%2FGybson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MattGson","download_url":"https://codeload.github.com/MattGson/Gybson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501872,"owners_count":21114683,"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":["graphql","mysql","nodejs","orm","postgresql","sql","typescript"],"created_at":"2024-11-25T11:18:08.402Z","updated_at":"2025-04-12T01:02:31.253Z","avatar_url":"https://github.com/MattGson.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Image of logo](https://github.com/MattGson/Gybson/blob/master/logo-small.png?raw=true)\n\n[![npm](https://img.shields.io/npm/v/gybson.svg?style=for-the-badge)](https://www.npmjs.com/package/gybson)\n[![GitHub tag](https://img.shields.io/github/tag/MattGson/Gybson.svg?style=for-the-badge)](https://github.com/MattGson/Gybson)\n[![TravisCI Build Status](https://img.shields.io/travis/MattGson/Gybson/master?style=for-the-badge)](https://travis-ci.org/github/MattGson/Gybson)\n[![Star on GitHub][github-star-badge]][github-star-link]\n[![Github last commit][last-commit]][last-commit-link]\n[![Pull Requests Welcome][prs-badge]][prs-link]\n\n[github-star-badge]: https://img.shields.io/github/last-commit/MattGson/Gybson.svg?style=for-the-badge\u0026logo=github\u0026logoColor=ffffff\n[github-star-link]: https://github.com/MattGson/Gybson/stargazers\n[last-commit]: https://img.shields.io/github/stars/MattGson/Gybson.svg?style=for-the-badge\u0026logo=github\u0026logoColor=ffffff\n[last-commit-link]: https://github.com/MattGson/Gybson/commits\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge\n[prs-link]: https://github.com/MattGson/Gybson\n\nGybson is a type-safe, auto-generated Node.js query client (light-weight ORM) for working with SQL databases in Typescript.\n\nOptimized for super fast lazy loading, using batching and caching, it's perfect for GraphQL apps.\n\nGybson is built on top of trusted open-source projects:\n\n-   [Knex](https://github.com/knex/knex)\n-   [DataLoader](https://github.com/graphql/dataloader)\n\nGybson works with MySQL and PostgreSQL databases.\n\n## Why Gybson?\n\nGybson was created to make working with relational databases in Typescript as productive as possible.\n\nJust run `gybson generate` and you have a fully type-safe database client created for your exact schema.\n\n### Knex\n\nGybson is built on top of the very popular SQL query builder [Knex](https://github.com/knex/knex).\n\nGybsonClient wraps a Knex client instance so it is very easy to integrate into apps already using Knex.\n\n---\n\n## Key features\n\n### IDE Auto-completion\n\nYou can maximise developer efficiency with auto-completion in any IDE.\n\n![Image of demo](https://github.com/MattGson/Gybson/blob/master/demo.gif?raw=true)\n\n### Type-safe\n\nGybson comes with automated type safety out of the box so you know exactly what data goes in and out of your database. Clean, usable types are generated directly from your database schema.\n\n### Auto-generated\n\nUnlike most ORMs you don't have to define complex types and relations in code. You can get started using Gybson in 5 minutes and work with plain JavaScript objects.\n\n### GraphQL optimized\n\nGybson uses [dataloader](https://github.com/graphql/dataloader) under the hood to batch and cache (de-dupe) database requests to minimise round trips.\n\n---\n\n## A simple example\n\nIf your schema is defined as\n\n```sql\nCREATE TABLE users (\n    id INT AUTO_INCREMENT;\n    username: VARCHAR NOT NULL;\n    password: VARCHAR NOT NULL;\n    last_logon: Date;\n)\n```\n\nYou can query:\n\n```typescript\nconst id = await gybson.users.insert({\n    values: {\n        username: 'name',\n        password: 'secret',\n        last_logon: new Date(),\n    },\n});\n\nconst user = await gybson.users.loadOne({\n    where: {\n        id,\n    },\n});\n\nconsole.log(user);\n/* \n {\n   user_id: 1;\n   username: 'name';\n   password: 'secret';\n   last_logon: '2020-10-21T09:00:00';\n }\n*/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattgson%2Fgybson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattgson%2Fgybson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattgson%2Fgybson/lists"}