Handling special case of sqlite://:memory:

This commit is contained in:
carlio 2013-01-05 11:25:37 +01:00
parent fc70e019ba
commit a14743d00b

View file

@ -45,6 +45,17 @@ def config(env=DEFAULT_ENV, default=None):
def parse(url):
"""Parses a database URL."""
if url == 'sqlite://:memory:':
# this is a special case, because if we pass this URL into
# urlparse, urlparse will choke trying to interpret "memory"
# as a port number
return {
'ENGINE': SCHEMES['sqlite'],
'NAME': ':memory:'
}
# note: no other settings are required for sqlite
# otherwise parse the url as normal
config = {}
url = urlparse.urlparse(url)