[
  {
    "namePrefix": "should suggest keywords",
    "beforeCursor": "SELECT * FROM database_two.testTable ORDER BY foo LIMIT 10 ",
    "afterCursor": "",
    "containsKeywords": ["UNION"],
    "expectedResult": {
      "lowerCase": false
    }
  },
  {
    "namePrefix": "should not report errors",
    "beforeCursor": "SELECT key FROM (SELECT key FROM src ORDER BY key LIMIT 10)subq1 UNION SELECT key FROM (SELECT key FROM src1 ORDER BY key LIMIT 10)subq2;",
    "afterCursor": "",
    "noErrors": true,
    "containsKeywords": ["SELECT"],
    "expectedResult": {
      "lowerCase": false
    }
  },
  {
    "namePrefix": "should not report errors",
    "beforeCursor": "SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2;",
    "afterCursor": "",
    "noErrors": true,
    "containsKeywords": ["SELECT"],
    "expectedResult": {
      "lowerCase": false
    }
  },
  {
    "namePrefix": "should not report errors",
    "beforeCursor": "SELECT * FROM t1 UNION SELECT * FROM t2;",
    "afterCursor": "",
    "noErrors": true,
    "containsKeywords": ["SELECT"],
    "expectedResult": {
      "lowerCase": false
    }
  },
  {
    "namePrefix": "should suggest keywords",
    "beforeCursor": "SELECT * FROM t1 UNION ",
    "afterCursor": "",
    "noErrors": true,
    "expectedResult": {
      "lowerCase": false,
      "suggestKeywords": ["ALL", "DISTINCT", "SELECT"]
    }
  },
  {
    "namePrefix": "should suggest tables",
    "beforeCursor": "SELECT * FROM t1 UNION ALL SELECT ",
    "afterCursor": "",
    "noErrors": true,
    "containsKeywords": ["*", "ALL", "DISTINCT"],
    "expectedResult": {
      "lowerCase": false,
      "suggestAggregateFunctions": {
        "tables": []
      },
      "suggestAnalyticFunctions": true,
      "suggestFunctions": {},
      "suggestTables": {
        "prependQuestionMark": true,
        "prependFrom": true
      },
      "suggestDatabases": {
        "prependQuestionMark": true,
        "prependFrom": true,
        "appendDot": true
      }
    }
  },
  {
    "namePrefix": "should not report errors",
    "beforeCursor": "WITH q1 AS (SELECT * FROM src WHERE something), q2 AS (SELECT * FROM src s2 WHERE something) SELECT * FROM q1 UNION ALL SELECT * FROM q2;",
    "afterCursor": "",
    "noErrors": true,
    "containsKeywords": ["SELECT"],
    "expectedResult": {
      "lowerCase": false
    }
  },
  {
    "namePrefix": "should not report errors",
    "beforeCursor": "WITH t1 AS (SELECT 1) (WITH t2 AS (SELECT 2) SELECT * FROM t2) UNION ALL SELECT * FROM t1;",
    "afterCursor": "",
    "noErrors": true,
    "containsKeywords": ["SELECT"],
    "expectedResult": {
      "lowerCase": false
    }
  }
]
