diff --git a/test/macaw/acceptance_test.clj b/test/macaw/acceptance_test.clj index 42e8647..54b6d33 100644 --- a/test/macaw/acceptance_test.clj +++ b/test/macaw/acceptance_test.clj @@ -13,8 +13,11 @@ (def broken-queries "The DANGER ZONE This map gives a pattern in the exception message we expect to receive when trying to analyze the given fixture." - {:broken/between #"Encountered unexpected token: \"BETWEEN\"" - :broken/filter-where #"Encountered unexpected token: \"\(\""}) + {:broken/between #"Encountered unexpected token: \"BETWEEN\"" + :broken/filter-where #"Encountered unexpected token: \"\(\"" + :sqlserver/execute #"Not supported yet" + :sqlserver/executesql #"Not supported yet" + :oracle/open-for #"Encountered unexpected token: \"OPEN\""}) (defn- fixture-analysis [fixture] (some-> fixture (ct/fixture->filename "acceptance" ".analysis.edn") io/resource slurp read-string)) @@ -68,7 +71,8 @@ (testing (str prefix " analysis cannot be parsed") (is (thrown-with-msg? Exception expected-msg (ct/components sql base-opts))) (doseq [m test-modes] - (is (thrown-with-msg? Exception expected-msg (ct/tables sql (opts-mode m)))))) + (when-not (not-implemented? m) + (is (thrown-with-msg? Exception expected-msg (ct/tables sql (opts-mode m))))))) (do (let [m :ast-walker-1 opts (opts-mode m)] diff --git a/test/resources/acceptance/bigquery__table_wildcard.analysis.edn b/test/resources/acceptance/bigquery__table_wildcard.analysis.edn new file mode 100644 index 0000000..be65d81 --- /dev/null +++ b/test/resources/acceptance/bigquery__table_wildcard.analysis.edn @@ -0,0 +1,12 @@ +{:source-columns [] + :tables ::not-sure-what-we-should-do-if-we-continue-supporting-this + + :overrides + {:basic-select + ;; do not allow wilcard selects + {:tables :macaw.error/illegal-expression} + + ;; Just plain old whacky + :source-columns [{:table "`project_id.dataset_id.table_*`", :column "_TABLE_SUFFIX"}] + ;; Kinda makes sense, but very raw, and Metabase won't handle it. + :tables [{:table "`project_id.dataset_id.table_*`"}]}} diff --git a/test/resources/acceptance/bigquery__table_wildcard.sql b/test/resources/acceptance/bigquery__table_wildcard.sql new file mode 100644 index 0000000..223f275 --- /dev/null +++ b/test/resources/acceptance/bigquery__table_wildcard.sql @@ -0,0 +1,7 @@ +SELECT + * +FROM + `project_id.dataset_id.table_*` +WHERE + _TABLE_SUFFIX BETWEEN '20230101' AND '20230131' +LIMIT 1000; diff --git a/test/resources/acceptance/oracle__open_for.sql b/test/resources/acceptance/oracle__open_for.sql new file mode 100644 index 0000000..f0599f2 --- /dev/null +++ b/test/resources/acceptance/oracle__open_for.sql @@ -0,0 +1,5 @@ + OPEN ccur FOR + 'select c.category + from ' || TABLE_NAME || ' c + where c.deptid=' || PI_N_Dept || + ' and c.category not in ('|| sExcludeCategories ||')'; diff --git a/test/resources/acceptance/simple__select_star.edn b/test/resources/acceptance/simple__select_star.edn new file mode 100644 index 0000000..b3329bb --- /dev/null +++ b/test/resources/acceptance/simple__select_star.edn @@ -0,0 +1,2 @@ +{:source-columns [] + :tables [{:table "t"}]} diff --git a/test/resources/acceptance/simple__select_star.sql b/test/resources/acceptance/simple__select_star.sql new file mode 100644 index 0000000..8bca937 --- /dev/null +++ b/test/resources/acceptance/simple__select_star.sql @@ -0,0 +1 @@ +SELECT * FROM t; diff --git a/test/resources/acceptance/sqlserver__execute.analysis.edn b/test/resources/acceptance/sqlserver__execute.analysis.edn new file mode 100644 index 0000000..b0ddca7 --- /dev/null +++ b/test/resources/acceptance/sqlserver__execute.analysis.edn @@ -0,0 +1 @@ +{:tables ::should-not-succeed} diff --git a/test/resources/acceptance/sqlserver__execute.sql b/test/resources/acceptance/sqlserver__execute.sql new file mode 100644 index 0000000..f019860 --- /dev/null +++ b/test/resources/acceptance/sqlserver__execute.sql @@ -0,0 +1 @@ +EXECUTE stmt; diff --git a/test/resources/acceptance/sqlserver__executesql.analysis.edn b/test/resources/acceptance/sqlserver__executesql.analysis.edn new file mode 100644 index 0000000..b0ddca7 --- /dev/null +++ b/test/resources/acceptance/sqlserver__executesql.analysis.edn @@ -0,0 +1 @@ +{:tables ::should-not-succeed} diff --git a/test/resources/acceptance/sqlserver__executesql.sql b/test/resources/acceptance/sqlserver__executesql.sql new file mode 100644 index 0000000..15e05c3 --- /dev/null +++ b/test/resources/acceptance/sqlserver__executesql.sql @@ -0,0 +1 @@ +EXEC sp_executesql @SQL