Add reserved words for MySQL.
This commit is contained in:
parent
241ea0d6d6
commit
926b88ed40
12 changed files with 573 additions and 178 deletions
|
|
@ -163,10 +163,17 @@ func argToString(value interface{}) string {
|
|||
case time.Time:
|
||||
return stringQuote(string(pq.FormatTimestamp(bindVal)))
|
||||
default:
|
||||
if strBindValue, ok := bindVal.(toStringInterface); ok {
|
||||
return stringQuote(strBindValue.String())
|
||||
}
|
||||
panic(fmt.Sprintf("jet: %s type can not be used as SQL query parameter", reflect.TypeOf(value).String()))
|
||||
}
|
||||
}
|
||||
|
||||
type toStringInterface interface {
|
||||
String() string
|
||||
}
|
||||
|
||||
func integerTypesToString(value interface{}) string {
|
||||
switch bindVal := value.(type) {
|
||||
case int:
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ func SerializeColumnNames(columns []Column, out *SQLBuilder) {
|
|||
panic("jet: nil column in columns list")
|
||||
}
|
||||
|
||||
out.WriteString(col.Name())
|
||||
out.WriteIdentifier(col.Name())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue