Compare commits

...

2 commits

Author SHA1 Message Date
Simon Willison
fc2dcfca36 Merge remote-tracking branch 'origin/main' into fix/convert-dryrun-quote-identifier
# Conflicts:
#	sqlite_utils/cli.py
2026-08-12 14:07:24 -07:00
ikatyal2110
b8f0cb5a6c Fix convert --dry-run using bracket quoting instead of quote_identifier() 2026-08-06 21:03:31 +05:30

View file

@ -3281,14 +3281,16 @@ def convert(
return fn(v) if v else v return fn(v) if v else v
db.conn.create_function("preview_transform", 1, preview) db.conn.create_function("preview_transform", 1, preview)
col_quoted = quote_identifier(columns[0])
tbl_quoted = quote_identifier(table)
sql = """ sql = """
select select
[{column}] as value, {col} as value,
preview_transform([{column}]) as preview preview_transform({col}) as preview
from [{table}]{where} limit 10 from {tbl}{where} limit 10
""".format( """.format(
column=columns[0], col=col_quoted,
table=table, tbl=tbl_quoted,
where=f" where {where}" if where is not None else "", where=f" where {where}" if where is not None else "",
) )
for row in db.conn.execute(sql, where_args).fetchall(): for row in db.conn.execute(sql, where_args).fetchall():