feat: adapt postgres (close #740)

This commit is contained in:
Xhofe
2022-03-22 16:41:38 +08:00
parent 801f843f8a
commit 9e483d902f
3 changed files with 18 additions and 5 deletions

13
model/util.go Normal file
View File

@ -0,0 +1,13 @@
package model
import (
"fmt"
"github.com/Xhofe/alist/conf"
)
func columnName(name string) string {
if conf.Conf.Database.Type == "postgres" {
return fmt.Sprintf(`"%s"`, name)
}
return fmt.Sprintf("`%s`", name)
}