SqlServerZioJdbcContext

class SqlServerZioJdbcContext[N <: NamingStrategy](val naming: N) extends ZioJdbcContext[SQLServerDialect, N] with SqlServerJdbcTypes[N]
Companion
object
trait SqlServerJdbcTypes[N]
trait UUIDStringEncoding
trait BooleanObjectEncoding
class ZioJdbcContext[SQLServerDialect, N]
trait ZioTranslateContext[SQLServerDialect, N]
trait ContextTranslateMacro[SQLServerDialect, N]
trait ContextTranslateProto[SQLServerDialect, N]
trait ZioPrepareContext[SQLServerDialect, N]
trait ContextVerbPrepare[SQLServerDialect, N]
trait JdbcContextTypes[SQLServerDialect, N]
trait Decoders
trait Encoders
trait SqlContext[SQLServerDialect, N]
trait ZioContext[SQLServerDialect, N]
trait ContextVerbStream[SQLServerDialect, N]
trait ProtoStreamContext[SQLServerDialect, N]
trait Context[SQLServerDialect, N]
trait Closeable
trait AutoCloseable
trait EncodingDsl
trait LowPriorityImplicits
trait ProtoContext[SQLServerDialect, N]
trait RowContext
class Object
trait Matchable
class Any

Type members

Inherited classlikes

case
class BatchGroup(string: String, prepare: List[Prepare])
Inherited from
RowContext
case
class BatchGroupReturning(string: String, returningBehavior: ReturnAction, prepare: List[Prepare])
Inherited from
RowContext
Inherited from
Context
case
class JdbcDecoder[T](decoder: () => T)
Inherited from
Decoders
case
class JdbcEncoder[T](sqlType: Int, encoder: () => T)
Inherited from
Encoders

Inherited types

type BaseDecoder[T] = GenericDecoder[ResultRow, Session, T, Specific]
Inherited from
EncodingDsl
type BaseEncoder[T] = GenericEncoder[T, PrepareRow, Session]
Inherited from
EncodingDsl
type ColumnResolver = GenericColumnResolver[ResultRow]
Inherited from
EncodingDsl
type Decoder[T] = JdbcDecoder[T]
Inherited from
Decoders
type DecoderMethod[T] = (Int, ResultRow, Session) => T
Inherited from
EncodingDsl
type Encoder[T] = JdbcEncoder[T]
Inherited from
Encoders
type EncoderMethod[T] = (Int, T, PrepareRow, Session) => PrepareRow
Inherited from
EncodingDsl
override
type Environment = Has[DataSource]
Inherited from
ZioJdbcContext
override
type Error = SQLException
Inherited from
ZioJdbcContext
type Extractor[T] = (ResultRow, Session) => T
Inherited from
RowContext
type Index = Int
Inherited from
JdbcContextTypes
type Prepare = (PrepareRow, Session) => (List[Any], PrepareRow)
Inherited from
RowContext
Inherited from
ZioJdbcContext
Inherited from
ZioJdbcContext
Inherited from
ZioJdbcContext
override
type PrepareRow = PreparedStatement
Inherited from
ZioJdbcContext
override
type Result[T] = ZIO[Environment, Error, T]
Inherited from
ZioJdbcContext
override
type ResultRow = ResultSet
Inherited from
ZioJdbcContext
type RowTyper[T] = GenericRowTyper[ResultRow, T]
Inherited from
EncodingDsl
override
type RunActionResult = Long
Inherited from
ZioJdbcContext
override
Inherited from
ZioJdbcContext
override
type RunBatchActionResult = List[Long]
Inherited from
ZioJdbcContext
override
Inherited from
ZioJdbcContext
override
type RunQueryResult[T] = List[T]
Inherited from
ZioJdbcContext
override
Inherited from
ZioJdbcContext
override
type Runner = Unit
Inherited from
ZioJdbcContext
type RunnerBehavior <: RunnerSummoningBehavior
Inherited from
ContextTranslateMacro
override
type Session = Connection
Inherited from
ZioJdbcContext
override
type StreamResult[T] = ZStream[Environment, Error, T]
Inherited from
ZioJdbcContext
override
type TranslateResult[T] = ZIO[Environment, Error, T]
Inherited from
ZioTranslateContext
override
type TranslateRunner = Unit
Inherited from
ZioJdbcContext

Value members

Inherited methods

inline
def _streamInternal[T](inline quoted: Quoted[Query[T]], fetchSize: Option[Int]): StreamResult[T]

Internal API that cannot be made private due to how inline functions

Internal API that cannot be made private due to how inline functions

Inherited from
ContextVerbStream
Inherited from
ContextVerbPrepare

Internal API that cannot be made private due to how inline functions

Internal API that cannot be made private due to how inline functions

Inherited from
ContextTranslateMacro
override
def close(): Unit
Definition Classes
ZioJdbcContext -> Context -> Closeable -> AutoCloseable
Inherited from
ZioJdbcContext
override protected
Definition Classes
ZioJdbcContext -> Context
Inherited from
ZioJdbcContext
def decoder[T](f: ResultRow => Index => T): JdbcDecoder[T]
Inherited from
Decoders
def decoder[T](d: (Int, ResultRow, Session) => T): JdbcDecoder[T]
Inherited from
Decoders
def encoder[T](sqlType: Int, f: PrepareRow => (Index, T) => Unit): JdbcEncoder[T]
Inherited from
Encoders
def encoder[T](sqlType: Int, f: (Index, T, PrepareRow) => Unit): JdbcEncoder[T]
Inherited from
Encoders
def executeAction(sql: String, prepare: Prepare)(info: ExecutionInfo, dc: Runner): QIO[Long]
Inherited from
ZioJdbcContext
def executeActionReturning[O](sql: String, prepare: Prepare, extractor: () => O, returningBehavior: ReturnAction)(info: ExecutionInfo, dc: Runner): QIO[O]
Inherited from
ZioJdbcContext
def executeBatchAction(groups: List[BatchGroup])(info: ExecutionInfo, dc: Runner): QIO[List[Long]]
Inherited from
ZioJdbcContext
def executeBatchActionReturning[T](groups: List[BatchGroupReturning], extractor: () => T)(info: ExecutionInfo, dc: Runner): QIO[List[T]]
Inherited from
ZioJdbcContext
def executeQuery[T](sql: String, prepare: Prepare, extractor: () => T)(info: ExecutionInfo, dc: Runner): QIO[List[T]]
Inherited from
ZioJdbcContext
override
def executeQuerySingle[T](sql: String, prepare: Prepare, extractor: () => T)(info: ExecutionInfo, dc: Runner): QIO[T]
Definition Classes
ZioJdbcContext -> ZioContext -> ProtoContext
Inherited from
ZioJdbcContext
protected
def handleSingleResult[T](list: List[T]): T
Inherited from
Context
inline
def lift[T](inline runtimeValue: T): T
Inherited from
Context
inline
def liftQuery[U <: ([_] =>> Iterable[_]), T](inline runtimeValue: U[T]): Query[T]
Inherited from
Context
protected
def mappedBaseDecoder[Base, Mapped](mapped: MappedEncoding[Base, Mapped], decoder: () => Base): () => Mapped
Inherited from
EncodingDsl
protected
def mappedBaseEncoder[Mapped, Base](mapped: MappedEncoding[Mapped, Base], encoder: () => Base): () => Mapped
Inherited from
EncodingDsl
def parseJdbcType(intType: Int): String

Parses instances of java.sql.Types to string form so it can be used in creation of sql arrays. Some databases does not support each of generic types, hence it's welcome to override this method and provide alternatives to non-existent types.

Parses instances of java.sql.Types to string form so it can be used in creation of sql arrays. Some databases does not support each of generic types, hence it's welcome to override this method and provide alternatives to non-existent types.

Value Params
intType

one of java.sql.Types

Returns

JDBC type in string form

Inherited from
JdbcContextTypes
@targetName("runPrepareBatchAction")
inline
def prepare[I, A <: Action[I] & QAC[I, Nothing]](inline quoted: Quoted[BatchAction[A]]): PrepareBatchActionResult
Inherited from
ContextVerbPrepare
@targetName("runPrepareAction")
inline
def prepare[E](inline quoted: Quoted[Action[E]]): PrepareActionResult
Inherited from
ContextVerbPrepare
@targetName("runPrepareQuerySingle")
inline
def prepare[T](inline quoted: Quoted[T]): PrepareQueryResult
Inherited from
ContextVerbPrepare
@targetName("runPrepareQuery")
inline
def prepare[T](inline quoted: Quoted[Query[T]]): PrepareQueryResult
Inherited from
ContextVerbPrepare
override
def prepareAction(sql: String, prepare: Prepare)(info: ExecutionInfo, dc: Runner): QCIO[PreparedStatement]
Definition Classes
ZioJdbcContext -> ZioPrepareContext -> ContextVerbPrepare
Inherited from
ZioJdbcContext
override
def prepareBatchAction(groups: List[BatchGroup])(info: ExecutionInfo, dc: Runner): QCIO[List[PreparedStatement]]
Definition Classes
ZioJdbcContext -> ZioPrepareContext -> ContextVerbPrepare
Inherited from
ZioJdbcContext
@tailrec
final protected
def prepareParam(param: Any): String
Inherited from
ContextTranslateProto
override
def prepareQuery(sql: String, prepare: Prepare)(info: ExecutionInfo, dc: Runner): QCIO[PreparedStatement]
Definition Classes
ZioJdbcContext -> ZioPrepareContext -> ContextVerbPrepare
Inherited from
ZioJdbcContext
def prepareSingle(sql: String, prepare: Prepare)(info: ExecutionInfo, dc: Runner): QCIO[PreparedStatement]

Execute SQL on connection and return prepared statement. Closes the statement in a bracket.

Execute SQL on connection and return prepared statement. Closes the statement in a bracket.

Inherited from
ZioPrepareContext
override
def push[A, B](result: TranslateResult[A])(f: A => B): TranslateResult[B]
Definition Classes
ZioTranslateContext -> ContextTranslateProto
Inherited from
ZioTranslateContext
@targetName("runBatchActionReturning")
inline
def run[I, T, A <: Action[I] & QAC[I, T]](inline quoted: Quoted[BatchAction[A]]): ZIO[Has[DataSource], SQLException, List[T]]
Inherited from
ZioJdbcContext
@targetName("runBatchAction")
inline
def run[I, A <: Action[I] & QAC[I, Nothing]](inline quoted: Quoted[BatchAction[A]]): ZIO[Has[DataSource], SQLException, List[Long]]
Inherited from
ZioJdbcContext
@targetName("runActionReturning")
inline
def run[E, T](inline quoted: Quoted[ActionReturning[E, T]]): ZIO[Has[DataSource], SQLException, T]
Inherited from
ZioJdbcContext
@targetName("runAction")
inline
def run[E](inline quoted: Quoted[Action[E]]): ZIO[Has[DataSource], SQLException, Long]
Inherited from
ZioJdbcContext
@targetName("runQuerySingle")
inline
def run[T](inline quoted: Quoted[T]): ZIO[Has[DataSource], SQLException, T]
Inherited from
ZioJdbcContext
@targetName("runQuery")
inline
def run[T](inline quoted: Quoted[Query[T]], inline wrap: OuterSelectWrap): ZIO[Has[DataSource], SQLException, List[T]]
Inherited from
ZioJdbcContext
@targetName("runQueryDefault")
inline
def run[T](inline quoted: Quoted[Query[T]]): ZIO[Has[DataSource], SQLException, List[T]]
Inherited from
ZioJdbcContext
override
def seq[A](list: List[TranslateResult[A]]): TranslateResult[List[A]]
Definition Classes
ZioTranslateContext -> ContextTranslateProto
Inherited from
ZioTranslateContext
@targetName("streamQueryWithFetchSize")
inline
def stream[T](inline quoted: Quoted[Query[T]], fetchSize: Int): StreamResult[T]
Inherited from
ContextVerbStream
@targetName("streamQuery")
inline
def stream[T](inline quoted: Quoted[Query[T]]): StreamResult[T]
Inherited from
ContextVerbStream
def streamQuery[T](fetchSize: Option[Int], sql: String, prepare: Prepare, extractor: () => T)(info: ExecutionInfo, dc: Runner): QStream[T]
Inherited from
ZioJdbcContext
def transaction[R <: Has[DataSource], A](op: ZIO[R, Throwable, A]): ZIO[R, Throwable, A]

Execute instructions in a transaction. For example, to add a Person row to the database and return the contents of the Person table immediately after that:

Execute instructions in a transaction. For example, to add a Person row to the database and return the contents of the Person table immediately after that:

 val a = run(query[Person].insert(Person(...)): ZIO[Has[DataSource], SQLException, Long]
 val b = run(query[Person]): ZIO[Has[DataSource], SQLException, Person]
 transaction(a *> b): ZIO[Has[DataSource], SQLException, Person]

The order of operations run in the case that a new connection needs to be aquired are as follows:

 getDS from env,
 acquire-connection,
   set-no-autocommit(connection),
     put-into-fiberref(connection),
       op - the corresponding execute_ method which will execute and pull connection from the fiberref,
     remove-from-fiberref(connection),
   set-prev-autocommit(connection),
 release-conn
Inherited from
ZioJdbcContext
@targetName("translateBatchActionReturning")
inline
def translate[I, T, A <: Action[I] & QAC[I, T]](inline quoted: Quoted[BatchAction[A]], inline prettyPrint: Boolean): TranslateResult[List[String]]
Inherited from
ContextTranslateMacro
@targetName("translateBatchActionReturning")
inline
def translate[I, T, A <: Action[I] & QAC[I, T]](inline quoted: Quoted[BatchAction[A]]): TranslateResult[List[String]]
Inherited from
ContextTranslateMacro
@targetName("translateBatchAction")
inline
def translate[I, A <: Action[I] & QAC[I, Nothing]](inline quoted: Quoted[BatchAction[A]], inline prettyPrint: Boolean): TranslateResult[List[String]]
Inherited from
ContextTranslateMacro
@targetName("translateBatchAction")
inline
def translate[I, A <: Action[I] & QAC[I, Nothing]](inline quoted: Quoted[BatchAction[A]]): TranslateResult[List[String]]
Inherited from
ContextTranslateMacro
@targetName("translateActionReturning")
inline
def translate[E, T](inline quoted: Quoted[ActionReturning[E, T]], inline prettyPrint: Boolean): TranslateResult[String]
Inherited from
ContextTranslateMacro
@targetName("translateActionReturning")
inline
def translate[E, T](inline quoted: Quoted[ActionReturning[E, T]]): TranslateResult[String]
Inherited from
ContextTranslateMacro
@targetName("translateAction")
inline
def translate[E](inline quoted: Quoted[Action[E]], inline prettyPrint: Boolean): TranslateResult[String]
Inherited from
ContextTranslateMacro
@targetName("translateAction")
inline
def translate[E](inline quoted: Quoted[Action[E]]): TranslateResult[String]
Inherited from
ContextTranslateMacro
@targetName("translateQuerySingle")
inline
def translate[T](inline quoted: Quoted[T], inline prettyPrint: Boolean): TranslateResult[String]
Inherited from
ContextTranslateMacro
@targetName("translateQuerySingle")
inline
def translate[T](inline quoted: Quoted[T]): TranslateResult[String]
Inherited from
ContextTranslateMacro
@targetName("translateQuery")
inline
def translate[T](inline quoted: Quoted[Query[T]], inline prettyPrint: Boolean): TranslateResult[String]
Inherited from
ContextTranslateMacro
@targetName("translateQuery")
inline
def translate[T](inline quoted: Quoted[Query[T]]): TranslateResult[String]
Inherited from
ContextTranslateMacro
override
def translateBatchQueryEndpoint(groups: List[BatchGroup], prettyPrint: Boolean)(executionInfo: ExecutionInfo, dc: Runner): QIO[List[String]]
Definition Classes
ZioJdbcContext -> ContextTranslateProto
Inherited from
ZioJdbcContext
def translateBatchQueryReturningEndpoint(groups: List[BatchGroupReturning], prettyPrint: Boolean)(executionInfo: ExecutionInfo, dc: TranslateRunner): TranslateResult[List[String]]
Inherited from
ContextTranslateProto
override
def translateQueryEndpoint[T](statement: String, prepare: Prepare, extractor: () => T, prettyPrint: Boolean)(executionInfo: ExecutionInfo, dc: Runner): QIO[String]
Definition Classes
ZioJdbcContext -> ContextTranslateProto
Inherited from
ZioJdbcContext
override
def wrap[T](t: => T): TranslateResult[T]
Definition Classes
ZioTranslateContext -> ContextTranslateProto
Inherited from
ZioTranslateContext

Concrete fields

val naming: N
val underlying: ZioJdbcUnderlyingContext[SQLServerDialect, N]

Inherited fields

val currentConnection: FiberRef[Option[Connection]]
Inherited from
ZioJdbcContext
protected
val dateTimeZone: TimeZone
Inherited from
JdbcContextTypes
Inherited from
RowContext
protected
val identityPrepare: Prepare
Inherited from
RowContext
val idiom: SQLServerDialect
Inherited from
SqlServerJdbcTypes

Extensions

Inherited extensions

extension [T](q: Query[T])
inline
def filterByKeys(inline map: Map[String, String]): Query[T]

When using this with FilterColumns make sure it comes FIRST. Otherwise the columns are you filtering may have been nullified in the SQL before the filteration has actually happened.

When using this with FilterColumns make sure it comes FIRST. Otherwise the columns are you filtering may have been nullified in the SQL before the filteration has actually happened.

Inherited from
Context
inline
def filterColumns(inline columns: List[String]): Query[T]
Inherited from
Context

Implicits

Inherited implicits

implicit inline
def anyValDecoder[Cls <: AnyVal]: JdbcDecoder[Cls]
Inherited from
LowPriorityImplicits
implicit inline
def anyValEncoder[Cls <: AnyVal]: JdbcEncoder[Cls]
Inherited from
LowPriorityImplicits
implicit
Inherited from
Decoders
implicit
Inherited from
Encoders
implicit
Inherited from
BooleanObjectEncoding
implicit
Inherited from
BooleanObjectEncoding
implicit
val byteArrayDecoder: JdbcDecoder[Array[Byte]]
Inherited from
Decoders
implicit
val byteArrayEncoder: JdbcEncoder[Array[Byte]]
Inherited from
Encoders
implicit
Inherited from
Decoders
implicit
Inherited from
Encoders
implicit
Inherited from
Decoders
implicit
Inherited from
Encoders
implicit inline
def dec[T]: GenericDecoder[ResultRow, Session, T, Generic]
Inherited from
Context
implicit
Inherited from
Decoders
implicit
Inherited from
Encoders
implicit
Inherited from
Decoders
implicit
Inherited from
Encoders
implicit
Inherited from
Decoders
implicit
Inherited from
Encoders
implicit
Inherited from
Decoders
implicit
Inherited from
Encoders
implicit
val localDateTimeDecoder: JdbcDecoder[LocalDateTime]
Inherited from
Decoders
implicit
val localDateTimeEncoder: JdbcEncoder[LocalDateTime]
Inherited from
Encoders
implicit
Inherited from
Decoders
implicit
Inherited from
Encoders
implicit
def mappedDecoder[I, O](implicit mapped: MappedEncoding[I, O], d: JdbcDecoder[I]): JdbcDecoder[O]
Inherited from
Decoders
implicit override
def mappedEncoder[I, O](implicit mapped: MappedEncoding[I, O], e: JdbcEncoder[O]): JdbcEncoder[I]
Definition Classes
Encoders -> EncodingDsl
Inherited from
Encoders
implicit
def optionDecoder[T](implicit d: JdbcDecoder[T]): JdbcDecoder[Option[T]]
Inherited from
Decoders
implicit
def optionEncoder[T](implicit d: JdbcEncoder[T]): JdbcEncoder[Option[T]]
Inherited from
Encoders
implicit
Inherited from
Decoders
implicit
Inherited from
Encoders
implicit
Inherited from
Decoders
implicit
Inherited from
Encoders
implicit
Inherited from
UUIDStringEncoding
implicit
Inherited from
UUIDStringEncoding