equal
deleted
inserted
replaced
6 Each of these API functions, except connection.close(), raises |
6 Each of these API functions, except connection.close(), raises |
7 ImproperlyConfigured. |
7 ImproperlyConfigured. |
8 """ |
8 """ |
9 |
9 |
10 from django.core.exceptions import ImproperlyConfigured |
10 from django.core.exceptions import ImproperlyConfigured |
11 from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations |
11 from django.db.backends import * |
|
12 from django.db.backends.creation import BaseDatabaseCreation |
12 |
13 |
13 def complain(*args, **kwargs): |
14 def complain(*args, **kwargs): |
14 raise ImproperlyConfigured, "You haven't set the DATABASE_ENGINE setting yet." |
15 raise ImproperlyConfigured, "You haven't set the DATABASE_ENGINE setting yet." |
15 |
16 |
16 def ignore(*args, **kwargs): |
17 def ignore(*args, **kwargs): |
23 pass |
24 pass |
24 |
25 |
25 class DatabaseOperations(BaseDatabaseOperations): |
26 class DatabaseOperations(BaseDatabaseOperations): |
26 quote_name = complain |
27 quote_name = complain |
27 |
28 |
28 class DatabaseWrapper(object): |
29 class DatabaseClient(BaseDatabaseClient): |
29 features = BaseDatabaseFeatures() |
30 runshell = complain |
30 ops = DatabaseOperations() |
31 |
|
32 class DatabaseIntrospection(BaseDatabaseIntrospection): |
|
33 get_table_list = complain |
|
34 get_table_description = complain |
|
35 get_relations = complain |
|
36 get_indexes = complain |
|
37 |
|
38 class DatabaseWrapper(object): |
31 operators = {} |
39 operators = {} |
32 cursor = complain |
40 cursor = complain |
33 _commit = complain |
41 _commit = complain |
34 _rollback = ignore |
42 _rollback = ignore |
35 |
43 |
36 def __init__(self, **kwargs): |
44 def __init__(self, *args, **kwargs): |
37 pass |
45 super(DatabaseWrapper, self).__init__(*args, **kwargs) |
|
46 |
|
47 self.features = BaseDatabaseFeatures() |
|
48 self.ops = DatabaseOperations() |
|
49 self.client = DatabaseClient() |
|
50 self.creation = BaseDatabaseCreation(self) |
|
51 self.introspection = DatabaseIntrospection(self) |
|
52 self.validation = BaseDatabaseValidation() |
38 |
53 |
39 def close(self): |
54 def close(self): |
40 pass |
55 pass |