- Notifications
You must be signed in to change notification settings - Fork39
feat: emit_module, emit_generators and emit_async flags#15
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
kevinvalk wants to merge10 commits intosqlc-dev:mainChoose a base branch fromcodean-io:main
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Changes fromall commits
Commits
Show all changes
10 commits Select commitHold shift + click to select a range
d785536 feat: using emit_module, emit_generators and emit_async flags you can…
kevinvalkc7137df docs: udated README
kevinvalkba256bd chore: updated go version to 1.21.0 and uploading of plugin as artifact
kevinvalkbfa71a9 feat: added output_models_file_name and output_querier_file options t…
kevinvalkf239082 feat: support sqlc.embed
kevinvalk449d140 feat: added type annotations
kevinvalk4a7f0df Merge remote-tracking branch 'upstream/main'
kevinvalk3e51313 fix: ensure we are fully backwards compatible
kevinvalk6efc624 fix: updated ast.proto with manual patch for the AnnAssign node
kevinvalk3d5cd34 feat: automatic release of the plugin on tagging
kevinvalkFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
30 changes: 30 additions & 0 deletions.github/workflows/ci.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
16 changes: 14 additions & 2 deletionsREADME.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
375 changes: 193 additions & 182 deletionsinternal/ast/ast.pb.go
Large diffs are not rendered by default.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
16 changes: 11 additions & 5 deletionsinternal/config.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,18 @@ | ||
| package python | ||
| // TODO: Where are these properly documented? | ||
| type Config struct { | ||
| EmitAsync bool `json:"emit_async"` // Emits async code instead of sync | ||
| EmitExactTableNames bool `json:"emit_exact_table_names"` | ||
| EmitGenerators bool `json:"emit_generators"` // Will we use generators or lists, defaults to false | ||
| EmitModule bool `json:"emit_module"` // If true emits functions in module, else wraps in a class. | ||
| EmitPydanticModels bool `json:"emit_pydantic_models"` | ||
| EmitSyncQuerier bool `json:"emit_sync_querier"` // DEPRECATED ALIAS FOR: emit_type = 'class', emit_generators = True | ||
| EmitAsyncQuerier bool `json:"emit_async_querier"` // DEPRECATED ALIAS FOR: emit_type = 'class', emit_generators = True | ||
| InflectionExcludeTableNames []string `json:"inflection_exclude_table_names"` | ||
| Out string `json:"out"` | ||
| OutputModelsFileName *string `json:"output_models_file_name,omitempty"` // Can be string or null to exclude generating models file | ||
| OutputQuerierFile bool `json:"output_querier_file,omitempty"` // Skips outputting queries | ||
| Package string `json:"package"` | ||
| QueryParameterLimit *int32 `json:"query_parameter_limit"` | ||
| } |
3 changes: 2 additions & 1 deletioninternal/endtoend/endtoend_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletioninternal/endtoend/testdata/emit_pydantic_models/sqlc.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletioninternal/endtoend/testdata/exec_result/sqlc.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletioninternal/endtoend/testdata/exec_rows/sqlc.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletioninternal/endtoend/testdata/inflection_exclude_table_names/sqlc.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletioninternal/endtoend/testdata/query_parameter_limit_two/sqlc.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletioninternal/endtoend/testdata/query_parameter_limit_undefined/sqlc.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletioninternal/endtoend/testdata/query_parameter_limit_zero/sqlc.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletioninternal/endtoend/testdata/query_parameter_no_limit/sqlc.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.