aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Implement CASE Conditional ExpressionFelix Bünemann2016-01-053-0/+154
|
* Delegate to Connection Visitor in WhereSQL VisitorEdward Paget2015-12-171-0/+21
| | | | | | | | | | | | 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 #329 from vipulnsward/add-attribute-aggregate-testsRafael França2015-12-171-1/+10
|\ | | | | Added test for verifying proper sql generated by minimum aggregate method
| * - Added test for verifying proper sql generated by minimum aggregate method.Vipul A M2014-10-241-1/+10
| |
* | Merge pull request #369 from codeodor/patch-1Rafael França2015-12-171-3/+3
|\ \ | | | | | | Improve error message when passed unsupported type
| * | Use a specific exception for unsupported visitsSammy Larbi2015-07-141-3/+3
| | |
* | | Merge pull request #381 from carsonreinke/function_orderRafael França2015-12-171-0/+9
|\ \ \ | | | | | | | | Add OrderPredications back into Nodes::Function
| * | | Add OrderPredications back into Nodes::Function (removed with deprecation of ↵Carson Reinke2015-07-231-0/+9
| |/ / | | | | | | | | | Expression)
* | | Merge pull request #390 from yahonda/expr_oracle12Rafael França2015-12-171-2/+2
|\ \ \ | | | | | | | | No need to quote limit for Oracle12 visitor
| * | | No need to quote limit for Oracle12 visitorYasuo Honda2015-09-011-2/+2
| |/ /
* | | test match predicate case sensitivity attributeKeenan Brock2015-12-051-0/+6
| | |
* | | introduce predicate {does_not_}matches_regexp Keenan Brock2015-12-051-6/+13
| | |
* | | use valid regular expression in regexp testKeenan Brock2015-12-051-12/+12
| | |
* | | Add case sensitive regexpKeenan Brock2015-12-051-0/+14
| | | | | | | | | | | | | | | | | | | | | 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-0/+14
|/ / | | | | | | | | | | | | 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-141-0/+47
|\ \ | | | | | | Support Oracle 12c top-N query
| * | Create Arel::Visitors::Oracle12 to provide better top-N queryYasuo Honda2015-06-191-0/+47
| | | | | | | | | | | | to support `FETCH FIRST n ROWS` and `OFFSET` for Oracle 12c database
* | | Merge pull request #361 from evgenim/masterAaron Patterson2015-07-141-0/+30
|\ \ \ | | | | | | | | Fix visit_Arel_Nodes_FullOuterJoin/RightOuterJoin
| * | | Fix visit_Arel_Nodes_FullOuterJoin and visit_Arel_Nodes_RightOuterJoin to ↵evgenim2015-03-161-0/+30
| | | | | | | | | | | | | | | | make them work with collectors.
* | | | Follow up #370 for Oracle, to fix undefined method `expr' for 10:Fixnum bug.Eric Guo2015-07-141-2/+2
| |/ / |/| |
* | | Fix a typo in the sql literal spec for grouped "and" equalityCourtland Caldwell2015-03-231-1/+1
|/ /
* | Special limited delete handling in MSSQLTamir Duberstein2015-02-231-0/+9
| | | | | | | | | | Refernce: https://technet.microsoft.com/en-us/library/ms175486%28v=sql.105%29.aspx
* | Delete should respect 'limit'Bradford Folkens2015-02-231-0/+8
| | | | | | | | | | Conflicts: lib/arel/visitors/to_sql.rb
* | Change the interface of `having` to match that of `where`Sean Griffin2015-01-274-13/+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.
* | Implement equality for `BindParam`Sean Griffin2015-01-251-0/+15
| | | | | | | | | | It is impossible to test equality of things constructing trees with bind params otherwise.
* | Allow a type caster to be given to the `Arel::Table` objectSean Griffin2014-12-291-0/+34
| | | | | | | | | | | | | | | | | | 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.
* | Deprecate automatic type casting within ArelSean Griffin2014-12-261-0/+2
| | | | | | | | | | | | | | | | Rails now performs all casting eagerly, before passing the value into Arel. Once we remove this, the code on both sides will be simplified greatly. Ideally, we can provide the appropriate public APIs on the Rails side to ease this transition for library authors who depend on this behavior.
* | Allow for handling quoted values in rangesSean Griffin2014-12-261-0/+47
| | | | | | | | | | Since Active Record needs to eagerly cast values, we need to check for quoted infinity in our range handling
* | {Matches,DoesNotMatch} support the ESCAPE clause with PostgreSQLKazuya NUMATA2014-12-251-0/+14
| | | | | | | | | | to_SQL already has supported the ESCAPE clause in #318. PostgreSQL can use the ESCAPE clause too.
* | Remove `engine` from `TreeManager` and subclassesSean Griffin2014-11-299-144/+133
| | | | | | | | | | | | This constructor parameter was unused for everything except the convenience methods `to_sql` and `where_sql`. We can pass the engine into those methods directly.
* | Remove engine from the constructor arguments `Arel::Table`Sean Griffin2014-11-293-63/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is never used outside of convenience methods which are only used in tests. In practice, it just made constructing tables more complicated on the rails side. This is the minimum possible change to remove the constructor argument, but continue to have the tests passing. I'm not sure if we have a reason to keep `project` and friends, and the solution might actually just be to remove the engine from `SelectManager` and friends. As such I've held off on deleting those methods. We need to figure out what to do with `Table#from`. It's old invocation, which read `table.from(table)` was certainly nonsensical.
* | Remove deprecated method "Table#primary_key"Sean Griffin2014-11-261-0/+19
| | | | | | | | | | | | | | 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/+8
| |
* | Support Oracle bind parameter valueYasuo Honda2014-11-201-1/+12
| |
* | Use class objects rather than strings for the dispatch cacheSean Griffin2014-11-181-1/+1
| | | | | | | | | | | | | | | | 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-176-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Revert "Revert "Merge pull request #300 from jpcody/master""Sean Griffin2014-10-311-10/+7
| | | | | | | | | | | | This reverts commit 9b92af7098b2728ced578ab9a7679176d20f120f. beta2 is out, and we've fixed the issue that this caused in Rails
* | Revert "Merge pull request #300 from jpcody/master"Sean Griffin2014-10-301-7/+10
| | | | | | | | | | This reverts commit 36836fa5e7c084c0dce2818577e6fd0cf815f786, reversing changes made to 53bc8426648cc93695525e8f12102cd416b2d772.
* | Deprecate passing ranges to `#in` and `#not_in`Sean Griffin2014-10-253-145/+143
| | | | | | | | | | | | | | The goal of these methods should be to generate in nodes, not handle every possible permutation of more than one value. The `#between` and `#not_between` methods have been extracted, which better represent the semantics of handling ranges in SQL.
* | 💣Sean Griffin2014-10-251-4/+4
| |
* | Merge pull request #331 from sgrif/sg-in-should-not-break-queriesSean Griffin2014-10-241-6/+6
|\ \ | | | | | | `#not_in` with a range should respect proper precedence
| * | `#not_in` with a range should respect proper precedenceSean Griffin2014-10-241-6/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, doing ```ruby relation[:id].not_eq(4).and(relation[:id].not_in(1..3)) ``` will generate ```sql "id" != 4 AND "id" < 1 OR "id" > 3 ``` Which would incorrectly include records with an id of 4, as the OR statement has higher precidence than the AND statement. The `or` method on `Node` properly groups the statement in parenthesis.
* | Merge pull request #332 from sgrif/sg-include-in-test-coverageSean Griffin2014-10-241-8/+201
|\ \ | | | | | | Improve test coverage for `#in` and `#not_in`
| * | Improve test coverage for `#in` and `#not_in`Sean Griffin2014-10-241-8/+201
| |/ | | | | | | | | | | These methods are going to go through some heavy refactoring, and moving logic around. This adds missing tests for each of the branches on the predicate.
* / Binary nodes should not generate the same hash as nodes of other classesSean Griffin2014-10-241-0/+26
|/
* {Matches,DoesNotMatch} support the ESCAPE clauseTamir Duberstein2014-09-251-0/+14
|
* move the dispatch table to be per-instanceAaron Patterson2014-09-222-7/+1
| | | | | | | 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.
* Fix set visiting specDimko2014-09-171-1/+1
|
* Merge pull request #167 from pparidans/informix-v9-supportRafael Mendonça França2014-09-171-6/+6
|\ | | | | Informix versions < 10 use 'FIRST' keyword instead of 'LIMIT'
| * Informix versions < 10 use 'FIRST' keyword instead of 'LIMIT'Pierre Paridans2014-09-161-6/+6
| | | | | | | | Still supported in versions 10+