aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* 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+
* | Merge pull request #137 from dimko/visit_setRafael Mendonça França2014-09-172-0/+13
|\ \ | |/ |/| Added a visitor for Set objects
| * added a visitor for Set objectsDimko2012-09-182-0/+13
| |
* | Wrap group_by sql with a subquery for limiting rows in Oracle.Chris Dinger2014-09-161-0/+10
| | | | | | | | Fixes #128
* | `Extract#as` should not mutate the receiverTamir Duberstein2014-09-131-0/+8
| | | | | | | | Fixes https://github.com/rails/rails/issues/16913
* | Merge pull request #306 from mxhold/masterRafael Mendonça França2014-09-121-0/+21
|\ \ | | | | | | Add SelectManager#distinct_on to set/unset Arel::Nodes::DistinctOn quantifier
| * | Add SelectManager#distinct_on to set/unset Arel::Nodes::DistinctOn quantifierMax Holder2014-08-301-0/+21
| | |
* | | Merge pull request #304 from bigxiang/fix_lt_and_lteq_errorRafael Mendonça França2014-09-121-0/+44
|\ \ \ | | | | | | | | Fix lt & lteq don't accept most of values.
| * | | Change specs to cover lt, lteq, gt and gteq.bigxiang2014-08-311-4/+42
| | | |
| * | | Fix lt & lteq don't accept most of values.bigxiang2014-08-231-0/+6
| | | |
* | | | Merge pull request #277 from sergey-alekseev/wrap-nested-gropings-only-onceRafael Mendonça França2014-09-121-0/+7
|\ \ \ \ | |_|/ / |/| | | Wrap nested Nodes::Grouping in brackets only once
| * | | Wrap nested Nodes::Grouping in brackets only onceSergey Alekseev2014-05-261-0/+7
| | | |
* | | | Merge pull request #300 from jpcody/masterMatthew Draper2014-08-261-10/+7
|\ \ \ \ | |_|/ / |/| | | Allow for alias omission in aggregate expressions
| * | | Remove default aliases from aggregate functionsJoshua Cody2014-07-312-39/+7
| | | |
| * | | Allow for alias omission in aggregate expressionsJoshua Cody2014-07-261-0/+29
| | | |
* | | | Fix typo `gt` means `>`ksss2014-08-211-1/+1
|/ / /
* | | Merge pull request #291 from vipulnsward/rename-testRafael Mendonça França2014-06-301-52/+53
|\ \ \ | | | | | | | | Cleanup SelectManager Test
| * | | - Stop passing redundant `:engine => Table.engine` to `Table#new`Vipul A M2014-06-151-51/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove redundant `ast` variable creation - Rename similar join tests name to what they actually test - Move "joins itself" test to "joins" describe instead of defining describe block twice - Move update manager statement tests in logical order - Move `project` tests in logical order
| * | | Rename ambiguous test name to what it actually testsVipul A M2014-06-151-1/+1
| | | |
* | | | Add test for window + partition + order.Alexander Staubo2014-06-221-0/+11
| | | |
* | | | Windowing support for PARTITION BY clause.Alexander Staubo2014-06-202-3/+39
| | | |
* | | | Merge pull request #292 from mekishizufu/dot_visitor_apiRafael Mendonça França2014-06-151-4/+4
|\ \ \ \ | | | | | | | | | | Modify Visitors::Dot's API to use collectors
| * | | | Modify Visitors::Dot's API to use collectorsJiri Pospisil2014-06-141-4/+4
| |/ / /
* / / / - Test noop when passing empty list to `insert`Vipul A M2014-06-151-3/+8
|/ / / | | | | | | | | | | | | - Rename into test to indicate it accepts table and chains on it - Rename "combo" test to what it actually tests
* | | Merge pull request #290 from mekishizufu/fix_select_manager_as_subqueryRafael Mendonça França2014-06-131-0/+11
|\ \ \ | | | | | | | | Support passing of SelectManager to attribute methods
| * | | Make sure Arel::SelectManager is not mistaken for an attributeJiri Pospisil2014-06-121-0/+11
| | | |
* | | | Add test for non-recursive WITH statementJiri Pospisil2014-06-121-0/+14
|/ / /
* | | rm empty spec which is covered by other specsVipul A M2014-06-071-2/+0
| | |
* | | - Fix ambiguous argument warningVipul A M2014-05-312-2/+2
| | | | | | | | | | | | - Fix typo: `test_opertaion_ordering` => `test_operation_ordering`
* | | Merge pull request #276 from brocktimus/masterRafael Mendonça França2014-05-281-0/+5
|\ \ \ | | | | | | | | Fixing method signature for unsupported visits in the ToSQL Visitor