tags:

views:

43

answers:

1

I use the command line sqlite3 executable to check queries I make from my code.

Is there a way to read in pragma statements or other session setup (".mode csv" for example) when the executable starts up?

I know I can do a ".read " once I'm in, but that's tedious.

+2  A: 

Put a .sqliterc file in your home directory with the commands you want executed each time you start the sqlite3 command line tool.

Unix and Linux use ~/.sqliterc; Windows tries to find the location of .sqliterc using the environment variables USERPROFILE HOME HOMEDRIVE and HOMEPATH.

Doug Currie
That easy, huh? How come that is not documented anywhere? Or at least not that I could find on the homepage. Thanks.
thermans