We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
func main() { sfsLoader, err := pongo2.NewSandboxedFilesystemLoader(".") tplset := pongo2.NewSet("name", sfsLoader) tpl, tplErr := tplset.FromFile("create-table.sql.tpl") out, outErr := tpl.Execute(pongo2.Context{ "table_settings": "SETTINGS merge_with_ttl_timeout = 86400, storage_policy = 's3'", }) return out }
create-table.sql.tpl:
CREATE TABLE IF NOT EXISTS db.table ( `name` String, `type` String, `help` String, `labels` Map(String, String) DEFAULT map(), `value` Float64, `timestamp` Int64 ) ENGINE = MergeTree PARTITION BY toDate(fromUnixTimestamp64Milli(`timestamp`, 'Asia/Shanghai')) PRIMARY KEY (`timestamp`, `name`) ORDER BY (`timestamp`, `name`, `labels`) -- SETTINGS {% if (table_settings | default : "") == "" %} SETTINGS merge_with_ttl_timeout = 86400 {% else %} {{ table_settings }} {% endif %} ;
out is:
...Omit ...Omit -- SETTINGS SETTINGS merge_with_ttl_timeout = 86400, storage_policy = \u0026#39;s3\u0026#39; ;
Why ' is escaped to \u0026#39; ? How can I avoid this? Because SQL can not parse \u successfully and can not use ; again and again.
Thank you very much!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
create-table.sql.tpl:
out is:
Why ' is escaped to \u0026#39; ? How can I avoid this?
Because SQL can not parse \u successfully and can not use ; again and again.
Thank you very much!
The text was updated successfully, but these errors were encountered: