From 4b5e4e862b26995d46dfd8b248550a35fb6645ac Mon Sep 17 00:00:00 2001 From: "Nigel Harsch (Vallen)" Date: Fri, 3 Mar 2023 09:37:20 -0800 Subject: [PATCH] refs #463 - document dialect + quoted = nil behavior --- doc/getting-started.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/getting-started.md b/doc/getting-started.md index 2c7cfa2..149d748 100644 --- a/doc/getting-started.md +++ b/doc/getting-started.md @@ -340,6 +340,8 @@ specify a dialect in the `format` call, you can specify `:quoted true` to have SQL entities quoted. You can also enable quoting globally via the `set-dialect!` function. +If you want to use a dialect _and_ use the default quoting strategy (automatically quote any SQL entities that seem unusual), specify a `:dialect` option and set `:quoted nil`: + ```clojure @@ -366,6 +368,9 @@ globally via the `set-dialect!` function. ;; so only unusual entity names get quoted: (sql/format '{select (id) from (table)} {:quoted true}) ;;=> ["SELECT \"id\" FROM \"table\""] +;; use default quoting strategy with dialect specific quotes, only unusual entities quoted +(sql/format '{select (id, iffy##field ) from (table)} {:dialect :sqlserver :quoted nil}) +;; => ["SELECT id, [iffy##field] FROM table"] ``` Out of the box, as part of the extended ANSI SQL support,