2006-05-02 09:31:56 +08:00
|
|
|
"""
|
|
|
|
Dummy database backend for Django.
|
|
|
|
|
|
|
|
Django uses this if the DATABASE_ENGINE setting is empty (None or empty string).
|
|
|
|
|
|
|
|
Each of these API functions, except connection.close(), raises
|
|
|
|
ImproperlyConfigured.
|
|
|
|
"""
|
|
|
|
|
|
|
|
from django.core.exceptions import ImproperlyConfigured
|
2007-08-26 02:27:57 +08:00
|
|
|
from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations
|
2006-05-02 09:31:56 +08:00
|
|
|
|
|
|
|
def complain(*args, **kwargs):
|
|
|
|
raise ImproperlyConfigured, "You haven't set the DATABASE_ENGINE setting yet."
|
|
|
|
|
2007-06-02 00:30:38 +08:00
|
|
|
def ignore(*args, **kwargs):
|
|
|
|
pass
|
|
|
|
|
2006-05-02 09:31:56 +08:00
|
|
|
class DatabaseError(Exception):
|
|
|
|
pass
|
|
|
|
|
2007-04-25 18:18:56 +08:00
|
|
|
class IntegrityError(DatabaseError):
|
|
|
|
pass
|
|
|
|
|
2007-08-26 02:27:57 +08:00
|
|
|
class DatabaseOperations(BaseDatabaseOperations):
|
|
|
|
quote_name = complain
|
2007-08-20 06:29:57 +08:00
|
|
|
|
|
|
|
class DatabaseWrapper(object):
|
2007-08-26 02:27:57 +08:00
|
|
|
features = BaseDatabaseFeatures()
|
|
|
|
ops = DatabaseOperations()
|
2007-08-20 11:26:55 +08:00
|
|
|
operators = {}
|
2006-05-02 09:31:56 +08:00
|
|
|
cursor = complain
|
|
|
|
_commit = complain
|
2007-06-02 00:30:38 +08:00
|
|
|
_rollback = ignore
|
2006-05-02 09:31:56 +08:00
|
|
|
|
2006-11-07 13:17:38 +08:00
|
|
|
def __init__(self, **kwargs):
|
|
|
|
pass
|
|
|
|
|
2006-05-02 09:31:56 +08:00
|
|
|
def close(self):
|
2007-08-20 11:32:06 +08:00
|
|
|
pass
|