Skip to content

Instantly share code, notes, and snippets.

@johnbender
Created February 16, 2009 04:27
Show Gist options
  • Save johnbender/65000 to your computer and use it in GitHub Desktop.
Save johnbender/65000 to your computer and use it in GitHub Desktop.
%%---------------------------------------------------------------------------------------
%%Function: find/2
%%Description: finds the given object based on id
%%---------------------------------------------------------------------------------------
find(Object, [ID]) ->
Result = ?ADAPT:run_query({qry,
{table, Object},
{columns, all},
{operations, [?OPS:eq(?ADAPT:column(Object, item), ID)]},
{order, []}}),
?ADAPT:format_json(Result, Object, all).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment