Skip to content

Commit

Permalink
Adds edb_model:to_dict/1 utility function
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurii Rashkovskii committed May 5, 2012
1 parent 1f6f0c4 commit 5230cba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/edb_model.erl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
delete/1]).
-export([record_mapping/2, table_name/1,
attribute/2, attributes/1, with/2]).
-export([record_info/1,table/1, to_proplist/1]).
-export([record_info/1,table/1, to_proplist/1, to_dict/1]).
-compile({parse_transform, lager_transform}).
-compile({parse_transform, seqbind}).

Expand Down Expand Up @@ -59,6 +59,9 @@ record_info(Tuple) ->
to_proplist(Tuple) ->
lists:zip(Tuple:record_info(), tl(tuple_to_list(Tuple))).

to_dict(Tuple) ->
dict:from_list(Tuple:to_proplist()).

%% QLC

table(Tuple) ->
Expand Down

0 comments on commit 5230cba

Please sign in to comment.