Fix quotes

This commit is contained in:
Jamie Curnow
2024-09-11 19:38:41 +10:00
parent e78dd069f1
commit c4db4a2647
4 changed files with 12 additions and 11 deletions

View File

@ -18,11 +18,12 @@ const (
// is for special cases where we run raw sql
func QuoteTableName(tbl string) string {
switch strings.ToLower(config.Configuration.DB.Driver) {
case config.DatabasePostgres:
return fmt.Sprintf(`"%s"`, tbl)
default:
// This is the same for Mysql and Sqlite
case config.DatabaseMysql:
// backticks for mysql
return fmt.Sprintf("`%s`", tbl)
default:
// double quotes for everything else
return fmt.Sprintf(`"%s"`, tbl)
}
}