Use load_extension(?) instead of fstring

This commit is contained in:
Simon Willison 2021-12-17 12:15:29 -08:00 committed by GitHub
commit f000a7bd75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -553,7 +553,7 @@ class Datasette:
if self.sqlite_extensions:
conn.enable_load_extension(True)
for extension in self.sqlite_extensions:
conn.execute(f"SELECT load_extension('{extension}')")
conn.execute("SELECT load_extension(?)", [extension])
if self.setting("cache_size_kb"):
conn.execute(f"PRAGMA cache_size=-{self.setting('cache_size_kb')}")
# pylint: disable=no-member