This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-01
Channels
- # announcements (19)
- # asami (4)
- # babashka (34)
- # beginners (137)
- # calva (22)
- # cider (4)
- # clj-kondo (25)
- # cljs-dev (4)
- # clojure (67)
- # clojure-australia (1)
- # clojure-berlin (1)
- # clojure-europe (35)
- # clojure-germany (3)
- # clojure-nl (5)
- # clojure-serbia (3)
- # clojure-uk (8)
- # clojuredesign-podcast (2)
- # clojurescript (11)
- # conjure (56)
- # data-oriented-programming (1)
- # datascript (1)
- # datomic (6)
- # deps-new (11)
- # eastwood (1)
- # fulcro (11)
- # honeysql (48)
- # inf-clojure (1)
- # jobs (1)
- # joker (6)
- # lsp (26)
- # malli (2)
- # meander (3)
- # off-topic (48)
- # pathom (4)
- # polylith (4)
- # re-frame (19)
- # releases (2)
- # remote-jobs (1)
- # rewrite-clj (127)
- # shadow-cljs (6)
- # spacemacs (3)
- # tools-deps (43)
- # xtdb (16)
@richiardiandrea Maybe you are wrapping the arguments inside a vector while they should not be?
the first param is a vector that I want to store as json, the second and third two uuids
there are docs for this: https://github.com/babashka/babashka-sql-pods/#json
yeah that is the goal, i initially tried with the metadata but it was spitting that error then worked around it with json/generate-string
let me share that yeah, just a sec
this is what it is not working
(defn update-diagnostic-report-descriptors!
[db-or-tx image]
(let [target-report (:target-report image)
query "UPDATE diagnostic_reports SET image_descriptors = (?::jsonb) WHERE id = ? AND version_id = ?"
sqlvec [query
^{:pod.babashka.sql/write :jsonb} (:image-descriptors image)
(:id target-report)
(:version-id target-report)]]
(db/execute-one! db-or-tx sqlvec)))
you need to write:
(with-meta (:image-descriptors image) {:pod.babashka.sql/write :jsonb} )
but in hindsight, I think I will change this, because this isn't very nice to writeI think I'll just offer (db/json ...)
and (db/jsonb ...)
that will handle this for you
ok let me try that...and why is that the case? I actually remember that I had to wrap some of my params in a function for attaching metadata once..
looks like that worked
this also works
> (def v ^{:pod.babashka.sql/write :jsonb} [])
#<SciVar@28395993: []>
> (meta v)
{:pod.babashka.sql/write :jsonb}
anyways, thank you for the hint 😄
yes, that works, but (meta ^{:m 1} (conj [] nil))
doesn't work
so I think it's better to just offer some function that handles these details
https://github.com/babashka/babashka-sql-pods/issues/31
I want to use https://github.com/retro/graphql-builder with babashka. It has dependencies which use java.util.concurrent...
stuff. What are my options here? Put graphql-builder in a pod? Rebuild babashka with java.util.concurrent?
I'd prefer to just add the necessary classes to upstream babashka. I assume the downsides are this expands the bb
binary size?
@gdwarner You can make an issue where you request the class with some evidence that this is useful for scripting and I'll take a look
@gdwarner I tried this myself and this is needed in clj-antlr which in turn needs the java ANTLR library which is not supported in babashka
Hi there, question about pods, is there a way to have load-pod
save to a local folder? I like the structure of ~/.babashka/pods/repository/org.babashka
and I would like to replicate it and then tar everything for distribution.
@richiardiandrea Currently not, but we could make this configurable perhaps, via some env var?
I'm also still conflicted between ~/.babashka
and ~/.bb
. In the future people might have a bb.edn
there too...
yeah, cause it's a bit cumbersome to download stuff manually like in this approach
https://github.com/eccentric-j/idle-parens/blob/8f4142d66698adadb321ace92da9ed79bbcbcedc/resources/blog/2021-01-27-clojure-like-its-php.md#the-clojure-files
Additionally, given pods are OS dependent, you would need to specify the target...
Yeah specifying pods in bb.edn
is a good option..what about this
{:paths ...
:deps ...
:pods {org.babashka/postgresql :github/version "0.0.5"}
And then
bb dump-pods <dir> <arch>
Yeah, something like that might work. Perhaps:
bb pods install /tmp/pods --arch ....
but then also:
{:pods {:dir "/tmp/pods" ....}}
if you want to load the pods from some specific diroh yes right good idea!
gonna open a feature request and start checking how difficult that would be to implement 😄