class Datastore
Main implementation for interacting with the datastore. |
|
interface DatastoreBackend
Wrapper for datastore access that indicates the applicable environment. |
|
enum class DatastoreEnv
Environment to which a given DatastoreBackend applies. |
|
data class DatastoreEnvWithProject
Combination of an environment and a Google cloud project name. |
|
class GoogleCloudDatastoreBackend : DatastoreBackend
DatastoreBackend using the google-cloud-java client library for datastore. |
|
data class TransactionOptions |
typealias DatastoreKey = <ERROR CLASS> |
val DB: Datastore
Primary external-facing API for interacting with the datastore. |
fun <T : Keyed<T>> Datastore.get(key: Key<T>): T?
Synchronous get by key of an object from the datastore. |
|
fun <T : Keyed<T>> Datastore.getAsync(key: Key<T>): <ERROR CLASS><T?>
Asynchronous get by key of an object from the datastore. |
|
fun Datastore.inTransaction(): Boolean |
|
fun initializeEnvAndProject(env: DatastoreEnv, project: String): Unit
Manually initialize the datastore environment. |
|
fun <T : Keyed<T>> Datastore.put(modelInstance: Keyed<T>): Key<T>
Synchronous put of an object to the datastore. |
|
fun <T : Keyed<T>> Datastore.putAsync(modelInstance: Keyed<T>): <ERROR CLASS><Key<T>>
Asynchronous put of an object to the datastore. |
|
fun Keyed<*>.toDatastoreEntity(): <ERROR CLASS> |
|
fun Key<*>.toDatastoreKey(): <ERROR CLASS>
Convert our abstract keys to the Google cloud datastore key class. |
|
fun <T : Keyed<T>> <ERROR CLASS>.toKey(): Key<T>
Convert a Google cloud datstore key to our abstract key class. |
|
fun <T : Keyed<T>> <ERROR CLASS>.toTypedModel(tRef: KClass<T>): T
Convert a Google cloud datastore entity to one of our model classes. |
|
fun <T> Datastore.transactional(options: TransactionOptions, block: Datastore.() -> T): T
Run a function, with all contained datastore operations transactional. fun <T> Datastore.transactional(block: Datastore.() -> T): T
Run datastore operations in a transaction with default options. |