This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-05
Channels
- # announcements (1)
- # asami (21)
- # aws (19)
- # babashka (37)
- # beginners (38)
- # clj-kondo (7)
- # clj-otel (8)
- # clojure (29)
- # clojure-europe (54)
- # clojure-nl (3)
- # clojure-spec (2)
- # clojure-uk (2)
- # clojurescript (15)
- # conjure (1)
- # data-science (1)
- # datomic (21)
- # emacs (6)
- # events (3)
- # figwheel-main (1)
- # gratitude (13)
- # holy-lambda (11)
- # joyride (6)
- # klipse (3)
- # malli (14)
- # missionary (26)
- # nbb (31)
- # omni-trace (2)
- # pathom (3)
- # reagent (1)
- # reitit (1)
- # releases (1)
- # shadow-cljs (24)
- # sql (27)
- # tools-deps (4)
- # vim (21)
I have a question about awyeah-api
. The README specifies a specific git hash to use for the dependency on it and a specific git-hash for the dependency on org.babashka/spec.alpha
. Is the idea I use those specific versions only forever? Or am I supposed to take the git-hash from current master
or is there some other strategy I must use?
@U2G3G2S6S Yes, just take the SHAs from both master branches and upgrade when necessary
:thumbsup:
Is prepare
supposed to download pods? I'm seeing some inconsistencies which I don't understand. (I'm posting shell output in the thread.)
% ../target/layer/bin/bb version
babashka v0.8.158-SNAPSHOT
% ../target/layer/bin/bb --config ./bb.edn prepare
% stat $BABASHKA_PODS_DIR
stat: cannot statx '/home/pieter/.../.pods-dir': No such file or directory
% ../target/layer/bin/bb --config ./bb.edn -e "(require '[babashka.pods]) (babashka.pods/load-pod 'tzzh/mail \"0.0.2\")"
Downloading pod tzzh/mail (0.0.2)
Successfully installed pod tzzh/mail (0.0.2)
#:pod{:id "pod.tzzh.mail"}
% cat bb.edn
{:paths ["src"]
:deps {}
:pods {tzzh/mail {:version "0.0.2"}}}
% stat $BABASHKA_PODS_DIR
File: /home/pieter/.../.pods-dir
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 10302h/66306d Inode: 10485967 Links: 3
Access: (0775/drwxrwxr-x) Uid: ( 1000/ pieter) Gid: ( 1000/ pieter)
Access: 2022-07-05 15:01:45.531117414 +0200
Modify: 2022-07-05 15:01:45.531117414 +0200
Change: 2022-07-05 15:01:45.531117414 +0200
Birth: 2022-07-05 15:01:45.531117414 +0200
It should, yes:
prepare Download deps & pods defined in bb.edn and cache their metadata.
I have a bb.edn
that contains a reference to a pod I want to use. I'm in the same directory as this file.
I set BABASHKA_PODS_DIR
and run prepare
but it does not download anything.
If I eval (load-pod ...)
then the download happens, and it's using the correct BABASHKA_PODS_DIR
.
so the prepare
does not trigger the downloading of the pod
sure...
% rm -rf $BABASKHA_PODS_DIR
% ../target/layer/bin/bb --config ./bb.edn -e "(+ 1 2 3)"
6
% ../target/layer/bin/bb --config ./bb.edn -e "(require '[babashka.pods]) (babashka.pods/load-pod 'tzzh/mail \"0.0.2\")"
Downloading pod tzzh/mail (0.0.2)
Successfully installed pod tzzh/mail (0.0.2)
#:pod{:id "pod.tzzh.mail"}
no, it does not download the pod in the bb.edn
if I just eval a simple expression
I feel like such an idiot. I'm sorry... the mistake was on my side. There was an extra }
in the bb.edn
file, which messed things up
I was like it's almost like it's ignoring the bb.edn
file and that was because the file was invalid.
Thanks for looking, sorry for wasting space.
:thumbsup:
extra }
is the clojure equivalent of the extra ;
problem in other languages i think :rolling_on_the_floor_laughing:
esp when I' just quickly using nano
to edit, rather than something with smartparens...
pictured: balancing parens without proper tooling https://twitter.com/madeofmistak3/status/1450094940223000578
might be nice to spit out a warning in this case like: "I found a file named bb.edn but I couldn't use it because X"?
yes, the bb.edn
file had unbalanced brackets of many kinds and if it showed a warning about that, I might have not bothered anybody here about it.
https://clojurians.slack.com/archives/C1Q164V29/p1657033467025239 from #sql...
Has anyone used babashka along with Postgres COPY FROM
to populate their DB from EDN? One suggestion was to convert the EDN to CSV using bb with data.csv first. Just wondering if someone has experience at this intersection of Postgres + jdbc and potentially babashka as the FROM PROGRAM
.
I have been using HoneySQL in my program. Even with prepared statements and :auto-commit false
, inserting a large number of records is pretty slow. I'm hoping COPY FROM
can be of help, but it doesn't look like it can be https://github.com/seancorfield/next-jdbc/issues/136#issuecomment-663383750, so I don't think HoneySQL has much of a role here.
But I haven't been using next.jdbc for very long and I'd be happy to learn that I'm mistaken.
This may or may not suit your use case, but I have a (admittedly incomplete) library that uses Clojure protocols + jdbc connection to do postgres COPY
for bulk import: https://github.com/jgdavey/clj-pgcopy
Thanks @U0AUQ25KP! I'll try that out and read through the source.