This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-01
Channels
- # atom-editor (11)
- # babashka (25)
- # beginners (142)
- # boot (9)
- # calva (3)
- # cider (19)
- # clara (15)
- # clj-kondo (6)
- # cljs-dev (20)
- # clojars (11)
- # clojure (164)
- # clojure-dev (9)
- # clojure-europe (6)
- # clojure-italy (17)
- # clojure-nl (3)
- # clojure-spec (19)
- # clojure-sweden (10)
- # clojure-uk (23)
- # clojurescript (34)
- # code-reviews (31)
- # conjure (20)
- # cursive (14)
- # datomic (54)
- # emacs (1)
- # fulcro (51)
- # graalvm (24)
- # graphql (6)
- # helix (3)
- # jobs (3)
- # kaocha (1)
- # malli (2)
- # meander (15)
- # off-topic (81)
- # pathom (2)
- # re-frame (43)
- # reagent (26)
- # reitit (1)
- # releases (1)
- # sci (12)
- # shadow-cljs (29)
- # sql (22)
- # timbre (3)
- # tools-deps (15)
@seancorfield it selects the foo
and bar
column from the joined table
select foo, bar from ...
would give you the plain hash map then?
When you have (foo, bar)
I think you're telling PG to produce a compound object.
Is there a way to use named parameters with raw next.jdbc calls, or should i go to honey/hug sql for that?
I'd probably be inclined to just use ?
three times here and pass the ID, the name, and the name again.
But I also might use HoneySQL for this which accepts named parameters and transforms them behind the scenes (you pass a hash map to the formatter and it expands to the regular ["SQL" param1 param2 param3]
format.
(I don't use HugSQL but I can see that being a good option too)
(macroexpand-1 '(expand-named-parameters-compile-time
"INSERT INTO PERSON (id, name) VALUES (:id, :name)
ON CONFLICT (id)
DO
UPDATE
SET name = :name
RETURNING id, name"
{:name (:person/name person)
:id (:person/id person)}))
=>
(clojure.core/let
[G__4732 (:person/name person) G__4733 (:person/id person)]
["INSERT INTO PERSON (id, name) VALUES (?, ?)
ON CONFLICT (id)
DO
UPDATE
SET name = ?
RETURNING id, name"
G__4733
G__4732
G__4732])
INSERT INTO PERSON (id, name) VALUES (:id, :name)
ON CONFLICT (id)
DO
UPDATE
SET name = :name
RETURNING id, name
I'm pretty rusty with SQL these days. Working on building a Tuple Space server implementation and considering the best way to handle the data including via SQL. If anyone could critique what I have so far and/or offer suggestions of alternatives https://gist.githubusercontent.com/mmower/289b56c1dc2811b5c26def554f2c8643/raw/a4333e1da2a7a40ca2fc8508c3a6bf6b432bd020/gistfile1.txt I'd welcome either. TIA.
@seancorfield thanks for all your work on next.jdbc and honeysql, I always enjoy coming back to Clojure/SQL stuff largely because it feels so sane!
Are there any examples on how to get windows authentication to work with next.jdbc and sql-server? Found some old examples here: https://stackoverflow.com/questions/6330688/connecting-to-microsoft-sql-server-using-clojure/6331367
I managed it by using the latest mssql driver, and by setting the jdbcUrl key for db.
https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15
You also need to store their auth dll somewhere on your java path
For the driver. Hope it helps!
Thanks David, I read through the docs yesterday and found a lot of places that has to be correctly configured 🙂
Did you manage to make it work?
Not yet David. Giving it another shot tomorrow