Full path to database now works

e.g. datasette /tmp/blah.db

Previously this failed because it did not open with full path.
pull/81/head
Simon Willison 2017-11-12 14:23:41 -08:00
rodzic db3fa4abfa
commit efecae5a11
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -493,7 +493,7 @@ class Datasette:
m.update(data)
# List tables and their row counts
tables = {}
with sqlite3.connect('file:{}?immutable=1'.format(path.name), uri=True) as conn:
with sqlite3.connect('file:{}?immutable=1'.format(path), uri=True) as conn:
conn.row_factory = sqlite3.Row
table_names = [
r['name']
@ -504,7 +504,7 @@ class Datasette:
metadata[name] = {
'hash': m.hexdigest(),
'file': path.name,
'file': str(path),
'tables': tables,
}
self._metadata = metadata