Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk): Add the plugin SDK package #1463

Merged
merged 1 commit into from Mar 2, 2022
Merged

feat(sdk): Add the plugin SDK package #1463

merged 1 commit into from Mar 2, 2022

Conversation

kyleconroy
Copy link
Collaborator

Collect a few commonly used functions and put them into one package.
Move the utils.go file from the codegen package here as well.

cc @stephen

Collect a few commonly used functions and put them into one package.
Move the utils.go file from the codegen package here as well.
Comment on lines -6 to +8
"github.com/kyleconroy/sqlc/internal/compiler"
"github.com/kyleconroy/sqlc/internal/codegen/sdk"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the main point of the change. The Go codegen no longer depends on the compiler or config packages.

@kyleconroy kyleconroy merged commit fc7c862 into main Mar 2, 2022
@kyleconroy kyleconroy deleted the kyle/sdk branch March 2, 2022 06:02
@stephen
Copy link
Contributor

stephen commented Mar 2, 2022

Nice!

I am curious what your plan for plugins overall looks like. Is this code going to get pulled outside of internal/ later? Similarly, what other internals might get pulled out? It would be nice to let other plugins reuse parts of the go (and kotlin/python/etc) code generators.

Some other loose thoughts:

  • My endgoal is thinking about how something like CRUD methods #192 could be implemented via plugin. A tricky thing with that case is if the plugin wants to know what the primary key is (currently not exposed by the compiler), or if it wants to annotate individual columns (like in the :encryption case mentioned in Extensibility / Plugin Support #288) which might be hard to support since those inline comments are not passed through in the compiler.
  • From Generate Python code via a WASM plugin #1414, are you thinking plugins would all be run via wasm?

@kyleconroy
Copy link
Collaborator Author

I have a whole plan but haven’t written it up in a design doc. Will do tonight and share it here.

@kyleconroy
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants