Fork me on GitHub
#babashka
<
2020-04-28
>
grzm20:04:08

Lovin’ myself some babashka!

grzm20:04:41

With respect to xml support with clojure.data.xml, it looks like xml/sexp-as-element is missing, or (more likely) I’m just Doing it wrong™

dpsutton20:04:43

user=> (dir clojure.data.xml)
element
emit-str
parse-str
nil
user=>

borkdude20:04:46

@grzm Ah, gotcha. I think that one isn't mapped.

borkdude21:04:00

let me add it for the next release

🚀 8
borkdude21:04:55

@grzm I now pushed the remaining vars to master. New binaries will appear in around 5 minutes in the #babashka_circleci_builds channel

borkdude21:04:20

Tested this locally:

$ ./bb '(xml/emit-str (xml/sexp-as-element [:parking-lot [:car {:color "red" :make "nissan"}]]))'
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><parking-lot><car make=\"nissan\" color=\"red\"/></parking-lot>"

grzm21:04:15

Sweetness! How long does it take to for changes to make it into macOS homebrew?

borkdude21:04:40

Depends on how often I release it. If it's urgent, I could do a new release tomorrow

grzm21:04:15

Well, you’d save me writing a custom function to do it 🙂

borkdude21:04:18

But if I release it, it's there more or less directly

borkdude21:04:14

Did you see my message about the #babashka_circleci_builds channel?

borkdude21:04:19

You can grab one from there right now

grzm21:04:27

Oh, great. I’ll do that.

grzm21:04:16

Works a treat. Thanks, @U04V15CAJ!

borkdude21:04:51

Cool! Are you using it for hiccup HTML generation or otherwise?

borkdude21:04:07

or just normal XML?

grzm21:04:53

Plain ol’ XML. Using that in conjunction with babashka.curl for some simple HTTP endpoint testing.

grzm21:04:48

Now to add some core.async goodness 🙂

borkdude21:04:14

I'm running a questionnaire about the new Postgres support. Do you have any opinion on this? The options are: - It's useful enough to keep it in, even if there's no support for other databases. - It's unnecessary, people can also shell out to psql - There should be another project called bb-sql which packs drivers for psql, etc + some SQL libraries The ultimate solution would be a library system for babashka, but that might be difficult to pull off.

grzm21:04:34

psql is very powerful, so I’ll likely use that in many cases, but the ability to get the data back into Clojure data would be really nice.

borkdude21:04:13

you mean psql the command line tool right?

grzm21:04:21

I’m for either keeping it in, or providing bb-sql (which is what I’d likely use by default)

borkdude21:04:08

mind you that bb-sql would not have all the things that bb has (e.g. XML would not be in it), so you would have to use them both to accomplish something like: produce XML and then stuff it in the db

grzm21:04:46

oh. Then I’m in favor of keeping it in bb 🙂

grzm21:04:59

I do like things to be in general lean, so I’m sympathetic to not including the kitchen sink. Setting those boundaries appropriately can be a tough call.

borkdude21:04:44

the driver for postgres was small enough to include imo, and worked great with graalvm, but it feels a bit asymmetric to support only one db maybe

borkdude21:04:01

there was one other DB that worked: hsqldb. It is currently behind a feature flag, so you can enable it if you want to compile yourself

borkdude21:04:10

thanks for your input

grzm21:04:50

Least I can do! babashka is going to change how I do command line scripting in so many positive ways.

grzm21:04:31

Yeah, completely agree on the asymmetry assessment. It’s nice that it’s in favor of the One True SQL Implementation (Long Live Stonebraker!), but, there remain the Great Unconvinced 🙂 which we should also be nice to

David Pham05:04:45

Adding sqlite could bring new type of functionalities