django_sorcery.db.url module¶
-
django_sorcery.db.url.get_settings(alias)[source]¶ Returns database settings from either
SQLALCHEMY_CONNECTIONSsetting orDATABASESsetting.
-
django_sorcery.db.url.make_url(alias_or_url)[source]¶ - alias_or_url: str
- name of the alias or url as string
-
django_sorcery.db.url.make_url_from_settings(alias)[source]¶ - alias: str
- name of the alias
Overall settings are very similar with django database settings with a few extra keys.
USER- database userPASSWORD- database user passwordHOST- database hostNAME- database namePORT- database nameDIALECT- dialect to be used in url, if not provided, will use theDIALECT_MAPto figure out a dialect to be used in sqlalchemy urlDRIVER- If provided, will be used as the driver in sqlalchemy urlSQLALCHEMY- If provided, a customsqlalchemy.SQLAlchemyclass to be usedQUERY- querystring arguments for sqlalchemy urlALCHEMY_OPTIONS- Optional arguments to be used to initialize thesqlalchemy.SQLAlchemyinstancesession_class- a custom session class to be usedregistry_class- a custom registy class to be used for scopingmodel_class- a custom base model class to be used for declarative base models.metadata_class- a custom metadata class used in delclarative models.metadata_options- custom options to use in metadata creation such as specifying naming conventions.engine_options- arguments for sqlalchemycreate_enginesession_options- arguments for sqlalchemysessionmaker
Other options are ignored.