Merge pull request #26 from maxlapshin/patch-1

Handle adding of columns in database process
This commit is contained in:
Alexey Romanov
2013-08-15 06:14:03 -07:00

View File

@@ -838,6 +838,13 @@ handle_call({sql_bind_and_exec, SQL, Params}, _From, State) ->
handle_call({sql_exec_script, SQL}, _From, State) ->
Reply = do_sql_exec_script(SQL, State),
{reply, Reply, State};
handle_call({add_columns, Tbl, Columns}, _From, State) ->
try sqlite3_lib:add_columns_sql(Tbl, Columns) of
SQL -> do_handle_call_sql_exec(SQL, State)
catch
_:Exception ->
{reply, {error, Exception}, State}
end;
handle_call({create_table, Tbl, Columns}, _From, State) ->
try sqlite3_lib:create_table_sql(Tbl, Columns) of
SQL -> do_handle_call_sql_exec(SQL, State)