aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/to_sql.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #328 from vipulnsward/dryup-collectorsRafael França2016-07-191-33/+13
|\ | | | | DRY up visit_Arel_Nodes_SelectCore
| * DRY up visit_Arel_Nodes_SelectCore and extract nodes collection to ↵Vipul A M2016-04-111-33/+13
| | | | | | | | collect_nodes_for, for collecting wheres, projections, groups, windows
* | Support for unified Integer class in Ruby 2.4+yui-knk2016-05-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | Ruby 2.4 unifies Fixnum and Bignum into Integer: https://bugs.ruby-lang.org/issues/12005 Ruby ~2.3 `1234.class` is `Fixnum` and `123456789012345678901234567890.class` is `Bignum`. Ruby 2.4+ `1234.class` is `Integer` and `123456789012345678901234567890.class` is `Integer`. So what we should do is defining `visit_Integer` method to visitors.
* | Update to_sql.rbzhufenggood2016-04-151-3/+3
|/ | | Update to_sql.rb. Slightly performance improvement.
* Update to_sql.rb. Slightly performance improment.zhufenggood2016-03-311-1/+1
| | | Update to_sql.rb. Slightly performance improment.
* * Support for bitwise operations as infix operators. Tests included.Shahbaz Javeed2016-01-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | *** Individual commit messages included below *** * Preliminary support for bitwise operations as infix operators. Tests to follow. * Added bitwise xor, shift left and shift right operators * Fixed the BitwiseOr class so it uses the :| operator instead of :& * All the methods for the bitwise operators in the Arel::Math module now wrap them up in Arel::Nodes::Grouping so the operation becomes isolated like addition and subtraction * Preliminary set of tests for the new operators * Updated README with examples of bitwise operations * Added a new UnaryOperation class which is a riff on the InfixOperation class * Added tests for UnaryOperation (inspired by InfixOperation tests) * Added the bitwise not (~) operator as a UnaryOperation * Added tests for the bitwise not operator * Added documentation for the bitwise not operator * Updated gemspec using `rake arel.gemspec`
* Implement CASE Conditional ExpressionFelix Bünemann2016-01-051-0/+29
|
* Use a specific exception for unsupported visitsSammy Larbi2015-07-141-1/+7
|
* Improve error message when passed unsupported typeSammy Larbi2015-07-141-1/+1
|
* Merge pull request #337 from yahonda/support_oracle12_top_n_2Aaron Patterson2015-07-141-2/+6
|\ | | | | Support Oracle 12c top-N query
| * Extract visit_Arel_Nodes_SelectOptionsYasuo Honda2015-06-191-2/+6
| |
* | Fix visit_Arel_Nodes_FullOuterJoin and visit_Arel_Nodes_RightOuterJoin to ↵evgenim2015-03-161-4/+10
|/ | | | make them work with collectors.
* Special limited delete handling in MSSQLTamir Duberstein2015-02-231-2/+2
| | | | | Refernce: https://technet.microsoft.com/en-us/library/ms175486%28v=sql.105%29.aspx
* Delete should respect 'limit'Bradford Folkens2015-02-231-3/+3
| | | | | Conflicts: lib/arel/visitors/to_sql.rb
* Change the interface of `having` to match that of `where`Sean Griffin2015-01-271-6/+4
| | | | | | These two clauses have nearly identical semantics with regards to how they would be constructed as an AST. It doesn't make sense for their interfaces to be separate.
* Allow a type caster to be given to the `Arel::Table` objectSean Griffin2014-12-291-1/+22
| | | | | | | | | This will allow most consuming code to avoid the deprecation introduced in 008445d6fd5f825d9b445ac75a7be67f0f7ab52c. The only code which will be affected is code that is building the `Arel::Table` object manually, rather than calling `arel_table` on an Active Record class. Hopefully this case will be rare enough that we don't need to introduce any additional APIs to work around it.
* remove extra space before 'ORDER BY'Nihad Abbasov2014-11-261-1/+0
|
* Add order to BindParams in the ToSql collectorSean Griffin2014-11-171-2/+3
| | | | | | | | | | | | This removes the need for us to do the re-ordering by walking the AST in ActiveRecord. We're using a block to communicate with the collector, since the collector needs to be the thing which knows about the index, while the visitor is the thing that needs to know the syntax. The BindParam needs to know about neither of these things, so it's been changed to stop being a subclass of SqlLiteral I could also see an alternative implementation using format strings if for some reason blocks cause a problem.
* Completes 08e6491 in reusing `maybe_visit`claudiob2014-10-231-3/+3
| | | | | | | | | :sweat: I don't know why the tests did not fail, but to keep the same syntax as before, `collector =` is required. Maybe `visit` changes `collector` in-place, so the result is the same, but since I'm not sure about the side effects, I think this PR is needed to. Sorry! :sweat:
* Reuse `maybe_visit` methodclaudiob2014-10-231-12/+3
| | | | | This commit simply removes duplicated code by reusing the existing `maybe_visit` method.
* {Matches,DoesNotMatch} support the ESCAPE clauseTamir Duberstein2014-09-251-2/+14
|
* move the dispatch table to be per-instanceAaron Patterson2014-09-221-3/+7
| | | | | | | visitors are not shared among threads, so any mutations to the cache should be OK. The cache is also pre-populated on construction, but we should pull that out so we can share the cache among visitors in the future.
* connections should cache these values, so remove the cache in arelAaron Patterson2014-09-221-4/+3
|
* Merge pull request #137 from dimko/visit_setRafael Mendonça França2014-09-171-0/+1
|\ | | | | Added a visitor for Set objects
| * added a visitor for Set objectsDimko2012-09-181-0/+1
| |
* | `Extract#as` should not mutate the receiverTamir Duberstein2014-09-131-8/+1
| | | | | | | | Fixes https://github.com/rails/rails/issues/16913
* | Merge pull request #277 from sergey-alekseev/wrap-nested-gropings-only-onceRafael Mendonça França2014-09-121-2/+6
|\ \ | | | | | | Wrap nested Nodes::Grouping in brackets only once
| * | Wrap nested Nodes::Grouping in brackets only onceSergey Alekseev2014-05-261-2/+6
| | |
* | | Windowing: Calling #rows or #range should assign framing only once.Alexander Staubo2014-06-221-0/+2
| | |
* | | Windowing support for PARTITION BY clause.Alexander Staubo2014-06-201-0/+6
| | |
* | | Make sure visit_Arel_Nodes_With works with collectorsJiri Pospisil2014-06-121-2/+3
| | |
* | | Remove unused values variableVipul A M2014-06-011-2/+0
| | |
* | | Fixing method signature for unsupported visits in the ToSQL VisitorBrock Trappitt2014-05-261-1/+1
|/ /
* | Allow INSERT INTO <table> SELECT queriesJean Boussier2014-04-101-1/+7
| |
* | rhs bind parameters should be visitedAaron Patterson2014-04-091-1/+1
| |
* | fix bind values in insert statementsAaron Patterson2014-04-091-4/+8
| |
* | adding a bind value collectorAaron Patterson2014-04-091-1/+4
| |
* | add a compile method for some backwards compatibilityAaron Patterson2014-04-091-0/+4
| |
* | fixing BINARY testsAaron Patterson2014-04-081-2/+2
| |
* | fixing EXTRACTAaron Patterson2014-04-081-2/+10
| |
* | fixing OVERAaron Patterson2014-04-081-9/+9
| |
* | fixing insert managerAaron Patterson2014-04-081-5/+9
| |
* | fixing test_table.rbAaron Patterson2014-04-081-9/+9
| |
* | informix is workingAaron Patterson2014-04-081-2/+1
| |
* | postgresql visitor is workingAaron Patterson2014-04-081-2/+2
| |
* | push reduction visitors to a reduction base classAaron Patterson2014-04-081-1/+2
| | | | | | | | this lets our old depth first and dot visitors to work normally
* | select manager tests are passingAaron Patterson2014-04-081-14/+25
| |
* | more select manager tests passingAaron Patterson2014-04-081-11/+22
| |
* | making some of the sql manager tests passAaron Patterson2014-04-081-46/+88
| |
* | Merge branch 'master' into collectorAaron Patterson2014-04-081-2/+18
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: remove order_clauses since we do not use it fix whitespace and unsupported method args Add Regexp and NotRegexp nodes for PostgreSQL Revert "Merge pull request #253 from corrupt952/master" flatten object.children in visit_Arel_Node_And Added right and full outer joins Conflicts: lib/arel/visitors/to_sql.rb lib/arel/visitors/visitor.rb