Skip to content

Ktor configuration gaps: named databases inherit almost nothing, sqlLog mutates JVM globals and has no config-file support #399

Description

@zantvoort
  • readStormConfig(application, "storm.databases.$name") (storm-ktor/src/main/kotlin/st/orm/ktor/Storm.kt:166) reads only the named prefix; only sqlCommenter falls back to the plugin level (:175). exceptionMapper, queryObserver, connectionProvider and entityCallbacks silently do not, and a root-level storm.update.defaultMode does not apply to named databases. Nothing documents the difference; define and document the inheritance rule.
  • autoRegisterRepositories = false gates only the primary database (:151 vs :185).
  • repository<T>(name) for a type no database claimed silently binds it to the named database (RepositoryRegistry.kt:51-59 rejects only types claimed by other databases); an unclaimed type deserves a fail-fast error naming the candidates.
  • The sqlLog install path writes SqlLog's JVM-global statics (Storm.kt:269-272 into SqlLog.java:429, 446, 1136), so a second application in the same JVM resets the first, and hydrationShapes is set unconditionally. None of the eight sqlLog* options can come from application.conf (the Spring side binds all of them under storm.sql-log.*), so enabling the SQL log in production requires a redeploy. There are no tests referencing sqlLog in storm-ktor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingktorKtor integration

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions