package database
Database Service
This module provides the client implementation of data access stored in postgres server. To access the database service,
it is expected that developers create an instance of DatabaseServiceFactory
.
Example: DatabaseServiceFactory
val system = ActorSystem(Behaviors.empty, "test") // in component handlers the ActorSystem should be provided from ActorContext e.g. ctx.system val dbFactory = new DatabaseServiceFactory(system) val dsl: DSLContext = dbFactory.makeDsl(locationService, "postgres") // postgres is a dbName here
There are overloads of makeDsl()
available. Once the DSLContext
is created, it can be used to access data from postgres.
Complete guide of different flavours of makeDsl()
and how to use DSLContext
to access data is available at:
https://tmtsoftware.github.io/csw/services/database.html
Type Members
- class DatabaseServiceFactory extends AnyRef
DatabaseServiceFactory provides a mechanism to connect to the database server and get the handle of Jooq's DSLContext.
DatabaseServiceFactory provides a mechanism to connect to the database server and get the handle of Jooq's DSLContext. To know in detail about Jooq please refer https://www.jooq.org/learn/.