cozodb / cozo

A transactional, relational-graph-vector database that uses Datalog for query. The hippocampus for AI!
https://cozodb.org
Mozilla Public License 2.0
3.24k stars 92 forks source link

Add MultiTransaction.run which takes TransactionPayload. #243

Closed liangxianzhe closed 4 months ago

liangxianzhe commented 4 months ago

For user who constructs the payload directly in Rust, this is slightly easier.

liangxianzhe commented 4 months ago

Thinking more, I guess this is still not the ideal API. I'm dropping this PR.

Perhaps a better way is to define something like pub type Payload = (String, BTreeMap<String, DataValue>), and use this new type in both single query and multi transaction. The benefit is that once user construct the payload, they can feed it into either APIs. Currently API has some inconsistency: the single query takes a &str, while multi transaction takes a String.

What do you think? It is not high priority though since user can always do this themselves.