aboutsummaryrefslogtreecommitdiff
path: root/weed/command/scaffold.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/command/scaffold.go')
-rw-r--r--weed/command/scaffold.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/weed/command/scaffold.go b/weed/command/scaffold.go
index 52b547563..337adaa22 100644
--- a/weed/command/scaffold.go
+++ b/weed/command/scaffold.go
@@ -120,6 +120,10 @@ connection_max_idle = 2
connection_max_open = 100
connection_max_lifetime_seconds = 0
interpolateParams = false
+# Empty insertQuery will use the default insert query
+# example insertQuery can be for UPSERT syntax:
+# insertQuery = """INSERT INTO ` + "`%s`" + ` (dirhash,name,directory,meta) VALUES(?,?,?,?) ON DUPLICATE KEY UPDATE meta = VALUES(meta)"""
+insertQuery = ""
[mysql2] # or memsql, tidb
enabled = false
@@ -141,6 +145,10 @@ connection_max_idle = 2
connection_max_open = 100
connection_max_lifetime_seconds = 0
interpolateParams = false
+# Empty insertQuery will use the default insert query
+# example insertQuery can be for UPSERT syntax:
+# insertQuery = """INSERT INTO ` + "`%s`" + ` (dirhash,name,directory,meta) VALUES(?,?,?,?) ON DUPLICATE KEY UPDATE meta = VALUES(meta)"""
+insertQuery = ""
[postgres] # or cockroachdb, YugabyteDB
# CREATE TABLE IF NOT EXISTS filemeta (
@@ -161,6 +169,10 @@ sslmode = "disable"
connection_max_idle = 100
connection_max_open = 100
connection_max_lifetime_seconds = 0
+# Empty insertQuery will use the default insert query
+# example insertQuery can be for UPSERT syntax:
+# insertQuery = """INSERT INTO "%[1]s" (dirhash,name,directory,meta) VALUES($1,$2,$3,$4) ON CONFLICT ON CONSTRAINT "%[1]s_pkey" DO UPDATE SET meta = EXCLUDED.meta WHERE "%[1]s".meta != EXCLUDED.meta"""
+insertQuery = ""
[postgres2]
enabled = false
@@ -183,6 +195,10 @@ sslmode = "disable"
connection_max_idle = 100
connection_max_open = 100
connection_max_lifetime_seconds = 0
+# Empty insertQuery will use the default insert query
+# example insertQuery can be for UPSERT syntax:
+# insertQuery = """INSERT INTO "%[1]s" (dirhash,name,directory,meta) VALUES($1,$2,$3,$4) ON CONFLICT ON CONSTRAINT "%[1]s_pkey" DO UPDATE SET meta = EXCLUDED.meta WHERE "%[1]s".meta != EXCLUDED.meta"""
+insertQuery = ""
[cassandra]
# CREATE TABLE filemeta (