SQLite Forum

CSV extension
Login
(Edited to cure recommended usage of nonexistent '-read' invocation option.)

You may be unaware that the SQLite CLI shell, upon startup, will read and interpret a file named .sqliterc if it can be found in the user's home directory. For things you want to make a "sqlite3 ..." invocation always do, that is far simpler than modifying the distribution and rebuilding it.

Similarly easy is to set an alias, resembling<code>
   alias sqlite3_loaded='sqlite3 -cmd \\'.load csv\\''
</code>or<code>
   alias sqlite3_loaded='sqlite3 -cmd \\'.read ~/my_special_sqlite_setup\\''
</code>
That's for the Bash shell; there is probably some way to do it with your favorite shell if you're stuck on Windows. (And good luck if that is cmd.exe!)

If you truly want to do what you asked about, the shell.c distributed with the amalgamation shows how to incorporate extension code into the executable image, without need of any .load operation.