{"id":13809794,"url":"https://github.com/seamapi/quackatos","last_synced_at":"2025-03-23T16:28:06.744Z","repository":{"id":65557574,"uuid":"508393248","full_name":"seamapi/quackatos","owner":"seamapi","description":"🦆 a Typescript query builder for Postgres","archived":false,"fork":false,"pushed_at":"2025-02-10T20:32:40.000Z","size":1257,"stargazers_count":6,"open_issues_count":46,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-19T09:42:57.613Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PLpgSQL","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/seamapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"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}},"created_at":"2022-06-28T17:24:10.000Z","updated_at":"2023-08-30T20:27:33.000Z","dependencies_parsed_at":"2024-12-31T10:52:17.561Z","dependency_job_id":"df131f8e-9fae-4aaf-b278-6f03b01152fb","html_url":"https://github.com/seamapi/quackatos","commit_stats":{"total_commits":69,"total_committers":2,"mean_commits":34.5,"dds":0.2028985507246377,"last_synced_commit":"b0196e2fb1e1faf11d7ab2380134fc4206792705"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seamapi%2Fquackatos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seamapi%2Fquackatos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seamapi%2Fquackatos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seamapi%2Fquackatos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seamapi","download_url":"https://codeload.github.com/seamapi/quackatos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245130182,"owners_count":20565610,"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":[],"created_at":"2024-08-04T02:00:36.227Z","updated_at":"2025-03-23T16:28:06.685Z","avatar_url":"https://github.com/seamapi.png","language":"PLpgSQL","readme":"# 🦆 quackatos\n\n[![NPM Test](https://github.com/seamapi/quackatos/actions/workflows/npm-test.yml/badge.svg?branch=main)](https://github.com/seamapi/quackatos/actions/workflows/npm-test.yml)\n\nQuackatos is an extremely **well-typed query builder** for Postgres, built on top of the excellent [Zapatos](https://jawj.github.io/zapatos/) library.\n\nFor example:\n\n```ts\nimport q from \"quackatos\"\nimport { Pool } from \"pg\"\n\nconst pool = new Pool()\n\nconst filmAndActor = await q(\"film\")\n  .leftJoin(\"film_actor\", \"film.film_id\", \"film_actor.film_id\")\n  .leftJoin(\"actor\", \"actor.actor_id\", \"film_actor.actor_id\")\n  .select(\"actor.first_name\", \"film.*\")\n  .limit(1)\n  .run(pool)\n\n// typeof filmAndActor ===\n//  film.Selectable \u0026\n//  Pick\u003cNullPartial\u003cactor.Selectable\u003e, \"first_name\"\u003e\n```\n\n## Setup\n\nFirst, you'll have to [set up Zapatos](https://jawj.github.io/zapatos/#how-do-i-get-it) (Quackatos relies on Zapatos for type generation and helper functions).\n\nThen:\n\n`yarn add quackatos` or `npm install quackatos`\n\n## Goals\n\n\u003e If it looks like a duck, swims like a duck, and quacks like a duck, then it's probably a duck.\n\nQuackatos has three main goals:\n\n- Query results should be strongly typed to the fullest extent possible\n- Any code without type errors should generate a valid query\n- It should be immediately obvious what Postgres query will be generated for any given code\n\nQuackatos **does not** intend to be a drop-in replacement for [Knex](https://knexjs.org/), though it shares much of the same syntax.\n\n## Related Works\n\n- [Knex](https://knexjs.org/): a weakly-typed query builder for many different database engines\n- [Prisma](https://www.prisma.io/): a strongly-typed ORM for many different database engines\n- [Zapatos](https://jawj.github.io/zapatos/): a type generation and query helper library for Postgres\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n","funding_links":[],"categories":["Official Projects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseamapi%2Fquackatos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseamapi%2Fquackatos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseamapi%2Fquackatos/lists"}