Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
This is a very experimental database connection pooling implementation for Django | ||
|
||
Usage is simple. When you have currently this in settings.py: | ||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': ..., | ||
}, | ||
... | ||
} | ||
alter it to: | ||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django_pooled', | ||
'NAME': ..., | ||
'OPTIONS': { | ||
'WRAPS': 'django.db.backends.sqlite3', | ||
} | ||
}, | ||
... | ||
} | ||
|
||
Does it work? Not really. There are some problems: | ||
- Django doesn't offer any nice way for separating taking connections from initializing | ||
the state of the connection. This is all done in ._cursor(). Due to this, if the settings | ||
change -> you are screwed. This isn't really a problem in normal usage, but prevents | ||
running the Django's test suite. |