Fork me on GitHub
#babashka
<
2021-07-15
>
Cora (she/her)08:07:30

I just put together a little csv-to-yaml bb script and it was so nice to not have to install any libraries and have it work just perfectly

🎉 12
borkdude08:07:28

I see that clj-yaml now has a generate-stream function, but it's not mapped in bb yet. I'll add it.

Cora (she/her)08:07:59

I can't figure out a way to stream yaml out but this works well enough

Cora (she/her)08:07:24

I need to take off, it's incredibly late

Cora (she/her)16:07:20

does babashka have sqlite?

borkdude16:07:14

There are pods for every major type of database

lukasz16:07:33

H2 support would be nice in BB, even it was a custom build - it's the closest thing to sqlite in the JVM world I think

borkdude16:07:15

@lukaszkorecki There is a pod for hsqldb which is just about as close

lukasz16:07:30

will check it out!

lukasz16:07:37

Although, I found that being able to use CSV files directly from sqlite is most of the times enough for some data crunching, so my bb scripts usually just convert from some data format into CSV, and then all merging/processing happens in sqlite itself

lukasz16:07:53

a bit cumbersome, but works great for one-off or infrequent tasks

borkdude16:07:07

There is a feature flag for bb to include hsqldb if you need such a thing. Same for postgres.

👀 2
borkdude16:07:35

But the same can be accomplished using pods, with slightly more overhead in doing queries.

lukasz16:07:45

bb changes so fast, it easy way too easy to be out of the loop

borkdude16:07:34

The reason I haven't included any db solution so far is that there is too much to choose from: hsqldb, postgres, sqlite, datalevin, asami. Impossible to make everyone happy, this is why pods can be a more flexible approach without bloating bb with one solution.

borkdude16:07:42

The feature flags have been there for quite a while

lukasz16:07:07

Absolutely agree! Once you bundle one, there will be pressure to embed everything

borkdude16:07:27

yes, I had included the postgres one for maybe a week or so, but ended up reverting it for exactly this reason

borkdude16:07:20

although I love postgres, it didn't feel right considering the above

borkdude16:07:43

btw, the sqlite3 pod also shows how "easy" it is to implement a pod in golang, giving access to that ecosystem's libraries as well

borkdude16:07:20

I haven't tested the non-default feature flags in a long while, so it may need some polishing if you end up using it

lukasz16:07:21

Very handy, I'll take a look :thumbsup:

borkdude16:07:14

Adding more libs as optional feature flags is also welcome btw, if you end up using that within your company.

lukasz16:07:47

Right now the default build of bb works for us really well - we have monitoring daemons, rabbitmq queue management CLI and a couple of other things (config generators). Postgres support is something that I might be after, although pgmig already exists

borkdude16:07:20

Yep and the pod works really well. I've recently used it to migrate data from production to my local db

borkdude16:07:25

to debug a client problem

borkdude16:07:49

also honeysql works from source with bb, which makes it a really powerful combo