Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ dbval only needs the key portion. Consequently, you are dealing with a sorted
set and Datascript's core is a
[persistent-sorted-set](https://github.com/tonsky/persistent-sorted-set).

The storage layer is pluggable via the `dbval.store` protocol: a store only
has to provide ordered range scans over committed keys and atomic batch
commits. `dbval.store.sqlite` is the default backend and
`dbval.store.memory` provides an in-memory store for tests. Note that dbval
ships no storage driver — to use the default SQLite store, add
`org.xerial/sqlite-jdbc` to your dependencies (like with
[next.jdbc](https://github.com/seancorfield/next-jdbc), you bring the driver
for the store you pick).

I first assumed that I need to make one part of a datom mutable, so that I can
mark it as retracted. Until I discovered that the sorting of `t` in the Datomic
indexes `:eavt`, `:aevt`, `:avet` and `:vaet` allows to figure out what the
Expand Down
7 changes: 4 additions & 3 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{:deps
{org.foundationdb/fdb-java {:mvn/version "7.3.47"}
org.xerial/sqlite-jdbc {:mvn/version "3.47.1.0"}
com.yetanalytics/colossal-squuid {:mvn/version "0.1.5"
:exclusions
[ ;; important to avoid `java.lang.NoSuchMethodError: 'boolean com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)' at com.google.cloud.secretmanager.v1.ListSecretsRequest.getSerializedSize(ListSecretsRequest.java:355)`
Expand Down Expand Up @@ -30,7 +29,8 @@
:jvm-opts ["-ea" "-Ddbval.debug" "-Dclojure.main.report=stderr" "-Djdk.attach.allowAttachSelf"]
:extra-deps
{io.github.tonsky/duti {:git/sha "e36d65296a4f9758664309ec35b00887e88c405a"}
com.cognitect/transit-clj {:mvn/version "1.0.324"}}}
com.cognitect/transit-clj {:mvn/version "1.0.324"}
org.xerial/sqlite-jdbc {:mvn/version "3.47.1.0"}}}

:bench
{:extra-paths ["bench"]
Expand All @@ -39,4 +39,5 @@
"-Djdk.attach.allowAttachSelf"
"-XX:+DebugNonSafepoints"]
:extra-deps
{io.github.tonsky/duti {:git/sha "e36d65296a4f9758664309ec35b00887e88c405a"}}}}}
{io.github.tonsky/duti {:git/sha "e36d65296a4f9758664309ec35b00887e88c405a"}
org.xerial/sqlite-jdbc {:mvn/version "3.47.1.0"}}}}}
7 changes: 5 additions & 2 deletions src/dbval/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,11 @@

Options are:

:db-file <string> Path to the SQLite file backing this database.
Defaults to a fresh temporary file."
:store <dbval.store/ITupleStore> The tuple store backing this database.
Defaults to a SQLite store (see dbval.store.sqlite);
dbval.store.memory provides an in-memory store.
:db-file <string> Path to the SQLite file backing this database, when no
:store is given. Defaults to a fresh temporary file."
([]
(db/empty-db nil {}))
([schema]
Expand Down
Loading
Loading