diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2007-12-30 11:35:44 -0800 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2007-12-30 11:35:44 -0800 |
commit | 960bbcb3ce4a82cf4f031d1c6682ce4c1a04474d (patch) | |
tree | 24e8e29629450700940d3bdc233265648b5f73f2 /lib/sql_algebra/sql | |
download | rails-960bbcb3ce4a82cf4f031d1c6682ce4c1a04474d.tar.gz rails-960bbcb3ce4a82cf4f031d1c6682ce4c1a04474d.tar.bz2 rails-960bbcb3ce4a82cf4f031d1c6682ce4c1a04474d.zip |
initial import
Diffstat (limited to 'lib/sql_algebra/sql')
-rw-r--r-- | lib/sql_algebra/sql/select.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/sql_algebra/sql/select.rb b/lib/sql_algebra/sql/select.rb new file mode 100644 index 0000000000..da92ad3a52 --- /dev/null +++ b/lib/sql_algebra/sql/select.rb @@ -0,0 +1,23 @@ +class Select + attr_reader :attributes, :tables, :predicates + + def initialize(*attributes) + @attributes = attributes + end + + def from(*tables) + returning self do |select| + @tables = tables + end + end + + def where(*predicates) + returning self do |select| + @predicates = predicates + end + end + + def ==(other) + attributes == other.attributes and tables == other.tables and predicates == other.predicates + end +end
\ No newline at end of file |