TestDb

abstract class TestDb

Extend this to create your own:

 object TestDb extends japgolly.webapputil.db.test.TestDb {

   override protected def cfg: DbConfig =
     xxx

   onlyAllowDropSchemaWhenDatabaseNameEndsWith("_test")

 }
class Object
trait Matchable
class Any

Value members

Abstract methods

protected def cfg: DbConfig

Concrete methods

def ![A](query: ConnectionIO[A]): A
def acquireRealXA(): (ImperativeXA, Locked)

Returns a connection that really commits transactions on completion and writes to the DB.

Returns a connection that really commits transactions on completion and writes to the DB.

Ensure that you call releaseRealXA() after use.

Use with care. Use as a last resort.

protected def addShutdownHook: Boolean
def check[A : Analyzable](a: A): Unit
def checkOutput[A : Tag](q: Query0[A])(implicit evidence$2: Tag[A], l: Line): Unit
def checkOutput[A : Tag, B : Tag](q: Query[A, B])(implicit evidence$3: Tag[A], evidence$4: Tag[B], l: Line): Unit
def dropSchema(): Unit

Drops all objects (tables, views, procedures, triggers, ...) in the configured schemas.

Drops all objects (tables, views, procedures, triggers, ...) in the configured schemas.

def init(): Unit
protected def initConnection: ConnectionIO[Unit]
def initPending(): Boolean
def initialised(): Boolean
def onlyAllowDropSchemaWhenDatabaseNameIs(expected: String): Unit
def onlyAllowDropSchemaWhenDatabaseNameWhen(allow: String => Boolean, errMsg: String => String): Unit
def shutdown(): Unit
protected def singleConnStrategy: Strategy
protected def transactionIsolation: Option[Int]
def truncateAll(): Unit
protected def txnStrategy: Strategy

Rollback everything

Rollback everything

def withImperativeXA[A](f: ImperativeXA => A): A

Everything runs in a transaction and is automatically rolled back

Everything runs in a transaction and is automatically rolled back

def withRealXA[A](f: ImperativeXA => A): A

Provides a connection that really commits transactions on completion and writes to the DB.

Provides a connection that really commits transactions on completion and writes to the DB.

Concrete fields

val lazyTables: () => Set[DbTable]
protected val logger: Logger
val onDropSchemaAttempt: AtomicReference[Db => Unit]

Called when the DB schema is about to be dropped.

Called when the DB schema is about to be dropped.

lazy val tables: Set[DbTable]