Permalink
Browse files

Adds simplistic Select record

  • Loading branch information...
1 parent 90dba10 commit beccc5f7affc9a5d05eaf9cbad8fd07aaacdc769 @yrashk committed Jul 7, 2012
Showing with 17 additions and 0 deletions.
  1. +7 −0 lib/exql.ex
  2. +10 −0 lib/queries/select.ex
View
@@ -1,2 +1,9 @@
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
View
@@ -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.