Skip to content
This repository

Sqlite gen_server port for Erlang. Creates, reads and writes to sqlite database.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Merge pull request #27 from maxlapshin/patch-1

support for encoding true/false to sqlite
latest commit 4a309c2d9c
Alexey Romanov authored August 15, 2013
Octocat-spinner-32 .settings Added project files April 19, 2012
Octocat-spinner-32 c_src compile debug print functionality only when DEBUG is defined April 01, 2013
Octocat-spinner-32 include Fixed handling of errors after columns are determined April 19, 2012
Octocat-spinner-32 src support for encoding true/false to sqlite August 15, 2013
Octocat-spinner-32 test Test added March 25, 2013
Octocat-spinner-32 .gitignore Ignoring generated doc directory February 24, 2012
Octocat-spinner-32 .project Added project files April 19, 2012
Octocat-spinner-32 AUTHORS Add an authors file which traces the history of my specific fork October 12, 2010
Octocat-spinner-32 GNUmakefile Don't remove priv/ entirely on make clean. January 15, 2011
Octocat-spinner-32 LICENSE CEAN packaging requires LICENSE. August 07, 2008
Octocat-spinner-32 Makefile Added debug target to Makefile April 20, 2011
Octocat-spinner-32 README.md fixed test file path in README April 01, 2013
Octocat-spinner-32 build_port_win.bat Fix build file name in build_port_win.bat June 18, 2012
Octocat-spinner-32 rebar Updated rebar from alexeyr/rebar/jr-winport2 May 09, 2011
Octocat-spinner-32 rebar.bat Add rebar.bat December 17, 2010
Octocat-spinner-32 rebar.config Separate rebar.config for dialyzer/gdb/valgrind January 13, 2011
Octocat-spinner-32 rebar.cross_compile.config.sample Moved cross-compilation config into master branch November 18, 2010
Octocat-spinner-32 rebar.debug.config Define DEBUG macros in rebar.debug.config April 20, 2011
Octocat-spinner-32 test.erl Fix test.erl script December 17, 2010
Octocat-spinner-32 test.sh Separate rebar.config for dialyzer/gdb/valgrind January 13, 2011
README.md

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.

Requirements

Erlang/OTP R14B is required, and SQLite 3 minimum version is 3.6.1.

Compiling

Linux

  1. Install SQLite3 by running sudo apt-get install sqlite3 or the equivalent for your package manager, or by compiling from the source.

  2. make.

Cross-compiling

If you want to use erlang-sqlite3 on an embedded device, it can be cross-compiled.

  1. Cross-compile SQLite3 and Erlang.

  2. Change variables and paths in rebar.cross_compile.config.sample to the desired values and rename it to rebar.cross_compile.config.

  3. make cross_compile.

Windows with MS Visual C++

  1. Download both the source amalgamation and the precompiled binary from http://www.sqlite.org/download.html. Extract files sqlite3.h from the amalgamation and sqlite3.def from the binary. Run this command from Visual Studio command prompt:

    lib /def:sqlite3.def

    to create the import library sqlite3.lib. In rebar.config, set the correct paths in tuples {"win32", "CFLAGS", "/Idirectory/containing/sqlite3.h/ /Ic_src /W4 /wd4100 /wd4204"} and {"win32", "LDFLAGS", "/path/to/sqlite3.lib"}.

  2. nmake.

DLL search path

Note that on Windows, sqlite3.dll usually won't be installed in the system-wide DLL search path. In this case, it should be placed in the working directory of your application.

Running the test suite

Linux

make test

Windows

  1. nmake tests

  2. If you get the error "Error loading sqlite3_drv: The specified module could not be found", this is because sqlite3.dll isn't in the search path. Copy it to the .eunit directory.

Example usage

See tests test/sqlite3_test.erl for a starting point.

Authors

See ./AUTHORS

Something went wrong with that request. Please try again.