Erlang wrapper for SQLite3
This library allows you to work with SQLite3 databases from Erlang.
It is compatible with Windows and Linux, and should probably work on other OSes as well.
See also esqlite for an alternative library.
Erlang/OTP R14B or later is required (tested up to 17.3 at this writing), and SQLite 3 minimum version is 3.6.1.
Install SQLite3 by running
sudo apt-get install sqlite3or the equivalent for your package manager, or by compiling from the source.
If you want to use erlang-sqlite3 on an embedded device, it can be cross-compiled.
Change variables and paths in
rebar.cross_compile.config.sampleto the desired values and rename it to
Windows with MS Visual C++
To build both SQLite3 and sqlite3-erlang:
If MSVC tools (
link, etc.) are not in the path, run
vcvars64.batdepending on whether you use 32-bit or 64-bit Erlang.
build_port_win64.bathave the standard paths for VC10.0.
Alternately, you can use prebuilt versions of
sqlite3.def. To make
lib /def:sqlite3.def. Then remove
sqlite3.lib targets from
Makefile and do as above.
Potential compilation problems
- If SQLite was built with
SQLITE_OMIT_LOAD_EXTENSIONoption, you'll need to undefine
ERLANG_SQLITE3_LOAD_EXTENSIONmacro in <c_src/sqlite3_drv.h>.
Running the test suite
If you get the error
"Error loading sqlite3_drv: The specified module could not be found", this is because
sqlite3.dllisn't in the search path.
test/sqlite3_test.erl for a starting point. On Windows note that
sqlite3.dll must be in your application's working directory or somewhere in the DLL search path.