gnieh.sohva.async

Database

class Database extends sohva.Database

Gives the user access to the different operations available on a database. Among other operations this is the key class to get access to the documents of this database.

It also exposes the change handler interface, that allows people to react to change notifications. This is a low-level API, that handles raw Json objects

Linear Supertypes
sohva.Database, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Database
  2. Database
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type Result[T] = Future[Either[(Int, Option[ErrorResult]), T]]

    Definition Classes
    DatabaseDatabase

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def attachTo(docId: String, attachment: String, stream: InputStream, contentType: Option[String]): Result[Boolean]

    Attaches the given file (given as an input stream) to the given document id.

    Attaches the given file (given as an input stream) to the given document id. If no mime type is given, sohva tries to guess the mime type of the file itself. It it does not manage to identify the mime type, the file won't be attached... This method returns true iff the file was attached to the document.

    Definition Classes
    DatabaseDatabase
  8. def attachTo(docId: String, file: File, contentType: Option[String]): Result[Boolean]

    Attaches the given file to the given document id.

    Attaches the given file to the given document id. If no mime type is given, sohva tries to guess the mime type of the file itself. It it does not manage to identify the mime type, the file won't be attached... This method returns true iff the file was attached to the document.

    Definition Classes
    DatabaseDatabase
  9. def changes(filter: Option[String] = None): ChangeStream

    Registers to the change stream of this database with potential filter

    Registers to the change stream of this database with potential filter

    Definition Classes
    DatabaseDatabase
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. val couch: CouchDB

  12. def create: Result[Boolean]

    Creates this database in the couchdb instance if it does not already exist.

    Creates this database in the couchdb instance if it does not already exist. Returns true iff the database was actually created.

    Definition Classes
    DatabaseDatabase
  13. val credit: Int

    The credit assigned to the conflict resolver.

    The credit assigned to the conflict resolver. It represents the number of times the client tries to save the document before giving up.

    Definition Classes
    DatabaseDatabase
  14. def delete: Result[Boolean]

    Deletes this database in the couchdb instance if it exists.

    Deletes this database in the couchdb instance if it exists. Returns true iff the database was actually deleted.

    Definition Classes
    DatabaseDatabase
  15. def deleteAttachment(docId: String, attachment: String): Result[Boolean]

    Deletes the given attachment for the given docId

    Deletes the given attachment for the given docId

    Definition Classes
    DatabaseDatabase
  16. def deleteDoc(id: String): Result[Boolean]

    Deletes the document identified by the given id from the database.

    Deletes the document identified by the given id from the database. If the document exists it is deleted and the method returns true, otherwise returns false.

    Definition Classes
    DatabaseDatabase
  17. def deleteDoc[T](doc: T with Doc)(implicit arg0: Manifest[T]): Result[Boolean]

    Deletes the document from the database.

    Deletes the document from the database. The document will only be deleted if the caller provided the last revision

    Definition Classes
    DatabaseDatabase
  18. def deleteDocs(ids: List[String], all_or_nothing: Boolean = false): Result[List[DbResult]]

    Deletes a bunch of documents at once returning the results for each identifier in the document list.

    Deletes a bunch of documents at once returning the results for each identifier in the document list. One can choose the update strategy by setting the parameter all_or_nothing to true or false.

    Definition Classes
    DatabaseDatabase
  19. def design(designName: String, language: String = "javascript"): Design

    Returns a design object that allows user to work with views

    Returns a design object that allows user to work with views

    Definition Classes
    DatabaseDatabase
  20. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  22. def exists: Result[Boolean]

    Indicates whether this database exists

    Indicates whether this database exists

    Definition Classes
    DatabaseDatabase
    Annotations
    @inline()
  23. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  24. def getAttachment(docId: String, attachment: String): Result[Option[(String, InputStream)]]

    Returns the given attachment for the given docId.

    Returns the given attachment for the given docId. It returns the mime type if any given in the response and the input stream to read the response from the server.

    Definition Classes
    DatabaseDatabase
  25. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  26. def getDocById[T](id: String, revision: Option[String] = None)(implicit arg0: Manifest[T]): Result[Option[T]]

    Returns the document identified by the given id if it exists

    Returns the document identified by the given id if it exists

    Definition Classes
    DatabaseDatabase
  27. def getDocRevision(id: String): Result[Option[String]]

    Returns the current revision of the document if it exists

    Returns the current revision of the document if it exists

    Definition Classes
    DatabaseDatabase
  28. def getDocRevisions(ids: List[String]): Result[List[(String, String)]]

    Returns the current revision of the documents

    Returns the current revision of the documents

    Definition Classes
    DatabaseDatabase
  29. def getDocsById[T](ids: List[String])(implicit arg0: Manifest[T]): Result[List[T]]

    Returns all the documents with given identifiers and of the given type.

    Returns all the documents with given identifiers and of the given type. If the document with an identifier exists in the database but has not the required type, it is not added to the result

    Definition Classes
    DatabaseDatabase
  30. def getRawDocById(id: String, revision: Option[String] = None): Result[Option[String]]

  31. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  32. def info: Result[Option[InfoResult]]

    Returns the information about this database

    Returns the information about this database

    Definition Classes
    DatabaseDatabase
  33. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  34. val name: String

    The database name

    The database name

    Definition Classes
    DatabaseDatabase
  35. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  36. final def notify(): Unit

    Definition Classes
    AnyRef
  37. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  38. def request: RequestBuilder

    Attributes
    protected[gnieh.sohva]
  39. def saveDoc[T](doc: T with Doc)(implicit arg0: Manifest[T]): Result[Option[T]]

    Creates or updates the given object as a document into this database The given object must have an _id and an optional _rev fields to conform to the couchdb document structure.

    Creates or updates the given object as a document into this database The given object must have an _id and an optional _rev fields to conform to the couchdb document structure.

    Definition Classes
    DatabaseDatabase
  40. def saveDocs[T](docs: List[T with Doc], all_or_nothing: Boolean = false): Result[List[DbResult]]

    Creates or updates a bunch of documents at once returning the results for each identifier in the document list.

    Creates or updates a bunch of documents at once returning the results for each identifier in the document list. One can choose the update strategy by setting the parameter all_or_nothing to true or false. **The retry strategy is not used in such case.**

    Definition Classes
    DatabaseDatabase
  41. def saveSecurityDoc(doc: SecurityDoc): Result[Boolean]

    Creates or updates the security document.

    Creates or updates the security document. Security documents are special documents with no _id nor _rev fields.

    Definition Classes
    DatabaseDatabase
  42. def securityDoc: Result[SecurityDoc]

    Returns the security document of this database if any defined

    Returns the security document of this database if any defined

    Definition Classes
    DatabaseDatabase
  43. val strategy: Strategy

    The strategy being used to resolve conflicts

    The strategy being used to resolve conflicts

    Definition Classes
    DatabaseDatabase
  44. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  45. def toString(): String

    Definition Classes
    AnyRef → Any
  46. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  47. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  48. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from sohva.Database

Inherited from AnyRef

Inherited from Any

Ungrouped