sqlc
sqlc copied to clipboard
Export github.com/sqlc-dev/sqlc/internal/plugin
What do you want to change?
In looking at the sample plugin is seems that the sample given uses two internal packages that we cannot use externally.
I read the related issue #2395 but that focused on code generation and not on the plugin package. I get that you expect the code generation code to change and thus don't want to expose it, but is that the same for the core plugin interface too?
Even if you do plan to change it, could you not create new version of plugin.GenerateRequest so you can maintain the existing one to support older plugins? If yes, then making them plugin public shouldn't be an issue, no?
What database engines need to be changed?
No response
What programming language backends need to be changed?
No response
I'm running into the same issue. I want to make a plugin so I currently have to fork sqlc when I just need the plugin.GenerateRequest|Response
@mikeschinkel
in the meantime I'm now using a Taskfile.yml to do the automation to use outside of sqlc
sqlc-pb-update:
dir: sqlc-gen-zombiezen/pb/plugin
cmds:
- wget -Nc -q --show-progress https://raw.githubusercontent.com/sqlc-dev/sqlc/main/internal/plugin/codegen.pb.go
- wget -Nc -q --show-progress https://raw.githubusercontent.com/sqlc-dev/sqlc/main/internal/plugin/codegen_grpc.pb.go
sqlc:
dir: sqlc-gen-zombiezen
sources:
- "**/*.go"
- "**/*.tpl"
deps:
- sqlc-pb-update
cmds:
- go install
@delaneyj — Thanks. How are you running Taskfile.yml?
task sqlc -w note this is just part of the taskfile... task --init to make a new file. https://taskfile.dev/usage/ for more details.
@delaneyj — Thanks!
The plugin package won't be moved in this repository, but it is exported in the https://github.com/sqlc-dev/plugin-sdk-go package, which should be used when building sqlc plugins in Go.
That package is a bit out of date, but I don't think the plugin interface has changed in the last few minor versions. I'll make sure to update it for the next release.