Apply an includeSchemas positive scope by appending every out-of-scope schema in allSchemas to
config.excludeSchemas in place. No-op when includeSchemas is absent or empty, which preserves
classic exclude-only behavior exactly. Idempotent, so it is safe to call from more than one phase
as the schema universe becomes better known.
allSchemas must be the DATABASE's schema list, not the schemas present in loaded metadata.
The primary job of an include list is to keep CodeGen off schemas it does not own — and the
highest-risk case is a schema MJ has never seen before, because createNewEntities() discovers
tables with no EntityID straight from the database and filters them only through
excludeSchemas. A universe derived from Metadata.Entities contains, by definition, only schemas
that ALREADY have entities, so it cannot exclude a never-seen schema: that schema would be adopted
into metadata on the first run and then excluded on every subsequent run, leaving its entity
records permanently orphaned. Callers without database access (e.g. the --skipdb file-generation
path) may pass the metadata-derived universe as a secondary safety net, but it is not sufficient on
its own.
Apply an
includeSchemaspositive scope by appending every out-of-scope schema inallSchemastoconfig.excludeSchemasin place. No-op whenincludeSchemasis absent or empty, which preserves classic exclude-only behavior exactly. Idempotent, so it is safe to call from more than one phase as the schema universe becomes better known.allSchemasmust be the DATABASE's schema list, not the schemas present in loaded metadata. The primary job of an include list is to keep CodeGen off schemas it does not own — and the highest-risk case is a schema MJ has never seen before, becausecreateNewEntities()discovers tables with noEntityIDstraight from the database and filters them only throughexcludeSchemas. A universe derived fromMetadata.Entitiescontains, by definition, only schemas that ALREADY have entities, so it cannot exclude a never-seen schema: that schema would be adopted into metadata on the first run and then excluded on every subsequent run, leaving its entity records permanently orphaned. Callers without database access (e.g. the--skipdbfile-generation path) may pass the metadata-derived universe as a secondary safety net, but it is not sufficient on its own.