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
db.conn.create_function("preview_transform", 1, preview)
col_quoted = quote_identifier(columns[0])
tbl_quoted = quote_identifier(table)
sql = """
select
[{column}] as value,
preview_transform([{column}]) as preview
from [{table}]{where} limit 10
{col} as value,
preview_transform({col}) as preview
from {tbl}{where} limit 10
""".format(
column=columns[0],
table=table,
col=col_quoted,
tbl=tbl_quoted,
where=f" where {where}" if where is not None else "",
)
for row in db.conn.execute(sql, where_args).fetchall():