mirror of
https://github.com/pydantic/pydantic-ai-harness.git
synced 2026-07-21 10:55:35 +00:00
fix(memory): use qmark placeholders in SQLite prefix listing
This commit is contained in:
@@ -271,9 +271,11 @@ class SqliteMemoryStore:
|
||||
# ASCII by default, which would leak listings across case-variant
|
||||
# namespaces (`Alice/` vs `alice/`); it also treats `%`/`_` as
|
||||
# wildcards, and scope segments may legally contain `_`.
|
||||
# Plain qmark placeholders: mixing numbered `?1` with a parameter
|
||||
# sequence is deprecated on 3.12 and an error on 3.14.
|
||||
rows = connection.execute(
|
||||
'SELECT path FROM memory_files WHERE substr(path, 1, length(?1)) = ?1 ORDER BY path',
|
||||
(prefix,),
|
||||
'SELECT path FROM memory_files WHERE substr(path, 1, length(?)) = ? ORDER BY path',
|
||||
(prefix, prefix),
|
||||
).fetchall()
|
||||
return [str(row[0]) for row in rows]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user