This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-31
Channels
- # aleph (1)
- # announcements (2)
- # beginners (20)
- # calva (44)
- # cider (60)
- # clj-kondo (6)
- # clojure (27)
- # clojure-dev (2)
- # clojure-europe (8)
- # clojure-italy (18)
- # clojure-mexico (5)
- # clojure-nl (61)
- # clojure-spec (12)
- # clojure-uk (101)
- # clojurescript (82)
- # cursive (2)
- # data-science (21)
- # datomic (24)
- # fulcro (19)
- # graalvm (5)
- # hoplon (11)
- # jobs-discuss (35)
- # juxt (7)
- # keechma (6)
- # off-topic (21)
- # pedestal (5)
- # planck (2)
- # qa (43)
- # re-frame (3)
- # reagent (7)
- # reitit (4)
- # rewrite-clj (12)
- # sql (10)
- # testing (4)
- # tools-deps (6)
- # vim (23)
- # xtdb (3)
@seancorfield sorry for reply so late. I was thinking the helpers should have a version to get sql-params
. But it doesn't matter to much
@mpenet did a first draft of the vertx-sql-client wrapper with porsas, same api & mappers work as with sync, just an extra callback to handle the received results. Will polish and push out for benchmark testing:
(require '[porsas.async :as pa])
(def pool (pa/pool
{:database "hello_world"
:host "localhost"
:port 5432
:user "benchmarkdbuser"
:password "benchmarkdbpass"
:size 1}))
(def mapper (pa/data-mapper))
(pa/query-one mapper pool ["SELECT id, randomnumber from WORLD where id=$1" 1] println)
; ...prints {:id 1, :randomnumber 6233}
need to test how the pool size effects things, should require less open connections at least, maybe 1 is enough..
also, will push a separate ns which will have a fast mapper for next.jdbc
, maybe a ns porsas.next
? 😉
hello guys
i'm having a little problem here
Hi everyone, I'm developing a application that uses with a database, for that I am using two libraries: [clojure.java.jdbc :as jdbc] [java-jdbc.sql :as sql] In the sql I'm trying to do a where with an operator "<" but I had tried many things and isnt working: My code (jdbc/query database (sql/select * table-name (sql/where conditions))) conditions -> {:id ["<" 50]} Someone can help me how I pass the arguments for the sql/where?
i'm trying to connect to a postgres database inside a docker container, here's my db-spec
(defn db
([db-name]
{:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:dbtype "postgresql"
:dbname db-name
:subname (str "//postgres:5432/" db-name)
:user "postgres"
:password "Password"})
([]
(db db-name)))
on the :subname, i'm using the docker container service name, because docker-compose automatically manages the ip address for me, but when i run the containers, my web app tries to connect to the address 127.0.0.1:5432, any ideas why?oh nevermind, from the jdbc documentation: "For databases that require a hostname or IP address, java.jdbc assumes "127.0.0.1" but that can be overidden with the :host option."