ソースを参照

put values for IN in parens

Sven Klemm 7 年 前
コミット
5e9a66de5f
1 ファイル変更5 行追加1 行削除
  1. 5 1
      public/app/plugins/datasource/postgres/postgres_query.ts

+ 5 - 1
public/app/plugins/datasource/postgres/postgres_query.ts

@@ -137,7 +137,11 @@ export default class PostgresQuery {
       value = this.templateSrv.replace(value, this.scopedVars);
     }
 
-    return str + constraint.key + ' ' + operator + ' ' + value;
+    if (operator === "IN") {
+      return str + constraint.key + ' ' + operator + ' (' + value + ')';
+    } else {
+      return str + constraint.key + ' ' + operator + ' ' + value;
+    }
   }
 
   interpolateQueryStr(value, variable, defaultFormatFn) {