jackc / tern

The SQL Fan's Migrator
MIT License
963 stars 70 forks source link

How to disable template engine? #94

Open Alalaq opened 7 months ago

Alalaq commented 7 months ago

Im using jackc/tern/migrations and in one of .sql files I do insert with using {{}} to insert parameters later. But (If I understood correctly) due to template engine in this lib sql is ignoring esc characters and that parameters whether being seen like sql functions (which doen't exist) or just saying that I have 'unexpected { in command. What should I do and how can I disable template engine?

jackc commented 7 months ago

There is no way to disable the template engine.

It is using the standard Go text/template library. You would need to escape the characters. See https://stackoverflow.com/questions/17641887/how-do-i-escape-and-delimiters-in-go-templates.