mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
--load-extension=spatialite shortcut, closes #1028
This commit is contained in:
parent
a4def0b8db
commit
6aa5886379
6 changed files with 54 additions and 6 deletions
|
|
@ -19,6 +19,7 @@ from .utils import (
|
|||
SpatialiteConnectionProblem,
|
||||
temporary_docker_directory,
|
||||
value_as_boolean,
|
||||
SpatialiteNotFound,
|
||||
StaticMount,
|
||||
ValueAsBooleanError,
|
||||
)
|
||||
|
|
@ -78,7 +79,6 @@ def cli():
|
|||
"--load-extension",
|
||||
envvar="SQLITE_EXTENSIONS",
|
||||
multiple=True,
|
||||
type=click.Path(exists=True, resolve_path=True),
|
||||
help="Path to a SQLite extension to load",
|
||||
)
|
||||
def inspect(files, inspect_file, sqlite_extensions):
|
||||
|
|
@ -299,7 +299,6 @@ def uninstall(packages, yes):
|
|||
"--load-extension",
|
||||
envvar="SQLITE_EXTENSIONS",
|
||||
multiple=True,
|
||||
type=click.Path(exists=True, resolve_path=True),
|
||||
help="Path to a SQLite extension to load",
|
||||
)
|
||||
@click.option(
|
||||
|
|
@ -433,7 +432,10 @@ def serve(
|
|||
kwargs["config_dir"] = pathlib.Path(files[0])
|
||||
files = []
|
||||
|
||||
ds = Datasette(files, **kwargs)
|
||||
try:
|
||||
ds = Datasette(files, **kwargs)
|
||||
except SpatialiteNotFound:
|
||||
raise click.ClickException("Could not find SpatiaLite extension")
|
||||
|
||||
if return_instance:
|
||||
# Private utility mechanism for writing unit tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue