You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: sqlite-utils insert-files should be able to convert fields #597
Currently using both insert-files and convert is needed in order to create sqlar files, it would be more convenient if it could be done with just one command.
~
❯ cat test.py
import os
class Example:
def __init__(self, arg1, arg2):
self.arg1 = arg1
~
❯ sqlite-utils insert-files test.sqlar sqlar test.py -c name:name -c data:content -c mode:mode -c mtime:mtime -c sz:size --pk=name
[####################################] 100%~
❯ sqlite-utils convert test.sqlar sqlar data "zlib.compress(value)" --import=zlib --where "name = 'test.py'"
[####################################] 100%~
❯ cat test.py | sqlite-utils convert test.sqlar sqlar data "zlib.compress(sys.stdin.buffer.read())" --import=zlib --import=sys --where "name = 'test.py'"# Alternative way
[####################################] 100%~
❯ sqlite3 test.sqlar "SELECT hex(data) FROM sqlar WHERE name = 'test.py';"| python3 -c"import sys, zlib; sys.stdout.buffer.write(zlib.decompress(bytes.fromhex(sys.stdin.read())))"
import os
class Example:
def __init__(self, arg1, arg2):
self.arg1 = arg1
~
❯ rm test.py
~
❯ sqlar -l test.sqlar
test.py
~
❯ sqlar -x test.sqlar
~
❯ cat test.py
import os
class Example:
def __init__(self, arg1, arg2):
self.arg1 = arg1
changed the title [-]sqlite-utils insert-files should be able to convert fields[/-][+]Feature request: sqlite-utils insert-files should be able to convert fields[/+]on Apr 5, 2024
Hi, I’ve been working on this issue and have a local solution that adds --convert and --import to insert-files. I’d like to test it a bit more before opening a PR.
Could you assign the issue to me? I’d also appreciate any feedback or suggestions you have about this approach.
Activity
[-]sqlite-utils insert-files should be able to convert fields[/-][+]Feature request: sqlite-utils insert-files should be able to convert fields[/+]Just-Basij commentedon Oct 27, 2026
Hi, I’ve been working on this issue and have a local solution that adds --convert and --import to insert-files. I’d like to test it a bit more before opening a PR.
Could you assign the issue to me? I’d also appreciate any feedback or suggestions you have about this approach.