Merged from rflynn/write_many_nestable

This commit is contained in:
Alexey Romanov
2013-01-03 09:33:11 +04:00

View File

@@ -832,9 +832,9 @@ handle_call({write, Tbl, Data}, _From, State) ->
{reply, {error, Exception}, State}
end;
handle_call({write_many, Tbl, DataList}, _From, State) ->
SQLScript = ["BEGIN;",
[sqlite3_lib:write_sql(Tbl, Data) || Data <- DataList],
"COMMIT;"],
SQLScript = ["SAVEPOINT 'erlang-sqlite3-write_many';",
[sqlite3_lib:write_sql(Tbl, Data) || Data <- DataList],
"RELEASE SAVEPOINT 'erlang-sqlite3-write_many';"],
Reply = do_sql_exec_script(SQLScript, State),
{reply, Reply, State};
handle_call({read, Tbl}, _From, State) ->