Skip to content

Commit

Permalink
fix: fix pgsql lookup sql (#2476)
Browse files Browse the repository at this point in the history
Signed-off-by: yisaer <[email protected]>
  • Loading branch information
Yisaer committed Dec 12, 2023
1 parent 518299d commit ee9a1dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extensions/sources/sql/ext/sqlLookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ func (g defaultSQLGen) buildQuery(fields []string, keys []string, values []inter
return query
}

type sqlServerSQLGen struct{ table string }
type noQuoteSQLGen struct{ table string }

func (g sqlServerSQLGen) buildQuery(fields []string, keys []string, values []interface{}) string {
func (g noQuoteSQLGen) buildQuery(fields []string, keys []string, values []interface{}) string {
query := "SELECT "
if len(fields) == 0 {
query += "*"
Expand Down Expand Up @@ -175,8 +175,8 @@ func (g sqlServerSQLGen) buildQuery(fields []string, keys []string, values []int

func (s *sqlLookupSource) buildQuery(fields []string, keys []string, values []interface{}) string {
switch strings.ToLower(s.driver) {
case "sqlserver", "mssql":
return sqlServerSQLGen{table: s.table}.buildQuery(fields, keys, values)
case "sqlserver", "mssql", "postgres":
return noQuoteSQLGen{table: s.table}.buildQuery(fields, keys, values)
default:
return defaultSQLGen{table: s.table}.buildQuery(fields, keys, values)
}
Expand Down

0 comments on commit ee9a1dc

Please sign in to comment.