Skip to content

Loading resources from memory #648

@layday

Description

@layday

Alembic uses __file__ to locate both templates and migrations on disk and, although Alembic ostensibly appears to support in-package migration environments [1], it attempts to resolve the script_location on disk. This reliance on __file__ makes embedding Alembic in freezers and ZIP apps difficult. Are there plans to support the new resource API for reading templates and migrations contained in packages going forward, which would allow loading resources from memory?

[1]

For support of applications that package themselves into .egg files, the value can also be specified as a package resource, in which case resource_filename() is used to find the file (new in 0.2.2). Any non-absolute URI which contains colons is interpreted here as a resource name, rather than a straight filename.

https://alembic.sqlalchemy.org/en/latest/tutorial.html?highlight=script_location

Metadata

Metadata

Assignees

No one assigned

    Labels

    on holduse casenot quite a feature and not quite a bug, something we just didn't think of

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions