mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 01:44:31 +02:00
Merge 551a1173b8 into a947dc6739
This commit is contained in:
commit
c51736edd7
3 changed files with 43 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue