Skip to main content

Flask extension for working with Alembic

Project description

Flask-DbMigrant

Flask extension for working with Alembic.

It can be used as an alternative for Flask-Migrate. It depends only on Flask and Alembic.

Installation

$ pip install Flask-DbMigrant

Usage

First create the dbmigrant object:

from flask_dbmigrant import DbMigrant
dbmigrant = DbMigrant()

Then initialize it using init_app method:

dbmigrant.init_app(app)  # app is your Flask app instance

The Flask app config should have CONFIG_MODULE and DB_MODULE keys.

CONFIG_MODULE is a name of the module from which DATABASE_URL is to be imported (DATABASE_URL is a connection string that tells what database to connect to).

DB_MODULE is a name of the module from which database models and metadata are to be imported.

Existing commands

  • flask db init

    create a migration repository and configure the environment

  • flask db migrate

    create a migration script

  • flask db upgrade

    execute the script

License

Flask-DbMigrant was created by Rafal Padkowski. It is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask_dbmigrant-1.0.3.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_dbmigrant-1.0.3-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file flask_dbmigrant-1.0.3.tar.gz.

File metadata

  • Download URL: flask_dbmigrant-1.0.3.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.0-79-generic

File hashes

Hashes for flask_dbmigrant-1.0.3.tar.gz
Algorithm Hash digest
SHA256 6e8a5f628757a8d4f9593a33969c9e5fa97c255c81710659de754e2221cbe19b
MD5 5842c9e1163e33a6cada9c0e8c7502d4
BLAKE2b-256 dba20b966202925dc98e9d603988a67a1968a7dbf421973c5d0c8f4ceac8cdbb

See more details on using hashes here.

File details

Details for the file flask_dbmigrant-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: flask_dbmigrant-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.0-79-generic

File hashes

Hashes for flask_dbmigrant-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 da8ff1b3a7c7c6f7dc650aeb831af94d3323497abdeeccd39f4ccaaaa5845151
MD5 02c0d603809c5e8c81fb3498d8c889ef
BLAKE2b-256 1a2a38829ec5761d092da0166c5c86814ddf454f400290344adb40104f3dcba3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page