Skip to content

Conversation

No3371
Copy link

@No3371 No3371 commented Oct 16, 2025

tern allows sql scripts reference scripts in sub folders with the syntax {{ template "path/to/script" . }}.

sqlc does not accept this syntax appears within migration scripts, which means you either gives up the nice organizational feature of tern, or gives up sqlc.

By adding a pre-processor func TransformStatements() next to RemoveRollbackStatements(), this PR allows sqlc to fetch content of script files referenced by tern template syntax and replace the syntax lines with the actual sql file content.

@No3371
Copy link
Author

No3371 commented Oct 16, 2025

Sorry for the force push. I accidentally included go.sum change in the PR and did some cleanup.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. 🔧 golang labels Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files. 🔧 golang

1 participant