Package

io.rdbc

sapi

Permalink

package sapi

Provides a Scala API for database connectivity.

Main class is a Connection that can be obtained using a ConnectionFactory.

Linear Supertypes
ImplicitsTrait, SqlInterpolatorTrait, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. sapi
  2. ImplicitsTrait
  3. SqlInterpolatorTrait
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class ColumnMetadata(name: String, dbTypeId: String) extends Product with Serializable

    Permalink

    Represents metadata of a database column.

    Represents metadata of a database column.

    name

    column name

    dbTypeId

    database vendor identifier of a datatype declared for the column

  2. trait Connection extends AnyRef

    Permalink

    Represents a database connection (session).

    Represents a database connection (session).

    Instances of implementations of this trait can be obtained using a ConnectionFactory. When clients are done with the connection, they are required to call a release method co clean up resources such as open sockets.

    Invoking any method of this trait when any previous operation has not completed yet is not allowed. Operation is considered complete when a resulting Future completes.

    Transaction management has to be done using beginTx, commitTx and rollbackTx methods. Using SQL statements to manage transaction state is not allowed.

    SqlWithParams instances passed to Connection's methods can be created using sql string interpolator, for example:

    import io.rdbc.sapi._
    
    val conn: Connection = ???
    val login = "jdoe"
    conn.statement(sql"select * from users where login = $login").executeForStream()

    Alternatively, when bare Strings are used as SQL statements, parameters are specified by name. Parameter name is an alphanumeric string starting with a letter, prefixed with a colon. Example:

    import io.rdbc.sapi._
    
    val conn: Connection = ???
    val login = "jdoe"
    conn.statement(sql"select * from users where login = :login")
        .bind("login" -> login)
        .executable.executeForStream()
  3. trait ConnectionFactory extends AnyRef

    Permalink

    Provides access to a database Connection.

    Provides access to a database Connection.

    Implementors must make the implementation of this trait thread-safe.

  4. sealed trait DecimalNumber extends AnyRef

    Permalink

    Unbounded decimal numeric type that extends BigDecimal to be able to represent NaN, positive infitnity and negative infinity.

  5. implicit class Duration2Timeout extends AnyRef

    Permalink

    Duration to Timeout converter

    Duration to Timeout converter

    Definition Classes
    ImplicitsTrait
  6. trait ExecutableStatement extends AnyRef

    Permalink

    Represents an executable statement.

    Represents an executable statement.

    Executable statement is a statement that has all parameters provided and is ready to be executed.

  7. sealed trait KeyColumns extends AnyRef

    Permalink

    Specification of columns that generate keys

  8. class ResultSet extends Traversable[Row]

    Permalink

    Represents a set of rows returned by a database engine.

  9. trait Row extends AnyRef

    Permalink

    Represents a row of a result returned by a database engine.

    Represents a row of a result returned by a database engine.

    This class defines a set of methods that can be used to get values from the row either by a column name or by a column index. Each method has a version returning an Option to allow null-safe handling of SQL null values.

  10. case class RowMetadata(columns: ImmutIndexedSeq[ColumnMetadata]) extends Product with Serializable

    Permalink

    Represents a row meta data.

    Represents a row meta data.

    columns

    meta data for every row column

  11. trait RowPublisher extends Publisher[Row]

    Permalink

    A reactive streams specification's Publisher giving access to the rows.

    A reactive streams specification's Publisher giving access to the rows.

    When this publisher signals that it is complete clients can safely assume that a database is ready to accept new queries. If subscription is cancelled, however, clients have to wait for RowPublisher#done future to complete before issuing another query.

  12. implicit class Sql extends AnyRef

    Permalink
    Definition Classes
    SqlInterpolatorTrait
  13. final case class SqlBigInt(value: Long) extends Product with Serializable

    Permalink

    SQL BIGINT type

  14. final case class SqlBinary(value: ImmutSeq[Byte]) extends Product with Serializable

    Permalink

    SQL BINARY

  15. final case class SqlBlob(value: ImmutSeq[Byte]) extends Product with Serializable

    Permalink

    SQL BINARY LARGE OBJECT

  16. final case class SqlBoolean(value: Boolean) extends Product with Serializable

    Permalink

    SQL BOOLEAN type

  17. final case class SqlChar(value: String) extends Product with Serializable

    Permalink

    SQL CHARACTER

  18. final case class SqlClob(value: String) extends Product with Serializable

    Permalink

    SQL CHARACTER LARGE OBJECT

  19. final case class SqlDate(value: LocalDate) extends Product with Serializable

    Permalink

    SQL DATE type

  20. final case class SqlDecimal(value: DecimalNumber) extends Product with Serializable

    Permalink

    SQL DECIMAL type

  21. final case class SqlDouble(value: Double) extends Product with Serializable

    Permalink

    SQL DOUBLE PRECISION type

  22. final case class SqlFloat(value: Float) extends Product with Serializable

    Permalink

    SQL FLOAT type

  23. final case class SqlInteger(value: Int) extends Product with Serializable

    Permalink

    SQL INTEGER type

  24. trait SqlInterpolatorTrait extends AnyRef

    Permalink
  25. final case class SqlInterval(value: Period) extends Product with Serializable

    Permalink

    SQL INTERVAL type

  26. final case class SqlNChar(value: String) extends Product with Serializable

    Permalink

    SQL NATIONAL CHARACTER

  27. final case class SqlNClob(value: String) extends Product with Serializable

    Permalink

    SQL NATIONAL CHARACTER LARGE OBJECT

  28. final case class SqlNVarchar(value: String) extends Product with Serializable

    Permalink

    SQL NATIONAL CHARACTER VARYING

  29. final case class SqlNull[T](cls: Class[T]) extends Product with Serializable

    Permalink
  30. final case class SqlNumeric(value: DecimalNumber) extends Product with Serializable

    Permalink

    SQL NUMERIC type

  31. final case class SqlReal(value: Float) extends Product with Serializable

    Permalink

    SQL REAL type

  32. final case class SqlSmallInt(value: Short) extends Product with Serializable

    Permalink

    SQL SMALLINT type

  33. final case class SqlTime(value: LocalTime) extends Product with Serializable

    Permalink

    SQL TIME WITHOUT TIME ZONE type

  34. final case class SqlTimestamp(value: LocalDateTime) extends Product with Serializable

    Permalink

    SQL TIMESTAMP type

  35. final case class SqlTimestampTz(value: OffsetDateTime) extends Product with Serializable

    Permalink

    SQL TIMESTAMP WITH TIME ZONE type

  36. final case class SqlVarbinary(value: ImmutSeq[Byte]) extends Product with Serializable

    Permalink

    SQL BINARY VARYING

  37. final case class SqlVarchar(value: String) extends Product with Serializable

    Permalink

    SQL CHARACTER VARYING

  38. case class SqlWithParams(sql: String, params: ImmutIndexedSeq[Any]) extends Product with Serializable

    Permalink

    Represent a sql statement along with parameters.

    Represent a sql statement along with parameters. Instances of this class are supposed to be constructed using sql string interpolator like this:

    import io.rdbc.sapi._
    val id = 0
    val s: SqlWithParams = sql"select * from test where id = $id"

    Instances created by the interpolator can be composed:

    import io.rdbc.sapi._
    val x = 0
    val y = 0
    val s: SqlWithParams =
      sql"select * from test where x = $x" +
      sql"and y = $y"
  39. trait Statement extends AnyRef

    Permalink

    Represents a SQL statement

    Represents a SQL statement

    Methods of this trait allow to bind argument values to parameters either by name or index. Classes extending this trait can be used as an alternative to sql string interpolator - SqlInterpolator.

  40. final case class StatementOptions(generatedKeyCols: KeyColumns) extends Product with Serializable

    Permalink

    Statement options.

    Statement options.

    generatedKeyCols

    says what keys generated by the database should be returned

  41. final case class Timeout(value: Duration) extends AnyVal with Product with Serializable

    Permalink

    Represents a timeout

    Represents a timeout

    Annotations
    @implicitNotFound( ... )
  42. final case class Warning(msg: String, code: String) extends Product with Serializable

    Permalink

    Represents a warning emitted by a database engine during statement processing.

    Represents a warning emitted by a database engine during statement processing.

    msg

    database vendor specific warning message

    code

    database vendor specific warning code

Value Members

  1. object BuildInfo extends Product with Serializable

    Permalink

    This object was generated by sbt-buildinfo.

  2. object DecimalNumber

    Permalink
  3. object KeyColumns

    Permalink
  4. object SqlInterpolator extends SqlInterpolatorTrait

    Permalink
  5. object SqlNull extends Serializable

    Permalink
  6. object StatementOptions extends Serializable

    Permalink
  7. object Timeout extends Serializable

    Permalink

    Timeout companion

  8. package exceptions

    Permalink

Inherited from ImplicitsTrait

Inherited from SqlInterpolatorTrait

Inherited from AnyRef

Inherited from Any

Ungrouped