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

transactional schema middleware #1

Merged
merged 1 commit into from
Jan 8, 2018
Merged

Conversation

bamarco
Copy link
Contributor

@bamarco bamarco commented Jan 8, 2018

No description provided.

@bamarco
Copy link
Contributor Author

bamarco commented Jan 8, 2018

The main purpose is to be able to use a transaction like

[{:db/ident :my.attr 
  :db/valueType :db.type/ref}] 

and have it recognized in datahike as part of the schema (which stores schema as a plain map).

It also enables all sorts of middleware for transactions which can allow for customization based on different performance needs.

I've decided against using transducers to replace db/transact-tx-data because db/explode needs recursion anyways and to use transducers I needed to create a bunch of Tempid objects which I'm assuming would hurt performance more than would be gained by using transducers. There may be asynchronous contexts where this will be desirable however. A halfway implementation can be found here: https://github.com/bamarco/datascript/tree/modular

This patch is a little more fully formed than tonsky/datascript#234 with some tests.

The efficiency could be sped up if schema changes did not require re-creating the indexes. The next step there would be completing the schema validation function.

@whilo whilo merged commit e7ccde3 into replikativ:master Jan 8, 2018
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

Successfully merging this pull request may close these issues.

2 participants