{"id":16675878,"url":"https://github.com/mpyw/sqlc-restruct","last_synced_at":"2025-04-09T20:32:39.148Z","repository":{"id":179116294,"uuid":"662232586","full_name":"mpyw/sqlc-restruct","owner":"mpyw","description":"Post-processor for kyleconroy/sqlc","archived":false,"fork":false,"pushed_at":"2024-02-19T02:51:31.000Z","size":42,"stargazers_count":8,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T23:37:08.269Z","etag":null,"topics":["database","go","golang","postprocessing","postprocessor","sqlc"],"latest_commit_sha":null,"homepage":"","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/mpyw.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}},"created_at":"2023-07-04T16:41:36.000Z","updated_at":"2024-08-13T12:21:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b3647d7-f988-4a98-99ec-516c5c979db4","html_url":"https://github.com/mpyw/sqlc-restruct","commit_stats":null,"previous_names":["mpyw/sqlc-restruct"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpyw%2Fsqlc-restruct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpyw%2Fsqlc-restruct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpyw%2Fsqlc-restruct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpyw%2Fsqlc-restruct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpyw","download_url":"https://codeload.github.com/mpyw/sqlc-restruct/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248107647,"owners_count":21048974,"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":["database","go","golang","postprocessing","postprocessor","sqlc"],"created_at":"2024-10-12T13:08:15.990Z","updated_at":"2025-04-09T20:32:39.127Z","avatar_url":"https://github.com/mpyw.png","language":"Go","readme":"# sqlc-restruct\n\n**EXPERIMENTAL!**\n\nPost-processor for [kyleconroy/sqlc](https://github.com/kyleconroy/sqlc)\n\n\u003cimg width=\"1048\" alt=\"overview\" src=\"https://github.com/mpyw/sqlc-restruct/assets/1351893/51b422a3-fb7d-4808-a100-ff7c039546b8\"\u003e\n\n```ShellSession\nuser@host:~$ sqlc-restruct --help\nNAME:\n   sqlc-restruct - Post-processor for kyleconroy/sqlc\n\nUSAGE:\n   sqlc-restruct [global options] command [command options] [arguments...]\n\nCOMMANDS:\n   separate-interface  Separates models and the `Querier` interface from the `Queries` struct. This is typically done to adhere to the Dependency Inversion Principle (DIP), allowing for more flexible and testable code.\n   help, h             Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --help, -h  show help\n```\n\n## Installation\n\n```\ngo install github.com/mpyw/sqlc-restruct/cmd/sqlc-restruct@latest\n```\n\n## SubCommands\n\n### [separate-interface](./cmd/sqlc-restruct/separate_interface.go)\n\n```ShellSession\nuser@host:~$ sqlc-restruct separate-interface --help\nNAME:\n   sqlc-restruct separate-interface - Separates models and the `Querier` interface from the `Queries` struct. This is typically done to adhere to the Dependency Inversion Principle (DIP), allowing for more flexible and testable code.\n\nUSAGE:\n   sqlc-restruct separate-interface [command options] [arguments...]\n\nOPTIONS:\n   --iface-pkg-name value     The package name where the separated Querier will be located.\n   --iface-pkg-url value      The package URL where the separated Querier will be located. (e.g. \"github.com/\u003cuser\u003e/\u003crepo\u003e/path/to/pkg\")\n   --iface-dir value          The directory path where the separated Querier will be located.\n   --models-pkg-name value    The package name where the separated models will be located. (default: --models-pkg-name value)\n   --models-pkg-url value     The package URL where the separated models will be located. (default: --models-pkg-url value)\n   --models-dir value         The directory path where the separated models will be located. (default: --iface-dir value)\n   --impl-dir value           The original directory where the sqlc-generated code is located. (default: \".\")\n   --impl-sql-suffix value    The suffix for sqlc-generated files from SQL files. (default: \".sql.go\")\n   --models-file-name value   The file name for the sqlc-generated models file. (default: \"models.go\")\n   --querier-file-name value  The file name for the sqlc-generated Querier file. (default: \"querier.go\")\n   --help, -h                 show help\n```\n\nWe recommend chaining the `//go:generate` directive for `sqlc-restruct` right after the one for `sqlc` in your code.\n\n```go\n//go:generate sqlc generate\n//go:generate sqlc-restruct separate-interface --iface-dir=domain/repos --iface-pkg-name=repos --iface-pkg-url=github.com/example/domain/repos\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpyw%2Fsqlc-restruct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpyw%2Fsqlc-restruct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpyw%2Fsqlc-restruct/lists"}