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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2006-05-02 09:31:56 +08:00
|
|
|
class DatabaseWrapper:
|
|
|
|
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):
|
|
|
|
pass # close()
|
|
|
|
|
|
|
|
supports_constraints = False
|
2007-06-23 22:16:00 +08:00
|
|
|
supports_tablespaces = False
|
2006-05-02 09:31:56 +08:00
|
|
|
quote_name = complain
|
|
|
|
dictfetchone = complain
|
|
|
|
dictfetchmany = complain
|
|
|
|
dictfetchall = complain
|
|
|
|
get_last_insert_id = complain
|
|
|
|
get_date_extract_sql = complain
|
|
|
|
get_date_trunc_sql = complain
|
2007-06-28 10:52:54 +08:00
|
|
|
get_datetime_cast_sql = complain
|
2006-05-02 09:31:56 +08:00
|
|
|
get_limit_offset_sql = complain
|
|
|
|
get_random_function_sql = complain
|
2007-02-27 01:33:27 +08:00
|
|
|
get_deferrable_sql = complain
|
2006-06-04 07:28:24 +08:00
|
|
|
get_fulltext_search_sql = complain
|
2006-05-02 09:31:56 +08:00
|
|
|
get_drop_foreignkey_sql = complain
|
2007-06-28 10:52:54 +08:00
|
|
|
get_pk_default_value = complain
|
|
|
|
get_max_name_length = ignore
|
|
|
|
get_start_transaction_sql = complain
|
|
|
|
get_autoinc_sql = complain
|
2007-03-01 21:11:08 +08:00
|
|
|
get_sql_flush = complain
|
2007-04-06 10:25:58 +08:00
|
|
|
get_sql_sequence_reset = complain
|
2007-03-01 21:11:08 +08:00
|
|
|
|
2006-05-02 09:31:56 +08:00
|
|
|
OPERATOR_MAPPING = {}
|