SQLite Forum

Feature request: Dynamically execute SQL from shell
Hi Keith, is there an easy way to make extensions available to the shell? Ages ago you showed me how to make them available to my c code by adding a core_init function to bottom of the sqlite3.c amalgamation file and adding the wanted extensions.

#include "eval.c"
#include "carray.c"
#include "btreeinfo.c"

int core_init(const char* dummy)
	int nErr = 0;
	nErr += sqlite3_auto_extension((void(*)())sqlite3_eval_init);
	nErr += sqlite3_auto_extension((void(*)())sqlite3_carray_init);
	nErr += sqlite3_auto_extension((void(*)())sqlite3_btreeinfo_init);
	return nErr ? SQLITE_ERROR : SQLITE_OK;