Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:db.fn/call behavior #366

Open
souenzzo opened this issue Sep 30, 2020 · 1 comment
Open

:db.fn/call behavior #366

souenzzo opened this issue Sep 30, 2020 · 1 comment

Comments

@souenzzo
Copy link

On datomic, when we call a "transaction function", the db that this function receive is the db before all transaction

In datascript 1.0.1, it receive a "partial db" relative to it's position in transaction

This behavior should be documented ?!

(let [conn (ds/create-conn)]
  (ds/transact! conn [[:db.fn/call println]
                      {:a 42}
                      [:db.fn/call println]
                      {:b 24}
                      [:db.fn/call println]]))
=>
#datascript/DB {:schema nil, :datoms []}
#datascript/DB {:schema nil, :datoms [[1 :a 42 536870913]]}
#datascript/DB {:schema nil, :datoms [[1 :a 42 536870913] [2 :b 24 536870913]]}
@tonsky
Copy link
Owner

tonsky commented Sep 30, 2020

Yes. Are you willing to provide a PR for e.g. README.md?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants