qustavo / dotsql

A Golang library for using SQL.
GNU General Public License v2.0
741 stars 53 forks source link

Support template or ignore special chars for shard tables #28

Closed kevincobain2000 closed 6 months ago

kevincobain2000 commented 6 months ago

At present dotsql fails to load contents if the sql contains special characters such as for jinja template

INSERT INTO users_sharded_{{ i }}
..and so on

It fails at

q, err := dotsql.LoadFromString(string(contents))

It'd be nice if it can be loaded. Then advanced templating such as gonja can be used

kevincobain2000 commented 6 months ago

Sorry, I see I was missing a dot {{ .i }}. It is already supported.