Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 1 | """Base classes for storage engines""" |
Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 2 | from oslo_config import cfg |
| 3 | from oslo_db import api as db_api |
| 4 | |
Susanta Gautam | 73a52bb | 2021-04-27 16:01:11 +0545 | [diff] [blame] | 5 | _BACKEND_MAPPING = {"sqlalchemy": "staffeln.db.sqlalchemy.api"} |
| 6 | IMPL = db_api.DBAPI.from_config(cfg.CONF, backend_mapping=_BACKEND_MAPPING, lazy=True) |
Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 7 | |
| 8 | |
| 9 | def get_instance(): |
| 10 | """Return a DB API instance.""" |
| 11 | return IMPL |