mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 16:48:25 +08:00
Update postgres.go
This commit is contained in:
@@ -98,7 +98,7 @@ func New(config ...Config) *Storage {
|
|||||||
db: db,
|
db: db,
|
||||||
gcInterval: cfg.GCInterval,
|
gcInterval: cfg.GCInterval,
|
||||||
sqlSelect: fmt.Sprintf(`SELECT v, e FROM %s WHERE k=$1;`, cfg.Table),
|
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),
|
sqlDelete: fmt.Sprintf("DELETE FROM %s WHERE k=$1", cfg.Table),
|
||||||
sqlClear: fmt.Sprintf("DELETE FROM %s;", cfg.Table),
|
sqlClear: fmt.Sprintf("DELETE FROM %s;", cfg.Table),
|
||||||
sqlGC: fmt.Sprintf("DELETE FROM %s WHERE e <= $1", cfg.Table),
|
sqlGC: fmt.Sprintf("DELETE FROM %s WHERE e <= $1", cfg.Table),
|
||||||
|
Reference in New Issue
Block a user