com.github.mauricio.async.db

Members list

Concise view

Type members

Classlikes

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Configuration(username: String, host: String, port: Int, password: Option[String], database: Option[String], ssl: SSLConfiguration, charset: Charset, maximumMessageSize: Int, allocator: ByteBufAllocator, connectTimeout: Duration, testTimeout: Duration, queryTimeout: Option[Duration])

Contains the configuration necessary to connect to a database.

Contains the configuration necessary to connect to a database.

Attributes

allocator

the netty buffer allocator to be used

charset

charset for the connection, defaults to UTF-8, make sure you know what you are doing if you change this

connectTimeout

the timeout for connecting to servers

database

database name, defaults to no database

host

database host, defaults to "localhost"

maximumMessageSize

the maximum size a message from the server could possibly have, this limits possible OOM or eternal loop attacks the client could have, defaults to 16 MB. You can set this to any value you would like but again, make sure you know what you are doing if you do change it.

password

password, defaults to no password

port

database port, defaults to 5432

queryTimeout

the optional query timeout

ssl

ssl configuration

testTimeout

the timeout for connection tests performed by pools

username

database username

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Base interface for all objects that behave like a connection. This trait will usually be implemented by the objects that connect to a database, either over the filesystem or sockets. [[Connection]] are not supposed to be thread-safe and clients should assume implementations are not thread safe and shouldn't try to perform more than one statement (either common or prepared) at the same time. They should wait for the previous statement to be executed to then be able to pick the next one.

Base interface for all objects that behave like a connection. This trait will usually be implemented by the objects that connect to a database, either over the filesystem or sockets. [[Connection]] are not supposed to be thread-safe and clients should assume implementations are not thread safe and shouldn't try to perform more than one statement (either common or prepared) at the same time. They should wait for the previous statement to be executed to then be able to pick the next one.

You can, for instance, compose on top of the futures returned by this class to execute many statements at the same time:

 val handler: Connection = ...
 val result: Future[QueryResult] = handler.connect
   .map(parameters => handler)
   .flatMap(connection => connection.sendQuery("BEGIN TRANSACTION ISOLATION LEVEL REPEATABLE READ"))
   .flatMap(query => handler.sendQuery("SELECT 0"))
   .flatMap(query => handler.sendQuery("COMMIT").map(value => query))

 val queryResult: QueryResult = Await.result(result, Duration(5, SECONDS))

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait KindedMessage extends Serializable

Attributes

Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any
class QueryResult(val rowsAffected: Long, val statusMessage: String, val rows: Option[ResultSet])

This is the result of the execution of a statement, contains basic information as the number or rows affected by the statement and the rows returned if there were any.

This is the result of the execution of a statement, contains basic information as the number or rows affected by the statement and the rows returned if there were any.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
trait ResultSet extends IndexedSeq[RowData]

Represents the collection of rows that is returned from a statement inside a [[QueryResult]]. It's basically a collection of Array[Any]. Mutating fields in this array will not affect the database in any way

Represents the collection of rows that is returned from a statement inside a [[QueryResult]]. It's basically a collection of Array[Any]. Mutating fields in this array will not affect the database in any way

Attributes

Companion:
object
Graph
Supertypes
trait IndexedSeq[RowData]
trait IndexedSeqOps[RowData, IndexedSeq, IndexedSeq[RowData]]
trait IndexedSeq[RowData]
trait IndexedSeqOps[RowData, IndexedSeq, IndexedSeq[RowData]]
trait Seq[RowData]
trait SeqOps[RowData, IndexedSeq, IndexedSeq[RowData]]
trait Seq[RowData]
trait Equals
trait SeqOps[RowData, IndexedSeq, IndexedSeq[RowData]]
trait PartialFunction[Int, RowData]
trait Int => RowData
trait Iterable[RowData]
trait Iterable[RowData]
trait IterableFactoryDefaults[RowData, IndexedSeq]
trait IterableOps[RowData, IndexedSeq, IndexedSeq[RowData]]
trait IterableOnceOps[RowData, IndexedSeq, IndexedSeq[RowData]]
trait IterableOnce[RowData]
class Object
trait Matchable
class Any
object ResultSet

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait RowData extends IndexedSeq[Any]

Represents a row from a database, allows clients to access rows by column number or column name.

Represents a row from a database, allows clients to access rows by column number or column name.

Attributes

Graph
Supertypes
trait IndexedSeq[Any]
trait IndexedSeqOps[Any, IndexedSeq, IndexedSeq[Any]]
trait IndexedSeq[Any]
trait IndexedSeqOps[Any, IndexedSeq, IndexedSeq[Any]]
trait Seq[Any]
trait SeqOps[Any, IndexedSeq, IndexedSeq[Any]]
trait Seq[Any]
trait Equals
trait SeqOps[Any, IndexedSeq, IndexedSeq[Any]]
trait PartialFunction[Int, Any]
trait Int => Any
trait Iterable[Any]
trait Iterable[Any]
trait IterableFactoryDefaults[Any, IndexedSeq]
trait IterableOps[Any, IndexedSeq, IndexedSeq[Any]]
trait IterableOnceOps[Any, IndexedSeq, IndexedSeq[Any]]
trait IterableOnce[Any]
class Object
trait Matchable
class Any
Known subtypes
case class SSLConfiguration(mode: Value, rootCert: Option[File])

Contains the SSL configuration necessary to connect to a database.

Contains the SSL configuration necessary to connect to a database.

Attributes

mode

whether and with what priority a SSL connection will be negotiated, default disabled

rootCert

path to PEM encoded trusted root certificates, None to use internal JDK cacerts, defaults to None

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any