aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors
Commit message (Collapse)AuthorAgeFilesLines
* remove union mapping as :binary node when performing DepthFirst enumerationMichael Batchelor2016-08-191-1/+0
|
* Merge pull request #417 from tlkahn/masterRafael França2016-07-191-0/+9
|\ | | | | Fix issue #415 - Should Arel::Nodes::True.new() be 1 in sqlite3?
| * Fix issue #415 - Should Arel::Nodes::True.new() be 1 in sqlite3?Yong Guo2016-03-011-0/+9
| |
* | 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-303-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #422 from yahonda/oracle12_support_bind_valueSean Griffin2016-05-061-0/+4
|\ \ \ | | | | | | | | Support Oracle bind parameter value for Oracle12 visitor
| * | | Support Oracle bind parameter value for Oracle12 visitorYasuo Honda2016-04-111-0/+4
| |/ /
* | | Merge pull request #432 from tradegecko/pg-grouping-elements-supportRafael França2016-05-053-0/+44
|\ \ \ | | | | | | | | PG: Add Support for GroupBy's Cube, Rollup and Grouping Set
| * | | Add Support for GroupBy Cube, Rollup and Grouping Set Syntax for PostgreSQL ↵Mohammad Habbab2016-05-043-0/+44
| | | | | | | | | | | | | | | | Visitor
* | | | Raise ArgumentError if limit and lock are used for Oracle12 visitorYasuo Honda2016-05-021-3/+5
|/ / / | | | | | | | | | | | | | | | | | | it would generates `SELECT ... FETCH FIRST n ROWS ONLY FOR UPDATE` which causes Oracle 12c database returns this error : ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.
* / / 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`
* Add database specific string concatenationKeenan Brock2016-01-053-0/+10
|
* Implement CASE Conditional ExpressionFelix Bünemann2016-01-052-1/+38
|
* Inject the visitor rather than relying on other objects internalsSean Griffin2015-12-171-1/+6
| | | | | | This is ultimately messy no matter what, and increases the coupling to the database backend, but we can at least contain it somewhat into an object that's already coupled.
* Delegate to Connection Visitor in WhereSQL VisitorEdward Paget2015-12-171-1/+5
| | | | | | | | | | | | The WhereSQL visitor always uses the generic ToSQL visitor to create the where clause sql statement. This means that it'll miss database specific statements, such as 'ILIKE' in PostgreSQL. Since the `#where_sql` method is mainly used for ActiveRecord error reporting, this discrepancy could be confusing to users. This patch changes the WhereSQL visitor to use the its connection visitor to generate SQL for each statement in the SelectManager's wheres array. Then lets them be joined together with ' AND '.
* Merge pull request #369 from codeodor/patch-1Rafael França2015-12-171-1/+7
|\ | | | | Improve error message when passed unsupported type
| * Use a specific exception for unsupported visitsSammy Larbi2015-07-141-1/+7
| |
| * Improve error message when passed unsupported typeSammy Larbi2015-07-141-1/+1
| |
* | Add case sensitive regexpKeenan Brock2015-12-051-2/+4
| | | | | | | | | | | | | | Explicitly declare if this is case sensitive or not currently postgres assumes case insensitive regexp no other databases support regexps
* | Add case sensitive matchKeenan Brock2015-12-051-2/+4
|/ | | | | | | Explicitly declare if this is case sensitive or not most implementation assume case sensitive postgres assumes case insensitive
* Merge pull request #337 from yahonda/support_oracle12_top_n_2Aaron Patterson2015-07-142-2/+59
|\ | | | | Support Oracle 12c top-N query
| * Create Arel::Visitors::Oracle12 to provide better top-N queryYasuo Honda2015-06-191-0/+53
| | | | | | | | to support `FETCH FIRST n ROWS` and `OFFSET` for Oracle 12c database
| * Extract visit_Arel_Nodes_SelectOptionsYasuo Honda2015-06-191-2/+6
| |
* | Merge pull request #361 from evgenim/masterAaron Patterson2015-07-141-4/+10
|\ \ | | | | | | Fix visit_Arel_Nodes_FullOuterJoin/RightOuterJoin
| * | Fix visit_Arel_Nodes_FullOuterJoin and visit_Arel_Nodes_RightOuterJoin to ↵evgenim2015-03-161-4/+10
| |/ | | | | | | make them work with collectors.
* | Follow up #370 for Oracle, to fix undefined method `expr' for 10:Fixnum bug.Eric Guo2015-07-141-1/+1
| |
* | No need to quote MySQL LIMITJean Boussier2015-07-101-1/+1
|/
* Special limited delete handling in MSSQLTamir Duberstein2015-02-232-2/+19
| | | | | 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-273-8/+11
| | | | | | 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.
* {Matches,DoesNotMatch} support the ESCAPE clause with PostgreSQLKazuya NUMATA2014-12-251-2/+14
| | | | | to_SQL already has supported the ESCAPE clause in #318. PostgreSQL can use the ESCAPE clause too.
* Remove deprecated method "Table#primary_key"Sean Griffin2014-11-261-3/+18
| | | | | | | The only place this method was still used is on the MSSQL visitor. The visitor has all of the objects required to inline this lookup there. Since the `primary_key` method on the connection adapter will perform a query when called, we can cache the result on the visitor.
* remove extra space before 'ORDER BY'Nihad Abbasov2014-11-261-1/+0
|
* Support Oracle bind parameter valueYasuo Honda2014-11-201-0/+4
|
* Use class objects rather than strings for the dispatch cacheSean Griffin2014-11-182-18/+10
| | | | | | | | The only reason we're using strings is to pre-populate the cache, but `Class#name` returns a new string instance on every call. This is a pretty major source of memory usage. We don't technically need to pre-populate the cache, and not doing so allows us to go back to using cache objects
* Add order to BindParams in the ToSql collectorSean Griffin2014-11-172-2/+7
| | | | | | | | | | | | 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.
* cache the dispatch table on the depth first visitorAaron Patterson2014-11-102-6/+21
| | | | | We know the API for the depth first visitor in advance, so it's OK to calcuate this cache in advance
* oops! that should not have been checked inAaron Patterson2014-11-041-2/+1
|
* 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-232-18/+4
| | | | | 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-226-19/+37
| | | | | | | 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 #167 from pparidans/informix-v9-supportRafael Mendonça França2014-09-171-1/+1
|\ | | | | Informix versions < 10 use 'FIRST' keyword instead of 'LIMIT'
| * Informix versions < 10 use 'FIRST' keyword instead of 'LIMIT'Pierre Paridans2014-09-161-1/+1
| | | | | | | | Still supported in versions 10+
* | Merge pull request #137 from dimko/visit_setRafael Mendonça França2014-09-173-0/+3
|\ \ | |/ |/| Added a visitor for Set objects