{"id":26204917,"url":"https://github.com/wilsonehusin/typeid-sqlc-shim","last_synced_at":"2026-04-17T19:31:33.050Z","repository":{"id":236459712,"uuid":"792625864","full_name":"wilsonehusin/typeid-sqlc-shim","owner":"wilsonehusin","description":"Use TypeID with sqlc.","archived":false,"fork":false,"pushed_at":"2024-04-27T15:57:08.000Z","size":8,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T04:34:07.159Z","etag":null,"topics":["sql","sqlc","typeid"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wilsonehusin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-04-27T05:22:04.000Z","updated_at":"2024-04-27T15:57:12.000Z","dependencies_parsed_at":"2024-06-19T11:24:42.691Z","dependency_job_id":"44473873-66f3-47b3-bb44-80e56b98b70f","html_url":"https://github.com/wilsonehusin/typeid-sqlc-shim","commit_stats":null,"previous_names":["wilsonehusin/typeid-sqlc-shim"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wilsonehusin/typeid-sqlc-shim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonehusin%2Ftypeid-sqlc-shim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonehusin%2Ftypeid-sqlc-shim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonehusin%2Ftypeid-sqlc-shim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonehusin%2Ftypeid-sqlc-shim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wilsonehusin","download_url":"https://codeload.github.com/wilsonehusin/typeid-sqlc-shim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonehusin%2Ftypeid-sqlc-shim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31943222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["sql","sqlc","typeid"],"created_at":"2025-03-12T04:31:40.700Z","updated_at":"2026-04-17T19:31:33.032Z","avatar_url":"https://github.com/wilsonehusin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typeid-sqlc-shim\n\nThis is a generator for [sqlc](https://sqlc.dev)-generated Go code which uses [TypeID](https://github.com/jetify-com/typeid-go).\n\n\u003e [!WARNING]\n\u003e This is a prototype and not meant for production use, expect rough edges.\n\u003e See [open issues](https://github.com/wilsonehusin/typeid-sqlc-shim/issues) for known limitations.\n\n## Why?\n\nTo leverage compile-time enforcement, TypeID requires strict typing for every prefix's ID. On the other hand, sqlc supports overriding one data type (e.g. UUID) to another in one-to-one mapping. This is not enough for TypeID.\n\nTo make this work with TypeID, we need to generate overrides for every model field, assuming that each model has its own distinct prefix. Writing that by hand does not sound fun, so this generator is here to ease the process.\n\n## Speedrun!\n\nDefine your config file:\n\n```yaml\npackage:    # Co-locate this with models.go from sqlc.\n  name: db  # =\u003e \"package db\"\n  path: db/id.go\nmodels:\n  - name: User\n    prefix: usr\n    table: users\n  - name: Organization\n    prefix: org\n    table: organizations\n```\n\n```shell-session\n$ go run go.husin.dev/typeid-sqlc-shim -config path/to/config.yaml\n[INFO] db/id.go has been written\n[INFO] Append the following to your sqlc.yaml:\n\noverrides:\n  - column: users.id\n    go_type:\n      type: UserID\n  - column: organizations.id\n    go_type:\n      type: OrganizationID\n\n[INFO] See https://docs.sqlc.dev/en/latest/howto/overrides.html#the-go-type-map for more information.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilsonehusin%2Ftypeid-sqlc-shim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilsonehusin%2Ftypeid-sqlc-shim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilsonehusin%2Ftypeid-sqlc-shim/lists"}