mariadb.py 831 B

12345678910111213141516171819202122232425262728293031
  1. # dialects/mysql/mariadb.py
  2. # Copyright (C) 2005-2024 the SQLAlchemy authors and contributors
  3. # <see AUTHORS file>
  4. #
  5. # This module is part of SQLAlchemy and is released under
  6. # the MIT License: https://www.opensource.org/licenses/mit-license.php
  7. from .base import MariaDBIdentifierPreparer
  8. from .base import MySQLDialect
  9. class MariaDBDialect(MySQLDialect):
  10. is_mariadb = True
  11. supports_statement_cache = True
  12. name = "mariadb"
  13. preparer = MariaDBIdentifierPreparer
  14. def loader(driver):
  15. driver_mod = __import__(
  16. "sqlalchemy.dialects.mysql.%s" % driver
  17. ).dialects.mysql
  18. driver_cls = getattr(driver_mod, driver).dialect
  19. return type(
  20. "MariaDBDialect_%s" % driver,
  21. (
  22. MariaDBDialect,
  23. driver_cls,
  24. ),
  25. {"supports_statement_cache": True},
  26. )