Skip to content

Commit ed0d893

Browse files
committed
Address review comment
1 parent a08569d commit ed0d893

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

litecli/sqlexecute.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import sqlparse
1616
import os.path
17+
from urllib.parse import urlparse
1718

1819
from .packages import special
1920

@@ -68,10 +69,11 @@ def connect(self, database=None):
6869
db = database or self.dbname
6970
_logger.debug("Connection DB Params: \n\tdatabase: %r", db)
7071

71-
if db.startswith("file:"):
72+
location = urlparse(db)
73+
if location.scheme and location.scheme == "file":
7274
uri = True
7375
db_name = db
74-
db_filename, *_ = db_name[5:].split("?", 1)
76+
db_filename = location.path
7577
else:
7678
uri = False
7779
db_filename = db_name = os.path.expanduser(db)

0 commit comments

Comments
 (0)