feat(01-02): add /ready endpoint with database connectivity check

- Add GET /ready endpoint that checks database connection
- Returns 200 'ready' when connected, 503 when not
- Update Routes to require DataSource dependency
- Provide dataSourceLayer in Main.scala
- Use 'hikari' prefix for HikariCP config to avoid ZIO config conflict
This commit is contained in:
Jakub Zych
2026-02-04 22:20:35 +01:00
parent ddb1964d1a
commit 0059add4a1
5 changed files with 33 additions and 13 deletions

View File

@@ -27,11 +27,12 @@ object QuillContext {
/** DataSource layer from HikariCP configuration
*
* Reads configuration from "database" prefix in application.conf.
* Reads configuration from "hikari" prefix in application.conf.
* Uses separate prefix from "database" to avoid conflict with ZIO config.
* HikariCP manages the connection pool.
*/
val dataSourceLayer: ZLayer[Any, Throwable, DataSource] =
Quill.DataSource.fromPrefix("database")
Quill.DataSource.fromPrefix("hikari")
/** Quill PostgreSQL context with snake_case naming
*