Add support for WITH statements and Common Table Expressions.

This commit is contained in:
go-jet 2020-05-24 17:55:28 +02:00
parent 0d3ec872d6
commit fb8607da29
13 changed files with 406 additions and 39 deletions

View file

@ -201,6 +201,13 @@ func integerTypesToString(value interface{}) string {
}
func shouldQuoteIdentifier(identifier string) bool {
_, err := strconv.ParseInt(identifier, 10, 64)
if err == nil { // if it is a number we should quote it
return true
}
// check if contains non ascii characters
for _, c := range identifier {
if unicode.IsNumber(c) || c == '_' {
continue