I was messing around with sending multiple queries to the babashka sql pod concurrently, and it seems like the pod's :invoke function https://github.com/babashka/babashka-sql-pods/blob/132f0e6e67b6e4e7463d0e25b25305f05b1f6b0d/src/pod/babashka/sql.clj#L314. So for instance, if you send two queries from different threads in your bb script, they'll still have to wait to process in order.
Do pods have to process requests in order? Is that how the pod protocol works?
sorry I forgot about this. yes, multiple parallel requests in pod seem good
I guess it doesn't have to but that's like how it works currently. We could try to change it
have you also looked at the pod client code in babashka.pods? I think it suppors parallism but not 100% sure
I have not! I'll take a look in a bit
Ok it actually seems like the pod client does support parallel requests! I don't understand the whole flow (am quite noobish in clojure world) but it looks like • each request gets a UUID • the write function https://github.com/babashka/pods/blob/ed5e1f3390b9dfca564f66b6e79c739c3cd82d78/src/babashka/pods/impl.clj#L20 • maybe each request https://github.com/babashka/pods/blob/ed5e1f3390b9dfca564f66b6e79c739c3cd82d78/src/babashka/pods/impl.clj#L112?
How would you feel about a PR to make the sql pod handle multiple requests in parallel?
No prob, just opened a PR. My first ever open source PR, in fact!
I got it working with a write lock and virtual threads. Tried it out on a work script that scans a bunch of databases for a given ID, and it knocked it down from 25 seconds to 1.5 seconds!!
PR looks great!
• I'm fixing some CI issues and will ask you to merge with master later. • Perhaps you can also add concurrent transaction tests, since transactions are a bit involved in the pod. I expect them to work though. • Perhaps an uncaught exception handler on the virtual thread to log an error which would otherwise go unnoticed
alright sounds excellent!!
alright, merge with master and push. CI should be working again
awesome, looks like CI is running. I'll add the transactions + concurrency tests and the exception on the virtual thread
oops, I upgraded to GraalVM 25 which seems to break other stuff. I'll fix it meanwhile
👍
ok merge once more
alrighty looks like the tests are running again
let me fix one more thing
the uberjar was built using JDK 11 instead of 25
but now it should work
merge again
merged it
looks like tests are passing! I had a reflection problem cause I wasn't type hinting the exception handler. Had no idea what I was looking at but claude figured it out right away lol. If babashka didn't already exist I might have more interest in learning how to compile clojure with graal
merged
github is very flaky right now though, so I'll release later. https://www.githubstatus.com/
ah yeah I did see that. Amazing news though!! Please let me know when you release, I'm so excited hahaha
is there a pod to encrypt stuff with gpg in babashka ?
You can shell out to the gpg binary?
Or you can use the buddy pod but this seems overkill probably
i'm thinking about a simple vault (secret manager) sops and the other options are overkill imho 😄
i would love to share env files securly with people in my team
I saw a thing for this on HN today: https://github.com/GreatScott/enveil
or maybe it's similar but not quite what you're looking for
ok this looks interesting so basically it starts a shell for you with all the env variables in the shell session right?
at least thats what i understand from that
don't know exactly
interesting so the idea is great but the point i'm missing is secret sharing
this is hiding it afaik
there's solutions for this, basically password managers with team access
yes but this isn't like a vault 😄
i like this enveil idea that is pretty great actually
i'm trying to write a spec for a macro, and i'm relying on :clojure.core.specs.alpha/param-list. however, when i run this in babashka, it fails because that doesn't exist. do the clojure core specs exist in babashka somewhere?
as defined here: https://github.com/clojure/core.specs.alpha/blob/master/src/main/clojure/clojure/core/specs/alpha.clj
if you include the deps, then yes, I think
okay, cool