Multi-module
August 23, 2026 · View on GitHub
Each module that applies the DBFlow plugin generates adapter helpers and {Name}_Database for the @Database types in that module. Generation runs in that module's dbflowGenerate task, and the generated code compiles into the module's own main artifacts.
Rules:
- A
@Tablelives in one module and one@Database. - The defining module's main code uses
createDBand companion column properties; reference generated types (*_Adapter,*_Database) directly from its tests or from downstream modules. - Open each module’s database with
createDB. That registers adapters soselect from User::classworks across the process.
createDB is additive: opening a second module’s database registers that module’s adapters without replacing the first.
Do not share the same @Table class across two databases or two generating modules.