Giter Site home page Giter Site logo

dnet / erlang-sqlite3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexeyr/erlang-sqlite3

0.0 3.0 2.0 956 KB

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

License: Other

Shell 0.17% C 38.62% Erlang 61.21%

erlang-sqlite3's Introduction

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

erlang-sqlite3's People

Contributors

alexeyr avatar maxlapshin avatar sergey-miryanov avatar rflynn avatar dnet avatar ttyerlsol avatar booo avatar uwiger avatar rflynn93 avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.