#30 SQLite :memory: target unusable

SQLite (24)

The db connection URIs (used with connectForURI) for
sqlite don't seem to handle the special memory-resident
target, which sqlite calls :memory:.

Normally, if you tell sqlite to use a file named
:memory:, it will keep the database in memory instead
of using a file on disk. This worked fine with the (now
deprecated) SQLiteConnection(file=':memory:')
interface, but the current URI parsing can't handle it

Some examples:

URI: sqlite:/:memory:
_parseURI: user=None password=None host=None
path=/:memory: args={}

URI: sqlite://:memory:
_parseURI: user=None password=None host=:memory:
path=/ args={}

URI: sqlite:///:memory:
_parseURI: user=None password=None host=None
path=/:memory: args={}

In none of these does the path come out as :memory:.
Moreover, the first and third examples should probably
be considered correct, since those URIs identify the
file /:memory: , and not SQLite's pseudo-thing that
indicates the lack of a file.

But in the second URI, the parser interprets an
identifer after
schema:// as the host, and expects the path to follow
another '/' (which isn't supplied, in this example).

Since hosts have no other meaning in sqlite URIs, maybe
accepting a host named :memory: would be an acceptable

In the attached `svn diff`, I also removed the addition
of an extra leading '/' in
sqliteconnection.connectionFromURI, which
dbconnection._parseURI already provides.


  • Daniel Brown

    Daniel Brown - 2004-06-14
    • summary: :memory: target unusable --> SQLite :memory: target unusable
  • Ian Bicking

    Ian Bicking - 2004-08-18
    • status: open --> closed-fixed

Log in to post a comment.