mirror of
https://github.com/jazzband/dj-database-url.git
synced 2026-03-16 22:20:24 +00:00
Empty sqlite path will now use a :memory: database
This commit is contained in:
parent
4cb5f889bf
commit
fc70e019ba
1 changed files with 5 additions and 0 deletions
|
|
@ -53,6 +53,11 @@ def parse(url):
|
|||
path = url.path[1:]
|
||||
path = path.split('?', 2)[0]
|
||||
|
||||
# if we are using sqlite and we have no path, then assume we
|
||||
# want an in-memory database (this is the behaviour of sqlalchemy)
|
||||
if url.scheme == 'sqlite' and path == '':
|
||||
path = ':memory:'
|
||||
|
||||
# Update with environment configuration.
|
||||
config.update({
|
||||
'NAME': path,
|
||||
|
|
|
|||
Loading…
Reference in a new issue