Parse the string representation of a Clojure keyword into a Keyword object.
Builds a Connection from URI
Builds a Connection from URI
In order to benefit from Datomic facilities based on implicit Connection, you should put a connection in an implicit val in your scope. You can also use Connection explicitly.
implicit val conn = Datomic.connection("datomic:mem://mydatabase")
The URI of Datomic DB
Connection
Creates a new database using uri
Creates a new database using uri
the Uri of the DB
true/false for success
The database associated to the implicit connection
The database associated to the implicit connection
implicit conn = Datomic.connect("datomic:mem://mydatabase") database.transact(...)
Deletes an existing database using uri
Deletes an existing database using uri
the URI of the DB
true/false for success
converts a DatomicData to a type given there is the right implicit in the scope
converts a DatomicData to a type given there is the right implicit in the scope
val l: String = Datomic.fromDatomic("toto") val s: Long = Datomic.fromDatomic(5L: java.lang.Long)
Creates a heterogenous, untyped java.util.List
from simple types using DWrapper implicit conversion
Creates a heterogenous, untyped java.util.List
from simple types using DWrapper implicit conversion
val addPartOp = Datomic.list("toto", 3L, "tata")
Runtime-based helper to create multiple Datomic Operations (Add, Retract, RetractEntity, AddToEntity) compiled from a Clojure String.
Runtime-based helper to create multiple Datomic Operations (Add, Retract, RetractEntity, AddToEntity) compiled from a Clojure String. This is not a Macro so no variable in string and it is evaluated at runtime
You can then directly copy some Clojure code in a String and get it parsed at runtime. This is why
it returns a Try[Seq[TxData]]
It also manages comments.
val ops = Datomic.parseOps(""" ;; comment blabla [:db/add #db/id[:db.part/user] :db/ident :character/weak] ;; comment blabla [:db/add #db/id[:db.part/user] :db/ident :character/dumb] [:db/add #db/id[:db.part/user] :db/ident :region/n] [:db/retract #db/id[:db.part/user] :db/ident :region/n] [:db/retractEntity 1234] ;; comment blabla { :db/id #db/id[:db.part/user] :person/name "toto, tata" :person/age 30 :person/character [ :character/_weak :character/dumb-toto ] } { :db/id #db/id[:db.part/user], :person/name "toto", :person/age 30, :person/character [ :character/_weak, :character/dumb-toto ] } """)
a sequence of operations or an error
Returns the partition of this entity id
Returns the partition of this entity id
(Copied from Datomic docs)
the partition of the given entity id
Renames an existing database using uri
Renames an existing database using uri
the URI of the DB
the new name
true/false for success
Shutdown all Peer resources.
Shutdown all Peer resources. Copied from Datomic Javadoc: This method should be called as part of clean shutdown of a JVM process. Will release all Connections, and, if shutdownClojure is true, will release Clojure resources. Programs written in Clojure can set shutdownClojure to false if they manage Clojure resources (e.g. agents) outside of Datomic; programs written in other JVM languages should typically set shutdownClojure to true.
Constructs a semi-sequential UUID useful for creating UUIDs that don’t fragment indexes
Constructs a semi-sequential UUID useful for creating UUIDs that don’t fragment indexes
(Copied from Datomic docs)
a UUID whose most signigicant 32 bits are currentTimeMillis rounded to seconds
Get the time part of a squuid
Get the time part of a squuid
(Copied from Datomic docs)
a UUID created by squuid()
the time in the format of System.currentTimeMillis
Converts any value to a DatomicData given there is the right ToDatomicCast in the scope
Converts any value to a DatomicData given there is the right ToDatomicCast in the scope
val s: String = Datomic.toDatomic("toto") val l: java.lang.Long = Datomic.toDatomic("5L")
Returns the t value associated with this tx
Returns the t value associated with this tx
(Copied from Datomic docs)
a transaction entity id
a database basis T point
Returns the tx associated with this t value.
Returns the tx associated with this t value.
(Copied from Datomic docs)
a database basis T point
a transaction entity id
Performs an Datomic async transaction with multiple operations.
Performs an Datomic async transaction with multiple operations.
Datomic.transact( AddToEntity(DId(Partition.USER))( person / "name" -> "toto", person / "age" -> 30L ), AddToEntity(DId(Partition.USER))( person / "name" -> "tata", person / "age" -> 54L ) ).map{ tx => ... }
the implicit Connection
the implicit scala.concurrent.ExecutionContext
A future of Transaction Report
Performs an Datomic async transaction with multiple operations.
Performs an Datomic async transaction with multiple operations.
Datomic.transact(Seq( AddToEntity(DId(Partition.USER))( person / "name" -> "toto", person / "age" -> 30L ), AddToEntity(DId(Partition.USER))( person / "name" -> "tata", person / "age" -> 54L ) )).map{ tx => ... }
a sequence of TxData
the implicit Connection
the implicit scala.concurrent.ExecutionContext
A future of Transaction Report
Main object containing: