mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-24 12:55:02 +08:00
add enableUpsert=true
and rename config to upsertQuery
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
type SqlGenPostgres struct {
|
||||
CreateTableSqlTemplate string
|
||||
DropTableSqlTemplate string
|
||||
InsertQueryTemplate string
|
||||
UpsertQueryTemplate string
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -18,8 +18,8 @@ var (
|
||||
)
|
||||
|
||||
func (gen *SqlGenPostgres) GetSqlInsert(tableName string) string {
|
||||
if gen.InsertQueryTemplate != "" {
|
||||
return fmt.Sprintf(gen.InsertQueryTemplate, tableName)
|
||||
if gen.UpsertQueryTemplate != "" {
|
||||
return fmt.Sprintf(gen.UpsertQueryTemplate, tableName)
|
||||
} else {
|
||||
return fmt.Sprintf(`INSERT INTO "%s" (dirhash,name,directory,meta) VALUES($1,$2,$3,$4)`, tableName)
|
||||
}
|
||||
|
Reference in New Issue
Block a user