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
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
The text was updated successfully, but these errors were encountered:
grimnight
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
Apr 5, 2024
Currently using both
insert-files
andconvert
is needed in order to create sqlar files, it would be more convenient if it could be done with just one command.The text was updated successfully, but these errors were encountered: