This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-02
Channels
- # announcements (12)
- # babashka (7)
- # babashka-sci-dev (46)
- # beginners (35)
- # biff (1)
- # calva (4)
- # cider (22)
- # clj-kondo (48)
- # clj-on-windows (4)
- # clojure (132)
- # clojure-europe (161)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-uk (5)
- # clojurescript (39)
- # conjure (10)
- # core-typed (1)
- # cursive (48)
- # datalevin (6)
- # datascript (12)
- # datomic (9)
- # emacs (5)
- # events (1)
- # figwheel-main (2)
- # honeysql (7)
- # hyperfiddle (35)
- # improve-getting-started (8)
- # introduce-yourself (4)
- # london-clojurians (1)
- # off-topic (20)
- # podcasts-discuss (1)
- # re-frame (45)
- # reitit (5)
- # releases (2)
- # rum (7)
- # shadow-cljs (20)
- # spacemacs (4)
- # tools-build (58)
- # tools-deps (19)
- # xtdb (56)
Just published a blog post on adding support for alter column
and add constraint
. Seems like postgresql doesn’t support modify column
unless I’m missing something. Anyway, just wanted to check I wasn’t missing any obvious existing support for these to clauses. Cheers.
https://andersmurphy.com/2022/05/02/clojure-extend-honeysql-to-support-postgres-alter-column-and-add-constraint.html
I appreciate these clauses are only uses when when writing migrations (so not that common), but we write our migrations in honeysql. 😃
Ah, it seems modify column
is actually MySQL only and alter column
is the ANSI/other version. I'll create a GH issue and fix that.
@seancorfield Thanks! That makes sense. I assumed it was postgres being different to ANSI. But you are right it’s MySQL that’s different in this case. I’ll update the blog post to reference the ticket (not that I get much traffic it’s mainly personal reference material for when I forget how to do things).
Thanks for sharing the issue. I’ve been diving into the internals of honeysql so I’m curious to see what this sort of change would involve. One thing I did notice is that modify column
supports changing constraints where as alter column
does not, you need to use drop constraint
/ add constraint
as far as I can tell.
There's a ticket for standalone add index
I believe but not yet constraint
and not within the ... column
stuff. DDL is a bit of a "wild west" so adding support for it is a giant PITA quite often.