mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 09:24:31 +02:00
Fix for --multi combined with --dry-run, closes #415
This commit is contained in:
parent
878d5f5cea
commit
751ab205ac
2 changed files with 40 additions and 1 deletions
|
|
@ -2676,7 +2676,10 @@ def convert(
|
|||
raise click.ClickException(str(e))
|
||||
if dry_run:
|
||||
# Pull first 20 values for first column and preview them
|
||||
db.conn.create_function("preview_transform", 1, lambda v: fn(v) if v else v)
|
||||
preview = lambda v: fn(v) if v else v
|
||||
if multi:
|
||||
preview = lambda v: json.dumps(fn(v), default=repr) if v else v
|
||||
db.conn.create_function("preview_transform", 1, preview)
|
||||
sql = """
|
||||
select
|
||||
[{column}] as value,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue