ForkofsqlacodegenbyAlexGronholm.Basedoffofversion1.1.6.
What'sdifferent:
SupportforFlask-SQLAlchemysyntaxusing--flaskoption.Defaultstogeneratingbackrefsinrelationships.--nobackrefstillincludedasoptionincasebackrefsarenotwanted.Namingofbackrefsisclassnameinsnake_case(asopposedtoCamelCase)andispluralizedifit'sMany-to-OneorMany-to-Manyusinginflect.Primaryjoinsareexplicit.Ifcolumnhasaserver_defaultsetittoFetchValue()insteadoftryingtodeterminewhatthatvalueis.Originalcodedidnotsettherightserverdefaultsinmysetup.--ignore-colsignoresspecialcolumnswhengeneratingassociationtables.Originalcoderequiresallcolumnstobeforeignkeysinordertogenerateassociationtable.Example:--ignore-colsid,inserted,updated.Usesthecommandflask-sqlacodegeninsteadofsqlacodegen.Addedsupportfor--notablestoonlygeneratemodelclasses,evenforassociationtablesInstallWithpip:
pipinstallflask-sqlacodegenWithoutpip:
gitclonehttps://github.com/ksindi/flask-sqlacodegen.gitcdflask-sqlacodegen/pythonsetup.pyinstallForcontributing:
gitclonehttps://github.com/ksindi/flask-sqlacodegen.gitpython-mvenvenvpipinstall-rrequirements.txtpython-msqlacodegen.main--flask--outfilemodels.pymysql+pymysql://<username>:<password>@<database-ip>:<port>/<database-name>[--tables<tablenames>][--notables]
评论