~olly/yoyo#77: 
Can't get backend when working with in-memory SQLite database

When I try to use get_backend() function with a connection string which creates in-memory SQLite databases, I get errors. This is important for us since we use in-memory SQLite databases in our unit tests.

A minimal code to reproduce this is:

from yoyo import get_backend
connection_str = 'sqlite://'
get_backend(connection_str)

The error I get is:

Traceback (most recent call last):
  File "<input>", line 3, in <module>
  File "C:\Work\VirtualEnv\lib\site-packages\yoyo\connections.py", line 99, in get_backend
    return backend_class(parsed, migration_table)
  File "C:\Work\VirtualEnv\lib\site-packages\yoyo\backends.py", line 164, in __init__
    self._connection = self.connect(dburi)
  File "C:\Work\VirtualEnv\lib\site-packages\yoyo\backends.py", line 658, in connect
    conn = self.driver.connect(
TypeError: expected str, bytes or os.PathLike object, not NoneType

Python: 3.8

yoyo-migrations: 7.3.1

Status
RESOLVED FIXED
Submitter
~canol
Assigned to
No-one
Submitted
3 years ago
Updated
3 years ago
Labels
No labels applied.

~olly 3 years ago

Can you try against the latest version on sourcehut? I think https://hg.sr.ht/~olly/yoyo/rev/bf630e7d might fix this.

~canol 3 years ago

Yes, seems to be working. I had other errors, but they are probably related to a bug in my code.

~olly REPORTED FIXED 3 years ago

Register here or Log in to comment, or comment via email.