ttyerl / sqlite-erlang Goto Github PK
View Code? Open in Web Editor NEWSqlite gen_server port for Erlang. Creates, reads and writes to sqlite database.
License: Other
Sqlite gen_server port for Erlang. Creates, reads and writes to sqlite database.
License: Other
In order to use sqlite-erlang, the priv dir containing the sqlite-port
executable must be on the PATH environment variable. The following patch solves the problem (I hope the formatting comes out correctly...).
Edit: unfortunately, this only seems to work when sqlite is in ERL_LIBS environment variable or an absolute path is given to -pa. code:priv_dir/1
doesn't work with relative paths specified like -pa ebin
.
diff --git a/src/sqlite.erl b/src/sqlite.erl
index 0bdb7c9..3a2736c 100644
--- a/src/sqlite.erl
+++ b/src/sqlite.erl
@@ -442,7 +442,7 @@ code_change(_OldVsn, State, _Extra) ->
%%--------------------------------------------------------------------
create_cmd(Dbase) ->
- "sqlite_port " ++ Dbase.
+ filename:join([code:priv_dir(?MODULE), "sqlite_port "]) ++ Dbase.
exec(Port, Cmd) ->
port_command(Port, term_to_binary(Cmd)),
diff --git a/Makefile b/Makefile
index 887c835..fb42265 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
ERL=erl
OTP_TOP=/opt/local/lib/erlang/lib
-PLT_SRC=$(OTP_TOP)/kernel-2.12.4/ebin $(OTP_TOP)/stdlib-1.15.4/ebin/ $(OTP_TOP)/crypto-1.5.2.1/ebin $(OTP_TOP)/compiler-4.5.4/ebin $(OTP_TOP)/hipe-3.6.8/ebin/ $(OTP_TOP)/syntax_tools-1.5.5/ebin $(OTP_TOP)/hipe-3.6.8/ebin ebin
+PLT_SRC=$(OTP_TOP)/kernel-2.12.4/ebin $(OTP_TOP)/stdlib-1.15.4/ebin/ $(OTP_TOP)/crypto-1.5.2.1/ebin $(OTP_TOP)/compiler-4.5.4/ebin $(OTP_TOP)/hipe-3.6.8/ebin/ $(OTP_TOP)/syntax_tools-1.5.5/ebin ebin
all: compile docs
README file should warn about adapting to one's needs the priv/Makefile as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.