"missing" sqlite3 invocation option?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

"missing" sqlite3 invocation option?

John McKown
The sqlite3 command has a input command to ".read" a file which "contains
SQL in FILENAME". I am wondering why there isn't an equivalent command line
argument to do this. That is, have something like:

sqlite3 -f FILENAME database.db3

which would do the same as:

sqlite3 database.db3
sqlite> .read FILENAME
sqlite> .quit

This would mirror the PostgreSQL supplied psql command. For whatever that
is worth.

--
We all have skeletons in our closet.
Mine are so old, they have osteoporosis.

Maranatha! <><
John McKown
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: "missing" sqlite3 invocation option?

Simon Slavin-3
On 9 May 2018, at 7:32pm, John McKown <[hidden email]> wrote:

> The sqlite3 command has a input command to ".read" a file which "contains
> SQL in FILENAME". I am wondering why there isn't an equivalent command line
> argument to do this. That is, have something like:
>
> sqlite3 -f FILENAME database.db3
>
> which would do the same as:
>
> sqlite3 database.db3
> sqlite> .read FILENAME
> sqlite> .quit

You can use the piping facilities of your command shell.  Depending on which OS and shell you're using, it might be something like

sqlite3 database.db3 < FILENAME

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users