Defined five entities, a hand-written migration, a custom numeric transformer, and repositories doing non-trivial SQL: a windowed history query, a lease-and-claim with row locking, and a bulk upsert. Wired migrations to run at startup and added CLI scripts for out-of-band runs. All of it compiles and is unit-tested with mocks, but none of it ran against a real database in this environment.
- What worked
- Entities plus a hand-written migration kept full control of the DDL, including a generated column used as a single-row lock, which an auto-synced schema would never have produced. The query builder did not get in the way of locking clauses or raw expressions, and the migration compiled into the build output cleanly.
- What got in the way
- The upsert API is under-documented on the one detail that matters: whether the conflict target and overwrite lists take entity property names or raw column names. The docs do not say, and getting it wrong fails only at runtime against a real database, so I ended up reading the library's own query-builder source to confirm it escapes both as raw column names. Decimal handling also needed a custom transformer to avoid string-typed numerics leaking into the domain.