parent
cbb3b3e90b
commit
d24ee428f3
2 changed files with 24 additions and 5 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# Changes
|
||||
|
||||
* 2.6.next in progress
|
||||
* Address [#536](https://github.com/seancorfield/honeysql/issues/536) by noting what will not work with PostgreSQL (but works with other databases).
|
||||
* Address [#533](https://github.com/seancorfield/honeysql/issues/533) by adding `honey.sql/*escape-?*` which can be bound to `false` to prevent `?` being escaped to `??` when used as an operator or function.
|
||||
* Address [#526](https://github.com/seancorfield/honeysql/issues/526) by using `format-var` in DDL, instead of `format-entity`.
|
||||
* Update JDK test matrix (adopt -> temurin, 19 -> 21).
|
||||
|
|
|
|||
|
|
@ -456,11 +456,6 @@ user=> (-> (alter-table :fruit)
|
|||
(drop-column :skin)
|
||||
sql/format)
|
||||
["ALTER TABLE fruit DROP COLUMN skin"]
|
||||
;; alter table alter column:
|
||||
user=> (-> (alter-table :fruit)
|
||||
(alter-column :name [:varchar 64] [:not nil])
|
||||
sql/format)
|
||||
["ALTER TABLE fruit ALTER COLUMN name VARCHAR(64) NOT NULL"]
|
||||
;; alter table rename column:
|
||||
user=> (-> (alter-table :fruit)
|
||||
(rename-column :cost :price)
|
||||
|
|
@ -473,6 +468,29 @@ user=> (-> (alter-table :fruit)
|
|||
["ALTER TABLE fruit RENAME TO vegetable"]
|
||||
```
|
||||
|
||||
The following does not work for PostgreSQL, but does work for several other databases:
|
||||
|
||||
```clojure
|
||||
;; alter table alter column:
|
||||
user=> (-> (alter-table :fruit)
|
||||
(alter-column :name [:varchar 64] [:not nil])
|
||||
sql/format)
|
||||
["ALTER TABLE fruit ALTER COLUMN name VARCHAR(64) NOT NULL"]
|
||||
```
|
||||
|
||||
For PostgreSQL, you need separate statements:
|
||||
|
||||
```clojure
|
||||
user=> (-> (alter-table :fruit)
|
||||
(alter-column :name :type [:varchar 64])
|
||||
sql/format)
|
||||
["ALTER TABLE fruit ALTER COLUMN name TYPE VARCHAR(64)"]
|
||||
user=> (-> (alter-table :fruit)
|
||||
(alter-column :name :set [:not nil])
|
||||
sql/format)
|
||||
["ALTER TABLE fruit ALTER COLUMN name SET NOT NULL"]
|
||||
```
|
||||
|
||||
The following PostgreSQL-specific DDL statements are supported
|
||||
(with the same syntax as the nilenso library but `sql/format`
|
||||
takes slightly different options):
|
||||
|
|
|
|||
Loading…
Reference in a new issue