aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #417 from tlkahn/masterRafael França2016-07-191-0/+7
|\ | | | | 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/+7
| |
* | Merge pull request #422 from yahonda/oracle12_support_bind_valueSean Griffin2016-05-061-2/+13
|\ \ | | | | | | Support Oracle bind parameter value for Oracle12 visitor
| * | Support Oracle bind parameter value for Oracle12 visitorYasuo Honda2016-04-111-2/+13
| |/
* | Merge pull request #432 from tradegecko/pg-grouping-elements-supportRafael França2016-05-051-0/+78
|\ \ | | | | | | 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-041-0/+78
| | | | | | | | | | | | Visitor
* | | Raise ArgumentError if limit and lock are used for Oracle12 visitorYasuo Honda2016-05-021-3/+4
|/ / | | | | | | | | | | | | 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.
* / Fix warnings from test_to_sql testVipul A M2016-04-111-1/+1
|/
* * Support for bitwise operations as infix operators. Tests included.Shahbaz Javeed2016-01-061-0/+37
| | | | | | | | | | | | | | | | | | | | | | *** 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-2/+27
|
* Implement CASE Conditional ExpressionFelix Bünemann2016-01-052-0/+72
|
* 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 #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
* | Follow up #370 for Oracle, to fix undefined method `expr' for 10:Fixnum bug.Eric Guo2015-07-141-2/+2
|/
* 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
* Change the interface of `having` to match that of `where`Sean Griffin2015-01-272-4/+2
| | | | | | 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.
* {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-291-1/+1
| | | | | | 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 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-173-4/+21
| | | | | | | | | | | | 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.
* Deprecate passing ranges to `#in` and `#not_in`Sean Griffin2014-10-251-12/+12
| | | | | | | 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.
* `#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.
* {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
* | 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
| | |
* | | Modify Visitors::Dot's API to use collectorsJiri Pospisil2014-06-141-4/+4
| | |
* | | - Fix ambiguous argument warningVipul A M2014-05-311-1/+1
| | | | | | | | | | | | - Fix typo: `test_opertaion_ordering` => `test_operation_ordering`
* | | Asserting on error messageBrock Trappitt2014-05-281-3/+2
| | |
* | | Test which checks the error being raised by #unsupported in ToSql VisitorBrock Trappitt2014-05-271-0/+6
|/ /
* | Support to add the casting node to the AST at build timeYasuo Honda2014-05-051-2/+2
| | | | | | | | Ref https://github.com/rails/arel/commit/93d72131bcc24ccb5536bec672d2dac94f8de651
* | Test quoting integers when comparing a string column with integers.Dylan Smith2014-04-281-2/+14
| | | | | | | | | | | | | | | | | | | | An equality with a string column and integer like SELECT * FROM `users` WHERE `login_token` = 0 LIMIT 1; will match match any string that doesn't start with a digit in certain databases, like mysql. Make sure we quote the integer to avoid this problem in a database independant way.