Browse Source

use UPSERT for postgres style databases

pull/4385/head
chrislu 2 years ago
parent
commit
efef6e94bf
  1. 6
      weed/command/scaffold/filer.toml

6
weed/command/scaffold/filer.toml

@ -108,7 +108,7 @@ connection_max_open = 100
connection_max_lifetime_seconds = 0 connection_max_lifetime_seconds = 0
# if insert/upsert failing, you can disable upsert or update query syntax to match your RDBMS syntax: # if insert/upsert failing, you can disable upsert or update query syntax to match your RDBMS syntax:
enableUpsert = true enableUpsert = true
upsertQuery = """INSERT INTO "%[1]s" (dirhash,name,directory,meta) VALUES($1,$2,$3,$4) ON CONFLICT (dirhash,name) DO UPDATE SET meta = EXCLUDED.meta WHERE "%[1]s".meta != EXCLUDED.meta"""
upsertQuery = """UPSERT INTO "%[1]s" (dirhash,name,directory,meta) VALUES($1,$2,$3,$4)"""
[postgres2] [postgres2]
enabled = false enabled = false
@ -133,7 +133,7 @@ connection_max_open = 100
connection_max_lifetime_seconds = 0 connection_max_lifetime_seconds = 0
# if insert/upsert failing, you can disable upsert or update query syntax to match your RDBMS syntax: # if insert/upsert failing, you can disable upsert or update query syntax to match your RDBMS syntax:
enableUpsert = true enableUpsert = true
upsertQuery = """INSERT INTO "%[1]s" (dirhash,name,directory,meta) VALUES($1,$2,$3,$4) ON CONFLICT (dirhash,name) DO UPDATE SET meta = EXCLUDED.meta WHERE "%[1]s".meta != EXCLUDED.meta"""
upsertQuery = """UPSERT INTO "%[1]s" (dirhash,name,directory,meta) VALUES($1,$2,$3,$4)"""
[cassandra] [cassandra]
# CREATE TABLE filemeta ( # CREATE TABLE filemeta (
@ -344,4 +344,4 @@ cert_path=""
# Set the private key path # Set the private key path
key_path="" key_path=""
# The name list used to verify the cn name # The name list used to verify the cn name
verify_cn=""
verify_cn=""
Loading…
Cancel
Save