{"id":18431788,"url":"https://github.com/zztkm/sqlc-tutorial-postgresql-with-pgx-sqldef","last_synced_at":"2025-04-14T01:18:18.012Z","repository":{"id":190114836,"uuid":"681976204","full_name":"zztkm/sqlc-tutorial-postgresql-with-pgx-sqldef","owner":"zztkm","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-06T01:46:44.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T01:18:11.300Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/zztkm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2023-08-23T07:01:22.000Z","updated_at":"2023-09-06T01:46:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"bbbcf1c3-681d-4493-9a06-bf6f213d523e","html_url":"https://github.com/zztkm/sqlc-tutorial-postgresql-with-pgx-sqldef","commit_stats":null,"previous_names":["zztkm/sqlc-tutorial-postgresql-with-sqldef"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zztkm%2Fsqlc-tutorial-postgresql-with-pgx-sqldef","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zztkm%2Fsqlc-tutorial-postgresql-with-pgx-sqldef/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zztkm%2Fsqlc-tutorial-postgresql-with-pgx-sqldef/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zztkm%2Fsqlc-tutorial-postgresql-with-pgx-sqldef/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zztkm","download_url":"https://codeload.github.com/zztkm/sqlc-tutorial-postgresql-with-pgx-sqldef/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804822,"owners_count":21164135,"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-11-06T05:26:17.893Z","updated_at":"2025-04-14T01:18:17.985Z","avatar_url":"https://github.com/zztkm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example sqlc with pgx and sqldef\n\nrefs:\n- [Getting started with PostgreSQL — sqlc 1.20.0 documentation](https://docs.sqlc.dev/en/stable/tutorials/getting-started-postgresql.html)\n- [Using Go and pgx — sqlc 1.20.0 documentation](https://docs.sqlc.dev/en/stable/guides/using-go-and-pgx.html)\n- https://github.com/k0kubun/sqldef\n- [Dockerfileで対象プラットフォームによって処理分岐させる](https://zenn.dev/ytdrep/articles/d65c26201042eb)\n- [sqlc と pgxpool でトランザクション](https://zenn.dev/shiguredo/articles/sqlc-pgxpool-transaction)\n\n\n## TODO\n\n- [ ] このプロジェクトの [Connect](https://connectrpc.com/docs/go/getting-started/) 版を作る\n- [ ] main.go が分厚いのでダイエットさせる (root dir に移動させる)\n\n## Requirements\n\n- Go\n- sqlc\n- sqldef\n- Docker\n- Docker Compose\n\n## Commands\n\nDB 起動\n```\nmake up\n```\n\n実行されるマイグレーションの確認\n```\nmake migration-dry-run\n```\n\nsqlc によるコード生成\n```\nmake gen\n```\n\nアプリケーションのビルド\n```\nmake build\n```\n\n### DB定義を変更するとき\n\nschema.sql を編集\n```shell\n# check\nmake migration-dry-run\n\n# run\nmake migration\n```\n\n必要があれば、query.sql を編集して、sqlc generate\n```shell\nmake gen\n```\n\n## Architecture\n\nTODO: 書く\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzztkm%2Fsqlc-tutorial-postgresql-with-pgx-sqldef","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzztkm%2Fsqlc-tutorial-postgresql-with-pgx-sqldef","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzztkm%2Fsqlc-tutorial-postgresql-with-pgx-sqldef/lists"}