Projetos
Ver no GitHub
ksindi/flask-sqlacodegen
Sobre
:sake: Automatic model code generator for SQLAlchemy with Flask support
Dados e análiseCrescimento medido de estrelas
- em 24 h
- 0
- em 7 dias
- 0
- em 15 dias
- 0
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
OriginalFlask sqlacodegen
Fork of sqlacodegen by Alex Gronholm.
What's different:
- Support for Flask-SQLAlchemy syntax using
--flaskoption. - Defaults to generating backrefs in relationships.
--nobackrefstill 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-colsignores 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-sqlacodegeninstead ofsqlacodegen. - Added support for
--notablesto only generate model classes, even for association tables
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
For contributing:
git clone https://github.com/ksindi/flask-sqlacodegen.git
python -m venv env
pip install -r requirements.txt
python -m sqlacodegen.main --flask --outfile models.py mysql+pymysql://<username>:<password>@<database-ip>:<port>/<database-name> [--tables <tablenames>] [--notables]
Explore projetos relacionados
Carregando…