From d3d1e599211c31e05d095b878de517dbb6fc998c Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sat, 18 Aug 2012 14:16:52 +0100 Subject: [PATCH] Add a SQlite backend. One test passes! --- django/db/backends/sqlite3/base.py | 5 +++++ django/db/backends/sqlite3/schema.py | 6 ++++++ tests/modeltests/schema/tests.py | 12 ++++++------ 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 django/db/backends/sqlite3/schema.py diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index 08800791898..7918d5d3ef8 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -18,6 +18,7 @@ from django.db.backends.signals import connection_created from django.db.backends.sqlite3.client import DatabaseClient from django.db.backends.sqlite3.creation import DatabaseCreation from django.db.backends.sqlite3.introspection import DatabaseIntrospection +from django.db.backends.sqlite3.schema import DatabaseSchemaEditor from django.utils.dateparse import parse_date, parse_datetime, parse_time from django.utils.functional import cached_property from django.utils.safestring import SafeString @@ -336,6 +337,10 @@ class DatabaseWrapper(BaseDatabaseWrapper): if self.settings_dict['NAME'] != ":memory:": BaseDatabaseWrapper.close(self) + def schema_editor(self): + "Returns a new instance of this backend's SchemaEditor" + return DatabaseSchemaEditor(self) + FORMAT_QMARK_REGEX = re.compile(r'(?