Skip to main content

Automatic model code generator for SQLAlchemy with Flask support

Project description

GitHub page: flask-sqlacodegen

Fork of sqlacodegen by Alex Gronholm. Based off of version 1.1.6.

What’s different:

  • Support for Flask-SQLAlchemy syntax using --flask option.

  • Defaults to generating backrefs in relationships. --nobackref still included as option in case backrefs are not wanted.

  • Naming of backrefs is class name in snake_case (as opposed to CamelCase) and is pluralized if it’s Many-to-One or Many-to-Many using inflect.

  • Primary joins are explicit.

  • If column has a server_default set it to FetchValue() instead of trying to determine what that value is. Original code did not set the right server defaults in my setup.

  • --ignore-cols ignores special columns when generating association tables. Original code requires all columns to be foreign keys in order to generate association table. Example: --ignore-cols id,inserted,updated.

  • Uses the command flask-sqlacodgen instead of sqlacodegen.

Install

With pip:

pip install flask-sqlacodegen

Without pip:

git clone https://github.com/ksindi/flask-sqlacodegen.git
cd flask-sqlacodegen/
python setup.py install

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-sqlacodegen-1.1.7.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

flask_sqlacodegen-1.1.7-py2.py3-none-any.whl (12.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file flask-sqlacodegen-1.1.7.tar.gz.

File metadata

  • Download URL: flask-sqlacodegen-1.1.7.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for flask-sqlacodegen-1.1.7.tar.gz
Algorithm Hash digest
SHA256 442dc9619364f6e479d6003afa826c43eb6454ff511ffe7c60ae21a56aa65ac1
MD5 bd6e40e81965629f61e11d58615b08d6
BLAKE2b-256 f45a42418516222efcc77e7544c79854bb717f13da825220ac0dedd19315d75f

See more details on using hashes here.

File details

Details for the file flask_sqlacodegen-1.1.7-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for flask_sqlacodegen-1.1.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 212297dc9293e80ba3af258f3c1e9915eaf4f61adea40d4f555cd356237bc86f
MD5 9d3b1100b49f987eb282491835c0c5df
BLAKE2b-256 230132a181c0bb28c737fd5dcef14d2c1da78c49010378c034c8719918f4b717

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