SQLite Forum

SQLite3.exe - How to use arguments AND remain in interactive mode?
Login
I am using often SQLite3.exe (Windows 10) and would like to start with command line parameters but then remain in interactive mode.

I only get either or.... but is there any trick to start with parameters AND  remain in interactive command line mode?

~~~
D:\Debug>sqlite3.exe :memory: .load SQLite3.dll
Usage: .load FILE ?ENTRYPOINT?

D:\Debug>sqlite3.exe :memory: ".load SQLite3.dll"

D:\Debug>sqlite3.exe :memory: ".load SQLite3.dll" -
sqlite3.exe: Error: unknown option: -
Use -help for a list of options.

D:\Debug>sqlite3.exe :memory: ".load SQLite3.dll" .interactive
Error: unknown command or invalid arguments:  "interactive". Enter ".help" for help

D:\Debug>sqlite3.exe .help
SQLite version 3.36.0 2021-06-18 18:36:39
Enter ".help" for usage hints.
sqlite>

.exit
D:\Debug>sqlite3.exe :memory: ".load SQLite3.dll" --
sqlite3.exe: Error: unknown option: -
Use -help for a list of options.

D:\Debug>sqlite3.exe -help
Usage: sqlite3.exe [OPTIONS] FILENAME [SQL]
FILENAME is the name of an SQLite database. A new database is created
if the file does not previously exist.
OPTIONS include:
   -A ARGS...           run ".archive ARGS" and exit
   -append              append the database to the end of the file
   -ascii               set output mode to 'ascii'
   -bail                stop after hitting an error
   -batch               force batch I/O
   -box                 set output mode to 'box'
   -column              set output mode to 'column'
   -cmd COMMAND         run "COMMAND" before reading stdin
   -csv                 set output mode to 'csv'
   -deserialize         open the database using sqlite3_deserialize()
   -echo                print commands before execution
   -init FILENAME       read/process named file
   -[no]header          turn headers on or off
   -help                show this message
   -html                set output mode to HTML
   -interactive         force interactive I/O
   -json                set output mode to 'json'
   -line                set output mode to 'line'
   -list                set output mode to 'list'
   -lookaside SIZE N    use N entries of SZ bytes for lookaside memory
   -markdown            set output mode to 'markdown'
   -maxsize N           maximum size for a --deserialize database
   -memtrace            trace all memory allocations and deallocations
   -mmap N              default mmap size set to N
   -newline SEP         set output row separator. Default: '\n'
   -nofollow            refuse to open symbolic links to database files
   -nullvalue TEXT      set text string for NULL values. Default ''
   -pagecache SIZE N    use N slots of SZ bytes each for page cache memory
   -quote               set output mode to 'quote'
   -readonly            open the database read-only
   -separator SEP       set output column separator. Default: '|'
   -stats               print memory stats before each finalize
   -table               set output mode to 'table'
   -tabs                set output mode to 'tabs'
   -version             show SQLite version
   -vfs NAME            use NAME as the default VFS
   -zip                 open the file as a ZIP Archive

D:\Debug>sqlite3.exe -interactive :memory: ".load SQLite3.dll"

D:\Debug>
~~~

In this example the SQLite3.dll contains my loadable extension functions and virtual table extensions, it is based on the 3.36 amalgamation.

The .load parameter was executed successfully but then the executable terminated immediately - without remaining in interactive mode.
Some arguments which I tried did not help, they are unknown. The .help command does not show me any option which would be good to remain in interactive mode when using command line parameters. Is there a trick which I do not know yet?

~~~
Usage: sqlite3.exe [OPTIONS] FILENAME [SQL]

 -interactive         force interactive I/O

~~~

## How to use this option together with the other dot-arguments like .load, which the usage hint does not even show as optional?