Alexander Ioffe
09/18/2025, 3:15 PMcapture.generate {
Code.Entities(
CodeVersion.Fixed("1.0.0")
DatabaseDriver.Postgres("jdbc:postgresql:...")
)
}
Then query as usual:
val query = capture.select {
val org = from(Table<OrganizationAccounts>())
val member = join(Table<OrgAccountmembers>()) { it.orgId == org.orgId }
val user = join(Table<UserProfiles>()) { it.userId == member.userId }
where { org.isactive }
UserInfo(user.firstName, user.lastName, member.rolename, org.orgName)
}
Bonus: messy or inconsistent schema? ExoQuery can use ChatGPT or a local Ollama model to normalize/clean your generated records and names to your conventions. Check the samples for details: https://github.com/ExoQuery/exoquery-samples
Happy to answer questions or swap notes with anyone doing schema-first in Kotlin.