This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-12
Channels
- # announcements (10)
- # babashka (26)
- # beginners (113)
- # calva (75)
- # cider (7)
- # clj-http (1)
- # cljdoc (2)
- # cljfx (3)
- # cljs-dev (13)
- # clojure (79)
- # clojure-europe (21)
- # clojure-losangeles (2)
- # clojure-nl (4)
- # clojure-sweden (1)
- # clojure-uk (23)
- # clojureladies (4)
- # clojurescript (26)
- # clojureverse-ops (2)
- # conjure (2)
- # cursive (2)
- # data-science (1)
- # datalog (6)
- # datomic (1)
- # degree9 (2)
- # depstar (4)
- # esprit (3)
- # fulcro (25)
- # introduce-yourself (2)
- # jobs (3)
- # lsp (30)
- # meander (38)
- # missionary (9)
- # nbb (7)
- # news-and-articles (2)
- # off-topic (28)
- # pathom (46)
- # polylith (19)
- # re-frame (4)
- # reitit (2)
- # sci (8)
- # shadow-cljs (23)
- # specter (17)
- # spire (1)
- # tools-deps (16)
- # unrepl (1)
- # xtdb (30)
(clojure "-X:depstar" "uberjar"
":aliases" "[:uber-resources]"
":sync-pom" "true"
":aot" "true"
":jar" (deref *jar)
":main-class" (:main-class project)
":group-id" group-id
":artifact-id" artifact-id
":version" (str "\"" (deref *version-str) "\"")))
ah yes. but this is invoking a clojure process. so the compile path isn't related to the babashka environment itself
perhaps you need this? https://cljdoc.org/d/com.github.seancorfield/depstar/2.1.278/doc/getting-started/target-directory
:target-dir
Hi there I was trying to figure out if there is a way to use the postgres pod within my task. I see there is an ongoing discussion on how to include pods within tasks but dont know if there is some way to do this prior to it becoming a babashka feature.
@rohit_ you don't have to do anything specific to load pods in tasks, that will just work
you could make a -load-pod
tasks and then depend on that one before you require any other namespaces
so something like this
(pods/load-pod 'org.babashka/postgresql "0.0.7")
(require '(pod.babashka [postgresql :as pg]))
(pg/execute! db "select * from cluster")
would work?yeah, the problem is that all namespaces are required before any expressions are executed
perhaps put the code not within tasks and just in a .clj file and then call that from the tasks
so i should make a dependee task in a clj file that does this
(defn load-pods [] (pods/load-pod 'org.babashka/postgresql "0.0.7")
and then add the require in the target nslet me try that, thanks so much. I've been meddling around into getting the publics from the name space and I dont know that much about SciVars but it felt like there should be an easier answer
This would also work:
borkdude@MBP2019 /tmp $ cat bb.edn
{:paths ["."]
:tasks {sql db/main}}
borkdude@MBP2019 /tmp $ cat db.clj
(ns db)
(require '[babashka.pods :as pods])
(pods/load-pod 'org.babashka/postgresql "0.0.7")
(require '[pod.babashka.postgresql :as psql])
(defn main []
(psql/execute! <db> "select * from foo"))
borkdude@MBP2019 /tmp $ bb sql
i'll try this this is great thank you so much