Databases (ixmp4.db)
Module contents
This module is responsible for everything database related. Interfacing, migrating and more is all done here.
It uses sqlalchemy and alembic for database management.
Migrations
There is a development database at run/db.sqlite
which is used for
generating migrations, nothing else. It can be manipulated with alembic
directly using these commands:
# run all migrations until the current state is reached
alembic upgrade head
# run one migration forward
alembic upgrade +1
# run one migration backward
alembic downgrade -1
# autogenerate new migration (please choose a descriptive change message)
alembic revision -m "<message>" --autogenerate
You will have to run all migrations before being able to create new ones
in the development database. Be sure to run ruff
on newly created
migrations before committing them!
Subpackages
Submodules
ixmp4.db.filters module
- ixmp4.db.filters.BaseFilter
alias of
BaseFilter
- class ixmp4.db.filters.FilterMeta(name: str, bases: tuple, namespace: dict, **kwargs)
Bases:
ModelMetaclass
- ixmp4.db.filters.escape_wildcard(v)
- ixmp4.db.filters.expand_simple_filter(value)
- ixmp4.db.filters.ilike(c, v)
- ixmp4.db.filters.in_(c, v)
- ixmp4.db.filters.like(c, v)
- ixmp4.db.filters.notilike(c, v)
- ixmp4.db.filters.notlike(c, v)