{"id":22309146,"url":"https://github.com/csnewman/cuttle","last_synced_at":"2025-07-28T19:41:11.775Z","repository":{"id":233273746,"uuid":"780446261","full_name":"csnewman/cuttle","owner":"csnewman","description":"Opinionated database toolkit for Go","archived":false,"fork":false,"pushed_at":"2024-05-18T20:50:02.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-19T18:49:07.264Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/csnewman.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":"2024-04-01T13:57:47.000Z","updated_at":"2024-06-09T22:23:35.111Z","dependencies_parsed_at":null,"dependency_job_id":"3cec3c46-ba66-4e9b-83cb-fe476ad10065","html_url":"https://github.com/csnewman/cuttle","commit_stats":null,"previous_names":["csnewman/cuttle"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/csnewman/cuttle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csnewman%2Fcuttle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csnewman%2Fcuttle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csnewman%2Fcuttle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csnewman%2Fcuttle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csnewman","download_url":"https://codeload.github.com/csnewman/cuttle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csnewman%2Fcuttle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259783070,"owners_count":22910301,"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-12-03T20:17:00.139Z","updated_at":"2025-06-14T08:09:41.575Z","avatar_url":"https://github.com/csnewman.png","language":"Go","readme":"# cuttle\nOpinionated database toolkit for Go.\n\n**Work in progress**: This is incomplete and does not fully function yet!\n\n**Features:**\n\n- TODO\n- Transactions\n- Batches\n- Repository code generator\n\n## Codegen\n\nCuttle optionally includes a repository pattern code generator: \n\n```sql\n-- :cuttle version=1\n-- :repository name=UsersRepository dialects=sqlite,postgres\n\n-- :query name=InsertUser mode=exec\n-- :arg name=username type=string\n-- :arg name=password type=string\n-- :arg name=role type=string\n-- :dialect name=sqlite\nINSERT INTO users (username, password, role)\nVALUES (?1, ?2, ?3);\n-- :dialect name=postgres\nINSERT INTO users (username, password, role)\nVALUES ($1, $2, $3);\n```\n\nProduces:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"github.com/csnewman/cuttle\"\n)\n\ntype UsersRepository interface {\n\tInsertUser(\n\t\tctx context.Context,\n\t\ttx cuttle.WTx,\n\t\tusername string,\n\t\tpassword string,\n\t\trole string,\n\t) (int64, error)\n\n\tInsertUserAsync(\n\t\ttx cuttle.AsyncWTx,\n\t\tusername string,\n\t\tpassword string,\n\t\trole string,\n\t\tcallback cuttle.AsyncHandler[int64],\n\t)\n}\n\n// [...]\nfunc NewUsersRepository(dialect cuttle.Dialect) (UsersRepository, error) {\n// [...]\n```\n\n## Why not use `database/sql`\n\nTODO\n\n## Drivers\n\nBehind the scenes, cuttle uses the following libraries:\n\n| Database | Library                                                            |\n|----------|--------------------------------------------------------------------|\n| Postgres | [github.com/jackc/pgx](https://github.com/jackc/pgx)               |\n| SQLite   | [github.com/tailscale/sqlite](https://github.com/tailscale/sqlite) |\n| Other    | TODO (wrapper around `database/sql`)                               |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsnewman%2Fcuttle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsnewman%2Fcuttle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsnewman%2Fcuttle/lists"}