Skip to content

Commit

Permalink
Added column_names/2 to fetch a normalized list of column names of a …
Browse files Browse the repository at this point in the history
…table.
  • Loading branch information
mworrell committed Jan 18, 2010
1 parent 75187af commit ae7d9a4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dbdrivers/postgresql/z_db.erl
Expand Up @@ -48,6 +48,7 @@
delete/3,
select/3,
columns/2,
column_names/2,
update_sequence/3,
table_exists/2,

Expand Down Expand Up @@ -383,6 +384,11 @@ columns(Table, Context) ->
Cols
end.

%% @doc Return a list with the column names of a table. The names are sorted.
%% @spec column_names(Table, Context) -> [ atom, ... ]
column_names(Table, Context) ->
lists:sort(proplists:get_keys(columns(Table, Context))).


%% @doc Update the sequence of the ids in the table. They will be renumbered according to their position in the id list.
%% @spec update_sequence(Table, IdList, Context) -> void()
Expand Down

0 comments on commit ae7d9a4

Please sign in to comment.