Skip to content

[Request] Remove database connection dependency for model annotations #323

@tony-pizza

Description

@tony-pizza

Context: I want to run model annotations in CI (e.g. GitHub Actions). This currently requires spinning up a MySQL container service, creating our databases and loading the schemas for every annotation job run. This adds extra runner minutes and complexity.

I was honestly surprised to learn a connection was required as I'd assumed annotations were built purely from schema files.

The connection happens in ModelWrapper (see below). I'm sure there's a good reason why database introspection is used here vs inferring from schema files, but I'd like to voice that a connection-less option would be valuable.

def connection
if @klass.respond_to?(:lease_connection)
@klass.lease_connection
else
@klass.connection
end
end

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions