瀏覽代碼

put values for IN in parens

Sven Klemm 8 年之前
父節點
當前提交
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) {