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

support for pipes with .once #192

Open
danp opened this issue Nov 13, 2024 · 2 comments
Open

support for pipes with .once #192

danp opened this issue Nov 13, 2024 · 2 comments

Comments

@danp
Copy link
Contributor

danp commented Nov 13, 2024

Hey, thanks for this project!

When I use the official sqlite3 CLI I use .once's pipe support quite a bit:

https://sqlite.org/cli.html#writing_results_to_a_file

This means I can do something like:

.mode markdown
.once | pbcopy
select foo from bar;

Then end up with the output in markdown in my clipboard (on macOS), ready to paste somewhere (like GitHub).

I discovered litecli's .once doesn't support this, so I ended up with a file named | pbcopy.

Supporting pipes like this in litecli would be a nice addition.

@amjith
Copy link
Member

amjith commented Nov 13, 2024

I ended up with a file named | pbcopy

I'm so sorry. 😂

Reminds me of the time I tricked my friend into deleting his home folder by doing touch ? and touch ?? and touch ??? and he decided to delete the files by calling rm -f ?*. We were are a bunch of clowns.

Back to your request. This is possible (and probably easy). We have this in mycli. If you are feeling generous you can take a crack at a PR for litecli.

danp added a commit to danp/litecli that referenced this issue Nov 14, 2024
Mostly copied from mycli. Add tests for once as part of getting that
going.

Updates dbcli#192
danp added a commit to danp/litecli that referenced this issue Nov 14, 2024
Mostly copied from mycli. Add tests for once as part of getting that
going.

Updates dbcli#192
@danp
Copy link
Contributor Author

danp commented Nov 14, 2024

😬

All good! I don't do a lot of python but gave it a try at #193.

danp added a commit to danp/litecli that referenced this issue Nov 23, 2024
Mostly copied from mycli. Add tests for once as part of getting that
going.

Updates dbcli#192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants