mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Full path to database now works
e.g. datasette /tmp/blah.db Previously this failed because it did not open with full path.
This commit is contained in:
parent
db3fa4abfa
commit
efecae5a11
1 changed files with 2 additions and 2 deletions
|
|
@ -493,7 +493,7 @@ class Datasette:
|
||||||
m.update(data)
|
m.update(data)
|
||||||
# List tables and their row counts
|
# List tables and their row counts
|
||||||
tables = {}
|
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
|
conn.row_factory = sqlite3.Row
|
||||||
table_names = [
|
table_names = [
|
||||||
r['name']
|
r['name']
|
||||||
|
|
@ -504,7 +504,7 @@ class Datasette:
|
||||||
|
|
||||||
metadata[name] = {
|
metadata[name] = {
|
||||||
'hash': m.hexdigest(),
|
'hash': m.hexdigest(),
|
||||||
'file': path.name,
|
'file': str(path),
|
||||||
'tables': tables,
|
'tables': tables,
|
||||||
}
|
}
|
||||||
self._metadata = metadata
|
self._metadata = metadata
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue