Skip to content

Commit 76c0c1e

Browse files
committed
Remove another double-quoted string usage in SQL in the core code
1 parent b987223 commit 76c0c1e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

datasette/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,12 +1014,12 @@ def _prepare_connection(self, conn, database):
10141014
for db_name, db in self.databases.items():
10151015
if count >= SQLITE_LIMIT_ATTACHED or db.is_memory:
10161016
continue
1017-
sql = 'ATTACH DATABASE "file:{path}?{qs}" AS [{name}];'.format(
1017+
sql = "ATTACH DATABASE ? AS {};".format(escape_sqlite(db_name))
1018+
location = "file:{path}?{qs}".format(
10181019
path=db.path,
10191020
qs="mode=ro" if db.is_mutable else "immutable=1",
1020-
name=db_name,
10211021
)
1022-
conn.execute(sql)
1022+
conn.execute(sql, [location])
10231023
count += 1
10241024

10251025
def add_message(self, request, message, type=INFO):

0 commit comments

Comments
 (0)