Skip to content

Commit

Permalink
Merge pull request #350 from libsgh/dev
Browse files Browse the repository at this point in the history
🐛Fix postgres password error
  • Loading branch information
libsgh authored Aug 25, 2022
2 parents 226118b + fc7186f commit a2430f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dao/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ func GetPwdFromPath(path string) ([]string, string, bool) {
likeSql := ""
if DB_TYPE == "sqlite" {
likeSql = "SELECT * FROM pwd_files WHERE ? LIKE file_path || '%' AND (expire_at =0 or expire_at >= ?) ORDER BY LENGTH(file_path) DESC"
} else if _, ok := GetDb("postgres"); ok {
likeSql = "SELECT * FROM pwd_files WHERE ? LIKE concat_ws(file_path, '%') AND (expire_at =0 or expire_at >= ?) ORDER BY LENGTH(file_path) DESC"
} else if DB_TYPE == "postgres" {
likeSql = "SELECT * FROM pwd_files WHERE ? LIKE concat_ws('', file_path, '%') AND (expire_at =0 or expire_at >= ?) ORDER BY LENGTH(file_path) DESC"
} else {
likeSql = "SELECT * FROM pwd_files WHERE ? LIKE concat(file_path, '%') AND (expire_at =0 or expire_at >= ?) ORDER BY LENGTH(file_path) DESC"
}
Expand Down

1 comment on commit a2430f3

@vercel
Copy link

@vercel vercel bot commented on a2430f3 Aug 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pan-index – ./

pan-index-git-main-libsgh.vercel.app
pan-index-libsgh.vercel.app
pan-index-five.vercel.app

Please sign in to comment.