Skip to content

Commit

Permalink
Update postgres.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Fenny committed Nov 5, 2020
1 parent 3948041 commit 1b56ad4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func New(config ...Config) *Storage {
db: db,
gcInterval: cfg.GCInterval,
sqlSelect: fmt.Sprintf(`SELECT v, e FROM %s WHERE k=$1;`, cfg.Table),
sqlInsert: fmt.Sprintf("INSERT INTO %s (k, v, e) VALUES ($1, $2, $3) ON CONFLICT (id) DO UPDATE SET v = $4, e = $5", cfg.Table),
sqlInsert: fmt.Sprintf("INSERT INTO %s (k, v, e) VALUES ($1, $2, $3) ON CONFLICT (k) DO UPDATE SET v = $4, e = $5", cfg.Table),
sqlDelete: fmt.Sprintf("DELETE FROM %s WHERE k=$1", cfg.Table),
sqlClear: fmt.Sprintf("DELETE FROM %s;", cfg.Table),
sqlGC: fmt.Sprintf("DELETE FROM %s WHERE e <= $1", cfg.Table),
Expand Down

0 comments on commit 1b56ad4

Please sign in to comment.