fixes #347
This commit is contained in:
parent
92e0a04a84
commit
feb0c9a6f8
2 changed files with 12 additions and 2 deletions
|
|
@ -5,6 +5,7 @@
|
|||
* Fix #363 and #362 by aligning more closely the semantics of `:inline` syntax with the `:inline true` option. A side effect of this is that `[:inline [:param :foo]]` will now (correctly) inline the value of the parameter `:foo` whereas it previously produced `PARAMS SOURCE`. In addition, inlining has been extended to vector values, so `[:inline ["a" "b" "c"]]` will now produce `('a', 'b', 'c')` and `[:inline [:lift ["a" "b" "c"]]]` will now produce `['a', 'b', 'c']` which is what people seemed to expect (the behavior was previously unspecified).
|
||||
* Fix #353 by correcting handling of strings used as SQL entities (such as table names); this was a regression introduced by a recent enhancement to `:create-table`.
|
||||
* Fix #349 by adding an optional `:quoted` argument to `set-dialect!`.
|
||||
* Address #347 by adding example of adding a primary key to an existing table via `:add-index`.
|
||||
* Support `AS` aliasing in `DELETE FROM`.
|
||||
* Switch from `readme` to `test-doc-blocks` so all documentation is tested!
|
||||
* Clean up build/update deps.
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ The examples herein assume:
|
|||
```clojure
|
||||
(refer-clojure :exclude '[partition-by])
|
||||
(require '[honey.sql :as sql]
|
||||
'[honey.sql.helpers :refer [select from join-by left-join join
|
||||
'[honey.sql.helpers :as h :refer [select from join-by left-join join
|
||||
where order-by over partition-by window]])
|
||||
```
|
||||
|
||||
|
|
@ -89,6 +89,15 @@ user=> (sql/format {:alter-table :fruit :drop-index :look})
|
|||
["ALTER TABLE fruit DROP INDEX look"]
|
||||
```
|
||||
|
||||
You can use `:add-index` to add a primary key to an existing table, as follows:
|
||||
|
||||
```clojure
|
||||
user=> (-> (h/alter-table :fruit)
|
||||
(h/add-index :primary-key :id)
|
||||
(sql/format))
|
||||
["ALTER TABLE fruit ADD PRIMARY KEY(id)"]
|
||||
```
|
||||
|
||||
### rename-table
|
||||
|
||||
Used with `:alter-table`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue