Skip to content
Snippets Groups Projects
Unverified Commit e9185095 authored by Chris Truter's avatar Chris Truter Committed by GitHub
Browse files

Add dialect based feature flags for macaw (#45234)

parent 7af7213e
No related branches found
No related tags found
No related merge requests found
(ns metabase.native-query-analyzer.impl)
(ns metabase.native-query-analyzer.impl
(:require
[metabase.driver :as driver]))
;; NOTE: In the future we should replace [[considered-drivers]] and [[macaw-options]] with (a) driver method(s),
;; but given that the interface with Macaw is still in a state of flux, and how simple the current configuration is,
......@@ -41,6 +43,14 @@
;; For both MySQL and SQL Server, whether identifiers are case-sensitive depends on database configuration only,
;; and quoting has no effect on this, so we disable this option for consistency with `:case-insensitive`.
:quotes-preserve-case? (not (contains? #{:mysql :sqlserver} driver))
:features {:postgres-syntax (isa? driver/hierarchy driver :postgres)
:square-bracket-quotes (= :sqlserver driver)
:unsupported-statements true
:backslash-escape-char true
;; This will slow things down, but until we measure the difference, opt for correctness.
:complex-parsing true}
;; 10 seconds
:timout 10000
;; There is no plan to be exhaustive yet.
;; Note that while an allowed list would be more conservative, at the time of writing only 2 of the bundled
;; drivers use FINAL as a reserved word, and mentioning them all would be prohibitive.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment