This commit is contained in:
Guillermo Garcia 2026-07-13 08:52:05 +00:00 committed by GitHub
commit c51736edd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 43 additions and 6 deletions

View file

@ -805,12 +805,8 @@ class Database:
:param alias: Alias name to use
:param filepath: Path to SQLite database file on disk
"""
attach_sql = """
ATTACH DATABASE '{}' AS {};
""".format(
str(pathlib.Path(filepath).resolve()), quote_identifier(alias)
).strip()
self.execute(attach_sql)
attach_sql = "ATTACH DATABASE ? AS {};".format(quote_identifier(alias))
self.execute(attach_sql, [str(pathlib.Path(filepath).resolve())])
def query(
self, sql: str, params: Optional[Union[Sequence, Dict[str, Any]]] = None