elgris / sqrl

Fluent SQL generation for golang
MIT License
279 stars 38 forks source link

escape reserved symbols #21

Open megabild opened 6 years ago

megabild commented 6 years ago

It would be nice to tell sqrl to escape column names for example "status" is a reserved symbol in mysql.

users := sq.Select("status").From("users").Join("emails USING (email_id)")
fmt.Println(users.ToSql())

output is:

SELECT status FROM users JOIN emails USING (email_id) [] <nil>

should be:


SELECT `status` FROM users JOIN emails USING (email_id) [] <nil>