Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--load-extension for other sqlite-utils commands #137

Closed
simonw opened this issue Aug 21, 2020 · 1 comment
Closed

--load-extension for other sqlite-utils commands #137

simonw opened this issue Aug 21, 2020 · 1 comment
Labels
cli-tool enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Aug 21, 2020

e.g. for this:

calands-datasette % sqlite-utils tables calands.db --counts
[{"table": "spatial_ref_sys", "count": 4924},
 {"table": "spatialite_history", "count": 14},
 {"table": "sqlite_sequence", "count": 1},
 {"table": "geometry_columns", "count": 2},
 {"table": "spatial_ref_sys_aux", "count": 4873},
 {"table": "views_geometry_columns", "count": 0},
 {"table": "virts_geometry_columns", "count": 0},
 {"table": "geometry_columns_statistics", "count": 2},
 {"table": "views_geometry_columns_statistics", "count": 0},
 {"table": "virts_geometry_columns_statistics", "count": 0},
 {"table": "geometry_columns_field_infos", "count": 0},
 {"table": "views_geometry_columns_field_infos", "count": 0},
 {"table": "virts_geometry_columns_field_infos", "count": 0},
 {"table": "geometry_columns_time", "count": 2},
 {"table": "geometry_columns_auth", "count": 2},
 {"table": "views_geometry_columns_auth", "count": 0},
 {"table": "virts_geometry_columns_auth", "count": 0},
Traceback (most recent call last):
  File "/usr/local/bin/sqlite-utils", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/Cellar/sqlite-utils/2.15.1/libexec/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/sqlite-utils/2.15.1/libexec/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/sqlite-utils/2.15.1/libexec/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/sqlite-utils/2.15.1/libexec/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/sqlite-utils/2.15.1/libexec/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/sqlite-utils/2.15.1/libexec/lib/python3.8/site-packages/sqlite_utils/cli.py", line 143, in tables
    for line in output_rows(_iter(), headers, nl, arrays, json_cols):
  File "/usr/local/Cellar/sqlite-utils/2.15.1/libexec/lib/python3.8/site-packages/sqlite_utils/cli.py", line 922, in output_rows
    for row, next_row in itertools.zip_longest(current_iter, next_iter):
  File "/usr/local/Cellar/sqlite-utils/2.15.1/libexec/lib/python3.8/site-packages/sqlite_utils/cli.py", line 123, in _iter
    row.append(db[name].count)
  File "/usr/local/Cellar/sqlite-utils/2.15.1/libexec/lib/python3.8/site-packages/sqlite_utils/db.py", line 458, in count
    return self.db.conn.execute(
sqlite3.OperationalError: no such module: VirtualSpatialIndex

The tables command could take --load-extension too - as could rows and other similar commands.

Follow-on from #134

@simonw simonw added the enhancement New feature or request label Aug 21, 2020
@simonw
Copy link
Owner Author

simonw commented Aug 21, 2020

Adding --spatialite too would be great for usability: #136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli-tool enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant