Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to insert files piped to insert-files stdin #127

Closed
simonw opened this issue Jul 27, 2020 · 3 comments
Closed

Ability to insert files piped to insert-files stdin #127

simonw opened this issue Jul 27, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Jul 27, 2020

Inserting files by piping them in should work - but since a filename cannot be derived this will need a --name blah.gif option.

cat blah.gif | sqlite-utils insert-files files.db files - --name=blah.gif

Originally posted by @simonw in #122 (comment)

@simonw simonw added the enhancement New feature or request label Jul 27, 2020
@simonw
Copy link
Owner Author

simonw commented Jul 27, 2020

I tried to get this working but it was a bit tricky because - doesn't behave like a regular pathlib.Path - needs a bit more thought on how the implementation would work.

@simonw
Copy link
Owner Author

simonw commented Jul 30, 2020

Maybe could do this using an improved version of this lambda? Could teach it to look for - and read from sys.stdin if it sees it.

"content": lambda p: p.resolve().read_bytes(),

@simonw simonw closed this as completed in 8fe1e6d Jul 30, 2020
@simonw
Copy link
Owner Author

simonw commented Jul 30, 2020

simonw added a commit that referenced this issue Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant