summaryrefslogtreecommitdiff
path: root/frontend/db/backends/afe/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/db/backends/afe/base.py')
-rw-r--r--frontend/db/backends/afe/base.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/frontend/db/backends/afe/base.py b/frontend/db/backends/afe/base.py
new file mode 100644
index 00000000..6d617d20
--- /dev/null
+++ b/frontend/db/backends/afe/base.py
@@ -0,0 +1,22 @@
+from django.db.backends.mysql.base import DatabaseCreation as MySQLCreation
+from django.db.backends.mysql.base import DatabaseOperations as MySQLOperations
+from django.db.backends.mysql.base import DatabaseWrapper as MySQLDatabaseWrapper
+from django.db.backends.mysql.base import DatabaseIntrospection as MySQLIntrospection
+
+try:
+ import MySQLdb as Database
+except ImportError, e:
+ from django.core.exceptions import ImproperlyConfigured
+ raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
+
+
+class DatabaseOperations(MySQLOperations):
+ compiler_module = "autotest_lib.frontend.db.backends.afe.compiler"
+
+
+class DatabaseWrapper(MySQLDatabaseWrapper):
+ def __init__(self, *args, **kwargs):
+ super(DatabaseWrapper, self).__init__(*args, **kwargs)
+ self.creation = MySQLCreation(self)
+ self.ops = DatabaseOperations()
+ self.introspection = MySQLIntrospection(self)