Skip to content

Commit

Permalink
Adds simplistic Select record
Browse files Browse the repository at this point in the history
  • Loading branch information
yrashk committed Jul 7, 2012
1 parent 90dba10 commit beccc5f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/exql.ex
Original file line number Original file line Diff line number Diff line change
@@ -1,2 +1,9 @@
defmodule ExQL do defmodule ExQL do

def select(options // []) when is_list(options) do
ExQL.Select.new(options)
end
def select(fields, options // []) do
ExQL.Select.new(Keyword.put options, :fields, fields)
end
end end
10 changes: 10 additions & 0 deletions lib/queries/select.ex
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,10 @@
defrecord ExQL.Select, [fields: "*",
from: [],
modifiers: [],
joins: [],
where: [],
order: [],
aliases: [],
group: []
] do
end

0 comments on commit beccc5f

Please sign in to comment.