Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 58 lines (29 sloc) 1.983 kb
600656b @alexeyr Restored README
authored
1 # Erlang wrapper for SQLite3
6383713 @alexeyr Improved README, switched to markdown
authored
2
600656b @alexeyr Restored README
authored
3 This library allows you to work with SQLite3 databases from Erlang.
6383713 @alexeyr Improved README, switched to markdown
authored
4
600656b @alexeyr Restored README
authored
5 It is compatible with Windows and Linux, and should probably work on other OSes as well.
6383713 @alexeyr Improved README, switched to markdown
authored
6
600656b @alexeyr Restored README
authored
7 ## Compiling
6383713 @alexeyr Improved README, switched to markdown
authored
8
600656b @alexeyr Restored README
authored
9 ### Linux
6383713 @alexeyr Improved README, switched to markdown
authored
10
600656b @alexeyr Restored README
authored
11 1. Install SQLite3 by running `sudo apt-get install sqlite3` or the equivalent for your package manager, or by [compiling from the source](http://source.online.free.fr/Linux_HowToCompileSQLite.html).
6383713 @alexeyr Improved README, switched to markdown
authored
12
600656b @alexeyr Restored README
authored
13 2. `make`.
6383713 @alexeyr Improved README, switched to markdown
authored
14
600656b @alexeyr Restored README
authored
15 ### Cross-compiling
16
17 If you want to use erlang-sqlite3 on an embedded device, it can be cross-compiled.
18
19 1. Cross-compile [SQLite3](http://www.sqlite.org/cvstrac/wiki?p=HowToCompile) and [Erlang](http://www.erlang.org/doc/installation_guide/INSTALL-CROSS.html).
20
21 2. Change variables and paths in `rebar.cross_compile.config.sample` to the desired values and rename it to `rebar.cross_compile.config`.
22
23 3. `make cross_compile`.
24
25 ### Windows with MS Visual C++
26
27 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:
28
29 lib /def:sqlite3.def
30
31 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"}`.
32
33 2. `nmake`.
34
35 ## DLL search path
36
37 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.
38
39 ## Running the test suite
40
41 ### Linux
42
43 `make test`
44
45 ### Windows
46
47 1. `nmake tests`
48
49 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.
50
51 ## Example usage
52
53 See tests `src/sqlite3_test.erl` for a starting point.
54
55 ## Authors
56
57 See ./AUTHORS
Something went wrong with that request. Please try again.