https://github.com/babashka/babashka-sql-pods: Babashka pods for SQL databases
v0.1.5
One major new feature by @jhane: concurrent requests which can speed up things considerably.
And lots of upgrades, getting rid of CI bitrot mostly.
Also dropped support for mac intel (for this pod only). Could bring it back but GraalVM dropped support for mac intel in 25.0.2 so I'd have to special case the GraalVM version. Just let me know.
• https://github.com/babashka/babashka-sql-pods/issues/72: Handle concurrent requests (https://github.com/katangafor)
• Upgrade to Oracle GraalVM 25.0.2
• Upgrade next.jdbc to 1.3.1093
• Upgrade cheshire to 6.1.0 (Jackson 2.12 -> 2.20)
• Upgrade PostgreSQL JDBC driver to 42.7.10
• Upgrade MSSQL JDBC driver to 13.2.1
• Upgrade HSQLDB to 2.7.4
• Upgrade MySQL Connector/J to 9.6.0
• Remove DuckDB support (never worked)
• Upgrade transit-clj to 1.0.333
• Upgrade Clojure to 1.12.4
• Upgrade nrepl/bencode to 1.2.0
• Upgrade test deps: mariaDB4j to 3.3.0, embedded-postgres to 2.2.0
• Upgrade Oracle JDBC driver (`io.helidon.integrations.db/ojdbc`) to 4.3.4
• https://github.com/babashka/babashka-sql-pods/issues/51: macOS binaries are now aarch64 (Apple Silicon). Intel (x64) macOS binaries are no longer provided.
> I already had a ton of useful queries in babashka, so I wrote a script that sorta maps records across databases. You just supply relationships like "to get the ID to a foo record in the apples database, get this jsonb property from the bar column in the bananas database".
This mechanism of defining "resolvers" and automatic "connecting the dots" .. sounds quite like a job for #pathom to me. (and I just realized it can be used with babashka, nice! https://pathom3.wsscode.com/docs/tutorials/babashka/)
In fact we have similar situation in our job, sometimes having to jump between 2 different DBs (one is postgres, another one mssql) and bb + 2 sql pods already helped us to create a few bb scripts which need to interact on both dbs at once. If I think about it, bb, nice tuis, sql pods and perhaps even few pathom resolvers .. that can be very nice data drilling thing.
btw @jhane by any chance, did you hit any issue with rendering emojis in that tui?
thanks for all your time today, I'm so happy to have it working! The script I wanted it for is FLYING now
@jhane What was actually your use case for concurrent requests: querying different databases concurrently?
at work we have a very microservice-ey architecture, so related data is distributed across a whole bunch of databases. So when you get a bug report/ticket with a client ID, or see a message ID in a log, it can be a big hassle to get the whole context. You have to go into your database GUI and write a whole bunch of queries across multiple databases just to get basic info like "what user created this record?". Sometimes it's hard to even tell what it's an ID for. It just shows up in an error log among a bunch of JSON.
I already had a ton of useful queries in babashka, so I wrote a script that sorta maps records across databases. You just supply relationships like "to get the ID to a foo record in the apples database, get this jsonb property from the bar column in the bananas database".
When you supply it an ID
• looks at all the records you supplied in the relationship map, and checks if any of them contain a record with that ID (only searching indexed properties of course, usually primary keys)
• once it determines what type of record it is, it walks through all relations, and builds a lil graph of data.
So instead of fiddling around in datagrip for 15 minutes, you just slap an ID in the script and have everything you need. The concurrency was a huge improvement because now I can actually reach out to all databases at once (even multiple tables within the same database) instead of waiting for em one by one.
right, this makes a ton of sense. I asked because using the same connection (object) against the same database usually doesn't work when you bang at the db with multipl threads, so wanted to double check if this was actually for querying multiple dbs :)
oh that's good to know! I hadn't really checked if multiple threads against the same DB was working or not. But the multiple DBs is def the most important part
multipls conns against the same db should work, but not the same conn
or at least, postgres should handle it. sqlite doesn't I think
oooooh ok that makes sense, that's excellent
also @timok I made a TUI for this script with charm, and it's really slick. Being able to make TUIs with bb is just the best
Good news, everyone! clojure-mode 5.22 is out with many small improvements and bug-fixes! (check the release notes for all the details https://github.com/clojure-emacs/clojure-mode/releases/tag/v5.22.0)
While TreeSitter is the future of Emacs major modes, the present remains a bit more murky (e.g. not everyone is running modern Emacs or Emacs with TreeSitter support) and many people have asked that "classic" major modes continue to be improved and supported, alongside the newer TS-powered modes (in our case - clojure-ts-mode). Your voices have been heard! On Bulgaria's biggest national holiday (Liberation Day), you can feel liberated from any worries about the future of clojure-mode, as it keeps getting the love and attention that it deserves! Looking at the changelog - 5.22 is one of the biggest releases in the last few years and I hope you'll enjoy it! (I also hope I didn't break anything 😅 )
Thanks to everyone for your support! cider ❤️ 🇧🇬
Let me try Emacs 30 with clojure-ts-mode
what do I have to change to use it
> By default, clojure-ts-mode assumes command over all buffers and file extensions previously associated with clojure-mode (and derived major modes like clojurescript-mode).
I guess nothing then :)
hmm. when using clojure-ts-mode and pressing backspace here (+ 1 2 3)| it actually removes the paren instead of leaving the balanced parens and just removing 3. I guess I do need some config?
I had to add this:
;; clojure-ts-mode: use instead of clojure-mode
(add-to-list 'major-mode-remap-alist '(clojure-mode . clojure-ts-mode))
(add-to-list 'major-mode-remap-alist '(clojurescript-mode . clojure-ts-clojurescript-mode))
(add-to-list 'major-mode-remap-alist '(clojurec-mode . clojure-ts-clojurec-mode))
;; clojure-ts-mode: enable smartparens + LSP (same as clojure-mode)
(add-hook 'clojure-ts-mode-hook (lambda () (run-hooks 'prelude-lisp-coding-hook)))
(add-hook 'clojure-ts-mode-hook 'lsp)Hmm, I remember we had some auto remappings in clojure-ts-mode.
https://github.com/datalevin/datalevin: a simple, fast and versatile Datalog database, 0.10.7 is released:
• Document database features: auto indexing by paths, supporting EDN, JSON and Markdown documents.
• WAL transaction mode that enables increased write throughput for concurrent writers.
• In memory only mode for fast KV cache usage
• Atomic data migration from untyped to typed attributes when update-scheam
• FreeBSD support thx to @magra
• Many performance improvements and bug fixes.