sqlc
sqlc copied to clipboard
Implement tern template support
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.
Sorry for the force push. I accidentally included go.sum change in the PR and did some cleanup.