Applied Black, refs #1789

This commit is contained in:
Simon Willison 2022-08-23 11:35:41 -07:00
commit fd1086c686
2 changed files with 3 additions and 2 deletions

View file

@ -559,8 +559,8 @@ class Datasette:
if self.sqlite_extensions:
conn.enable_load_extension(True)
for extension in self.sqlite_extensions:
# "extension" is either a string path to the extension
# or a 2-item tuple that specifies which entrypoint to load.
# "extension" is either a string path to the extension
# or a 2-item tuple that specifies which entrypoint to load.
if isinstance(extension, tuple):
path, entrypoint = extension
conn.execute("SELECT load_extension(?, ?)", [path, entrypoint])

View file

@ -833,6 +833,7 @@ class StaticMount(click.ParamType):
self.fail(f"{value} is not a valid directory path", param, ctx)
return path, dirpath
# The --load-extension parameter can optionally include a specific entrypoint.
# This is done by appending ":entrypoint_name" after supplying the path to the extension
class LoadExtension(click.ParamType):