Open penberg opened 1 year ago
It's also possible to do this, which is very reasonable: turso db shell $DB < file.sql
The important thing that's missing in either case is detection that input is not coming from a TTY. If we detect that, then the shell should not output its welcome message nor cook the terminal inputs and outputs. That will make it run a lot faster for large inputs.
The question is then: what is the output if processing entirely non-interactively?
The important thing that's missing in either case is detection that input is not coming from a TTY. If we detect that, then the shell should not output its welcome message nor cook the terminal inputs and outputs. That will make it run a lot faster for large inputs.
Or maybe just implement a --silent
/-s
flag, curl style?
The important thing that's missing in either case is detection that input is not coming from a TTY. If we detect that, then the shell should not output its welcome message nor cook the terminal inputs and outputs. That will make it run a lot faster for large inputs.
Or maybe just implement a
--silent
/-s
flag, curl style?
It looks pretty easy to do without an explicit flag: https://stackoverflow.com/questions/43947363/detect-if-a-command-is-piped-or-not
I feel like this sort of detection is pretty normal for unix-y sort of command line tools.
You can currently do
cat <file> | turso db shell <name>
but let's add an explicit command line option.