trait GetAsyncJson extends AnyRef
Asynchronous data getter methods on molecules returning Future-wrapped Json String.
Molecule builds a Json String directly from the untyped raw Datomic data.
Attributes names are used as Json field names. In order to distinguish
fields from each other, all attribute names are prepended with the namespace
name (in lowercase). For a namespace Person
with an attribute name
we get:
- "person.name"
To distinguis fields of multiple relationships to the same namespace like friends
and
enemies
pointing to other Person
's require us to add a relationship name prefix too:
- "friends.person.name"
- "enemies.person.name"
Furthermore, if the attribute is part of a transaction meta-data molecule, we prefix that with tx
too:
- "tx.person.name"
- "tx.friends.person.name"
Example:
val jsonFuture: Future[String] = Person.name.age.getAsyncJson for { json <- jsonFuture } yield { json === """[ |{"person.name": "Ben", "person.age": 42}, |{"person.name": "Liz", "person.age": 37} |]""".stripMargin }
Each asynchronous getter in this package simply wraps the result of its equivalent synchronous getter (in the
get
package) in a Future. getAsyncIterableAsOf
thus wraps the result of getIterableAsOf
in a Future and so on.
- Self Type
- GetAsyncJson with MoleculeBase with GetJson with JsonBuilder
- Source
- GetAsyncJson.scala
- See also
- Grouped
- Alphabetic
- By Inheritance
- GetAsyncJson
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def getAsyncJson(n: Int)(implicit conn: Conn): Future[String]
Get
Future
with json data for n rows matching molecule.Get
Future
with json data for n rows matching molecule.
Namespace.Attribute is used as json fields. Values are quoted when necessary. Nested data becomes json objects etc.
For more info and code examples see equivalent synchronous getJson method.- n
Number of rows returned
- conn
Implicit Conn value in scope
- returns
String of json
- See also
- def getAsyncJson(implicit conn: Conn): Future[String]
Get
Future
with json data for all rows matching molecule.Get
Future
with json data for all rows matching molecule.
Namespace.Attribute is used as json fields. Values are quoted when necessary. Nested data becomes json objects etc.
For more info and code examples see equivalent synchronous getJson method.- conn
Implicit Conn value in scope
- returns
String of json
- See also
- def getAsyncJsonAsOf(date: Date, n: Int)(implicit conn: Conn): Future[String]
Get
Future
with json data for n rows matching molecule as of tx.Get
Future
with json data for n rows matching molecule as of tx.
Get data at a human point in time (a java.util.Date).
For more info and code examples see equivalent synchronous getJsonAsOf method.- date
java.util.Date
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
asof
/since
- def getAsyncJsonAsOf(date: Date)(implicit conn: Conn): Future[String]
Get
Future
with json data for all rows matching molecule as of date.Get
Future
with json data for all rows matching molecule as of date.
Get data at a human point in time (a java.util.Date).
For more info and code examples see equivalent synchronous getJsonAsOf method.- date
java.util.Date
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
asof
/since
- def getAsyncJsonAsOf(tx: TxReport, n: Int)(implicit conn: Conn): Future[String]
Get
Future
with json data for n rows matching molecule as of tx.Get
Future
with json data for n rows matching molecule as of tx.
Datomic's internalasOf
method can take a transaction entity id as argument to retrieve a database value as of that transaction (including).
Instead of supplying the transaction entity id, in Molecule we supply a TxReport that contains the transaction entity id (which is used as argument to Datomic internally). This is more convenient when using Molecule since we get a TxReport from transaction operations likeget
,update
,retract
etc.
For more info and code examples see equivalent synchronous getJsonAsOf method.- tx
TxReport (returned from all molecule transaction operations)
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
asof
/since
- def getAsyncJsonAsOf(tx: TxReport)(implicit conn: Conn): Future[String]
Get
Future
with json data for all rows matching molecule as of tx.Get
Future
with json data for all rows matching molecule as of tx.
Datomic's internalasOf
method can take a transaction entity id as argument to retrieve a database value as of that transaction (including).
Instead of supplying the transaction entity id, in Molecule we supply a TxReport that contains the transaction entity id (which is used as argument to Datomic internally). This is more convenient when using Molecule since we get a TxReport from transaction operations likeget
,update
,retract
etc.
For more info and code examples see equivalent synchronous getJsonAsOf method.- tx
TxReport (returned from all molecule transaction operations)
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
asof
/since
- def getAsyncJsonAsOf(t: Long, n: Int)(implicit conn: Conn): Future[String]
Get
Future
with json data for n rows matching molecule as of transaction timet
.Get
Future
with json data for n rows matching molecule as of transaction timet
.
Transaction timet
is an auto-incremented transaction number assigned internally by Datomic.
t
can for instance be retrieved in a getHistory call for an attribute and then be used to get data as of that point in time (including that transaction).
For more info and code examples see equivalent synchronous getJsonAsOf method.- t
Transaction time t
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
asof
/since
- def getAsyncJsonAsOf(t: Long)(implicit conn: Conn): Future[String]
Get
Future
with json data for all rows matching molecule as of transaction timet
.Get
Future
with json data for all rows matching molecule as of transaction timet
.
Transaction timet
is an auto-incremented transaction number assigned internally by Datomic.
t
can for instance be retrieved in a getHistory call for an attribute and then be used to get data as of that point in time (including that transaction).
For more info and code examples see equivalent synchronous getJsonAsOf method.- t
Transaction time t
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
asof
/since
- def getAsyncJsonSince(date: Date, n: Int)(implicit conn: Conn): Future[String]
Get
Future
with json data for n rows matching molecule since date.Get
Future
with json data for n rows matching molecule since date.
Get data added/retracted since a human point in time (a java.util.Date).
For more info and code examples see equivalent synchronous getJsonSince method.- date
java.util.Date
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
asof
/since
- def getAsyncJsonSince(date: Date)(implicit conn: Conn): Future[String]
Get
Future
with json data for all rows matching molecule since date.Get
Future
with json data for all rows matching molecule since date.
Get data added/retracted since a human point in time (a java.util.Date).
For more info and code examples see equivalent synchronous getJsonSince method.- date
java.util.Date
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
asof
/since
- def getAsyncJsonSince(tx: TxReport, n: Int)(implicit conn: Conn): Future[String]
Get
Future
with json data for n rows matching molecule since tx.Get
Future
with json data for n rows matching molecule since tx.
Datomic's internalsince
can take a transaction entity id as argument to retrieve a database value since that transaction (excluding the transaction itself).
Instead of supplying the transaction entity id, in Molecule we supply a TxReport that contains the transaction entity id (which is used as argument to Datomic internally). This is more convenient when using Molecule since we get a TxReport from transaction operations likeget
,update
,retract
etc.
For more info and code examples see equivalent synchronous getJsonSince method.- tx
TxReport (returned from all molecule transaction operations)
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
asof
/since
- def getAsyncJsonSince(tx: TxReport)(implicit conn: Conn): Future[String]
Get
Future
with json data for all rows matching molecule since tx.Get
Future
with json data for all rows matching molecule since tx.
Datomic's internalsince
can take a transaction entity id as argument to retrieve a database value since that transaction (excluding the transaction itself).
Instead of supplying the transaction entity id, in Molecule we supply a TxReport that contains the transaction entity id (which is used as argument to Datomic internally). This is more convenient when using Molecule since we get a TxReport from transaction operations likeget
,update
,retract
etc.
For more info and code examples see equivalent synchronous getJsonSince method.- tx
TxReport (returned from all molecule transaction operations)
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
asof
/since
- def getAsyncJsonSince(t: Long, n: Int)(implicit conn: Conn): Future[String]
Get
Future
with json data for n rows matching molecule since transaction timet
.Get
Future
with json data for n rows matching molecule since transaction timet
.
Transaction timet
is an auto-incremented transaction number assigned internally by Datomic.
For more info and code examples see equivalent synchronous getJsonSince method.- t
Transaction time t
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
asof
/since
- def getAsyncJsonSince(t: Long)(implicit conn: Conn): Future[String]
Get
Future
with json data for all rows matching molecule since transaction timet
.Get
Future
with json data for all rows matching molecule since transaction timet
.
Transaction timet
is an auto-incremented transaction number assigned internally by Datomic.
For more info and code examples see equivalent synchronous getJsonSince method.- t
Transaction time t
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
asof
/since
- def getAsyncJsonWith(txData: List[_], n: Int)(implicit conn: Conn): Future[String]
Get
Future
with json data for n rows matching molecule with applied raw transaction data.Get
Future
with json data for n rows matching molecule with applied raw transaction data.
Apply raw transaction data to in-memory "branch" of db without affecting db.
For more info and code examples see equivalent synchronous getJsonWith method.- txData
Raw transaction data as java.util.List[Object]
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
with
- def getAsyncJsonWith(txData: List[_])(implicit conn: Conn): Future[String]
Get
Future
with json data for all rows matching molecule with applied raw transaction data.Get
Future
with json data for all rows matching molecule with applied raw transaction data.
Apply raw transaction data to in-memory "branch" of db without affecting db.
For more info and code examples see equivalent synchronous getJsonWith method.- txData
Raw transaction data as java.util.List[Object]
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
with
- def getAsyncJsonWith(n: Int, txMolecules: Seq[Seq[Statement]]*)(implicit conn: Conn): Future[String]
Get
Future
with json data for all rows matching molecule with applied molecule transaction data.Get
Future
with json data for all rows matching molecule with applied molecule transaction data.
Apply one or more molecule transactions to in-memory "branch" of db without affecting db.
For more info and code examples see equivalent synchronous getJsonWith method.
Multiple transactions can be applied to test more complex what-if scenarios!- txMolecules
Transaction statements from applied Molecules with test data
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
with
- def getAsyncJsonWith(txMolecules: Seq[Seq[Statement]]*)(implicit conn: Conn): Future[String]
Get
Future
with json data for all rows matching molecule with applied molecule transaction data.Get
Future
with json data for all rows matching molecule with applied molecule transaction data.
Apply one or more molecule transactions to in-memory "branch" of db without affecting db.
For more info and code examples see equivalent synchronous getJsonWith method.
Multiple transactions can be applied to test more complex what-if scenarios!- txMolecules
Transaction statements from applied Molecules with test data
- conn
Implicit Conn value in scope
- returns
String of json
- See also
Manual on
with
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Documentation/API for the Molecule library - a meta DSL for the Datomic database.
Manual | scalamolecule.org | Github | Forum