Skip to content

Instantly share code, notes, and snippets.

@jschoch
Created July 29, 2013 22:21
Show Gist options
  • Save jschoch/6108430 to your computer and use it in GitHub Desktop.
Save jschoch/6108430 to your computer and use it in GitHub Desktop.
def do_select(s) do
Amnesia.transaction do
case __MODULE__.select(s) do
nil -> []
selector -> selector.values
end
end
end
def all(key,operator,value) do
case key do
:id -> all_by_id(operator,value)
:updated_at ->
end
end
def all_by_id(operator,value) do
case operator do
:gt ->
s = Exquisite.match Company,
where: id > value
doh -> "Ut oh! #{doh}"
end
Company.do_select(s)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment