Exposed
Exposed is the SQL framework used by every Arda backend service for PostgreSQL persistence. It is chosen for its idiomatic Kotlin DSL, type safety, and explicit transaction scoping — properties that align with Arda’s bitemporal persistence model and AppError contract.
- Version:
0.60.0. - Database: PostgreSQL (production); ContainerizedPostgres test fixture for unit/integration tests.
- Repositories:
operations/,accounts-component/,common-module/(sharedTabledefinitions and converters).
Conventions in this codebase
Section titled “Conventions in this codebase”- DAO layer is not used. Exposed’s “DSL” API is the only API in
use. Per-table
Tableobjects describe schema; queries useselect,insert,updateagainst those. - Transactions are explicit. Every database access is wrapped in a
transaction(database) { ... }block at a well-defined boundary (typically a use case or service method). No implicit “request transaction”. - Bitemporal columns (
valid_from,valid_to,tx_from,tx_to) are part of every business-state table. See Bitemporal Persistence. - Schema migrations are owned by Flyway, not Exposed. Exposed
describes the current schema; Flyway migrations under
db/migration/evolve it. - Error handling: SQL errors are caught at the boundary and mapped
to the
AppErrorsealed hierarchy. See Exception Handling.
Authoritative references
Section titled “Authoritative references”- Exposed documentation — official.
- Exposed wiki on GitHub — deeper reference for the DSL and Table API.
See also
Section titled “See also”- The
kotlin-codingskill — Result handling and AppError patterns applied at every Exposed boundary. - The
unit-tests-infraskill —ContainerizedPostgresand the Harness pattern for database-backed tests. - Data Authority Pattern — module boundary rules around shared tables.
Copyright: © Arda Systems 2025-2026, All rights reserved