Fork me on GitHub
#asami
<
2021-09-27
quoll01:09:19

It’s not built in. I actually do something like that when I’m emulating transactions on Datomic. • On start-transaction, start a with-db • Every call to transact also gets sent to a log. Because it’s using a with-db then the results of the transact operations are visible, even though they’re not being kept (but the log is keeping it for me) • On commit, replay the entire log as a single transact against the original connection.

zeitstein11:09:48

Will investigate further. Many thanks for your kind help!

mpenet11:09:46

Is there any plan to support a storage backend such as FoundationDB in the future? Seems like it could be a good fit

mpenet11:09:31

but I guess that might require some deep changes in the way IO is handled (since iirc now it's all "blocking")

mpenet11:09:02

and potentially another storage impl based on something different than AVL (to leverage some out-of-the-box capabilities of Fdb), but that's another subject

quoll13:09:19

Yes, it's all blocking now. I’m planning on doing a node-like approach where both sync and async APIs are available. The code should be similar, since I can use the Promesa library to maintain a lot of the code structure (even if it compiles down to something completely different).

quoll13:09:29

It will take me a while to get to it though

mpenet15:09:00

that sounds good!

mpenet15:09:44

datahike does something like this, but mixin sync/async via macros can become hairy, stuff like error handling in particular doesn't translate always well

mpenet15:09:34

but I guess there aren't many solutions to this if you want to keep decent sync performance

mpenet15:09:49

function calls/closures etc do add overhead

quoll15:09:12

Exactly. I don't want to slow down the synchronous code

quoll15:09:29

Though I hate the idea of duplication 😢

mpenet15:09:50

I think for pathom3 some profiling was done to compare promesa vs raw sync vs other solutions

mpenet15:09:13

promesa came quite close to raw sync in most cases

mpenet15:09:11

maybe just having a single promesa based path is not so crazy if these numbers add up

mpenet15:09:16

and waiting for loom is not an option I guess since that wouldn't work for cljs

alandipert19:09:44

@quoll i can't figure out how to edit the wiki, but i noticed a small typo in the example for https://github.com/threatgrid/asami/wiki/3.-Loading-Data#json, (d/transact conn {:tx-data data})) has an extra trailing paren

👍 1
alandipert19:09:19

(using asami at work for JSON spelunking. working great so far! 🎊 )

😊 1
quoll19:09:41

This has turned out to be a really useful application of Asami that I never expected

alandipert20:09:59

hm, is there an example floating around of querying within a single JSON object? i think i have the wrong mental model for dealing with e.g. object key values

alandipert20:09:10

and the "root" object is JSON object, not an array

alandipert20:09:00

Nevermind, found docs 🙂