diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-29 08:19:41 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-29 08:19:41 -0700 |
commit | dd07005dceb6641214f7d1166f75acbd379fb570 (patch) | |
tree | fe0cd4b5f8e8acacf2a830a0032467c4878852d8 /lib/arel | |
parent | 909538048e17cea47f5c57f36ca103865ea17353 (diff) | |
parent | c2e7f36f87184f23e9d83269ff20f99a29ec75ad (diff) | |
download | rails-dd07005dceb6641214f7d1166f75acbd379fb570.tar.gz rails-dd07005dceb6641214f7d1166f75acbd379fb570.tar.bz2 rails-dd07005dceb6641214f7d1166f75acbd379fb570.zip |
Merged pull request #46 from semmons99/master.
replace 'LIMIT n' with 'FETCH FIRST n ROWS ONLY' when using ibm_db
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/visitors.rb | 2 | ||||
-rw-r--r-- | lib/arel/visitors/ibm_db.rb | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/arel/visitors.rb b/lib/arel/visitors.rb index 8410b2b912..f2644d7205 100644 --- a/lib/arel/visitors.rb +++ b/lib/arel/visitors.rb @@ -10,6 +10,7 @@ require 'arel/visitors/join_sql' require 'arel/visitors/where_sql' require 'arel/visitors/order_clauses' require 'arel/visitors/dot' +require 'arel/visitors/ibm_db' module Arel module Visitors @@ -22,6 +23,7 @@ module Arel 'oracle_enhanced' => Arel::Visitors::Oracle, 'sqlite' => Arel::Visitors::SQLite, 'sqlite3' => Arel::Visitors::SQLite, + 'ibm_db' => Arel::Visitors::IBM_DB, } ENGINE_VISITORS = Hash.new do |hash, engine| diff --git a/lib/arel/visitors/ibm_db.rb b/lib/arel/visitors/ibm_db.rb new file mode 100644 index 0000000000..0c26a3ae9e --- /dev/null +++ b/lib/arel/visitors/ibm_db.rb @@ -0,0 +1,12 @@ +module Arel + module Visitors + class IBM_DB < Arel::Visitors::ToSql + private + + def visit_Arel_Nodes_Limit o + "FETCH FIRST #{visit o.expr} ROWS ONLY" + end + + end + end +end |