This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-03
Channels
- # announcements (11)
- # atom-editor (8)
- # aws (16)
- # babashka (34)
- # beginners (59)
- # calva (32)
- # cider (8)
- # clj-kondo (43)
- # cljs-dev (52)
- # clojure (26)
- # clojure-europe (11)
- # clojure-italy (2)
- # clojure-nl (5)
- # clojure-spec (16)
- # clojure-uk (44)
- # clojurescript (5)
- # core-async (21)
- # cursive (14)
- # datomic (53)
- # figwheel-main (4)
- # fulcro (5)
- # graphql (6)
- # java (3)
- # kaocha (5)
- # leiningen (6)
- # local-first-clojure (1)
- # malli (25)
- # off-topic (40)
- # other-languages (1)
- # pathom (5)
- # pedestal (3)
- # re-frame (4)
- # reitit (2)
- # reveal (8)
- # rum (21)
- # sci (16)
- # shadow-cljs (90)
- # spacemacs (8)
- # tools-deps (10)
- # vrac (6)
- # xtdb (12)
@joshuawood2894 here's an example of how to use pathom with postgres if it's helpful: https://chrisodonnell.dev/posts/giftlist/backend_persistence/ Not sure how different mssql might be.
@codonnell Thanks for the example! I'll check that out.
@wilkerlucio So I'm trying to create a Fulcro/Pathom application with a mssql db starting with the Fulcro template. In the template's Pathom parser, it has a /env-wrap-plugin
function that I'm trying to use to connect the db via next.jdbc
. This is how I'm handling it at the moment.
(def db {:dbtype "mssql"
:dbname ""
:host ""
:port ""
:user ""
:password ""})
(def con (jdbc/get-connection db))
(def ds (jdbc/get-datasource db))
.
.
.
::p/plugins [(pc/connect-plugin {::pc/register my-resolvers})
(p/env-wrap-plugin (fn [env]
;; Here is where you can dynamically add things to the resolver/mutation
;; environment, like the server config, database connections, etc.
(assoc env
:db ds
:connection con)))
This code compiles and I've tested to see if con
and ds
succeed in the repl.. no errors. The confusing part to me is when I write a resolver that matches content in my db and try to use Fulcro Inspect to run a query, the parser doesn't seem to wrap the connection e.c. the queries don't come back at all, not even with a 'not found'. Any suggestions? I am new to this architecture so there's surely something fundamental that I'm mission here.