Pass DB name to sqlite3_drv

If DB name not passed 'store.db' will be opened.
This commit is contained in:
sergey-miryanov
2010-01-20 10:47:04 +05:00
parent 345746e9d7
commit 2dd29008ce
2 changed files with 15 additions and 6 deletions

View File

@@ -345,7 +345,7 @@ init(Options) ->
SearchDir = filename:join([filename:dirname(code:which(?MODULE)), "..", "ebin"]),
case erl_ddll:load(SearchDir, atom_to_list(?DRIVER_NAME)) of
ok ->
Port = open_port({spawn, ?DRIVER_NAME}, [binary]),
Port = open_port({spawn, string:join ([atom_to_list (?DRIVER_NAME), Dbase], " ")}, [binary]),
{ok, #state{port = Port, ops = Options}};
{error, Error} ->
io:format("Error loading ~p: ~p", [?DRIVER_NAME, erl_ddll:format_error(Error)]),