-
Notifications
You must be signed in to change notification settings - Fork 833
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
Add support for ignoring DDL statements using -- sqlc:ignore
.
#3130
base: main
Are you sure you want to change the base?
Conversation
// sqlc:ignore
.-- sqlc:ignore
.
@kyleconroy if you agree with this addition, then I would propose to add some documentation regarding this in https://docs.sqlc.dev/en/stable/howto/ddl.html. I can do that too within this PR, but wanted to await your thoughts first. |
@kyleconroy what do you think about this addition? |
@kyleconroy another bump - marking as non-draft in case that helps |
Hi, @kyleconroy , @sgielen ! Thank you for the feature introduced! |
Hi! @sgielen I've updated the branch, added tests and rebased onto fresh master (it was relatively old), squashed into 1 commit. Could you please have a look? If you find tests useful, feel free to use them in your PR. |
Excellent! Thank you for this. I never wrote additional tests or documentation, because I wanted to hear from the maintainers first, but they never responded to my pings (@kyleconroy trying again). I can close this PR in favor of yours? For context, perhaps your PR's description could link to this one and/or the issues mentioned in my description above? |
Any progress on this? Would be a neat addition. |
@kyleconroy another |
Please review #3458, not this one, it is improved with regards to this one. I'll close this one as soon as that one is merged. |
NOTE: This PR is in a draft state, because it still requires (at the very least) documentation updates.
This PR adds support for commenting out parts of the schema. This is most useful in the case where the schema is defined by migrations, and such migrations contain queries that are not yet supported by sqlc. See for example #3129, #1756.
By wrapping such unsupported queries in
sqlc:ignore
comments, they are ignored and the rest of the schema can be parsed appropriately.Example usage in a migration file:
See #3129 for a full use-case.
Since the lines are actually cleared, instead of removed, errors on queries below the
sqlc:ignore end
marker are still shown with the correct line number.