aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/nodes
Commit message (Collapse)AuthorAgeFilesLines
* Fix Casted#hashMatthew Draper2016-07-281-1/+1
| | | | There is no @class variable.
* Add Support for GroupBy Cube, Rollup and Grouping Set Syntax for PostgreSQL ↵Mohammad Habbab2016-05-041-2/+6
| | | | Visitor
* added Casted#hashBert Bruynooghe2016-02-171-0/+4
|
* * Support for bitwise operations as infix operators. Tests included.Shahbaz Javeed2016-01-062-0/+55
| | | | | | | | | | | | | | | | | | | | | | *** 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-051-1/+6
|
* Implement CASE Conditional ExpressionFelix Bünemann2016-01-051-0/+57
|
* Merge pull request #381 from carsonreinke/function_orderRafael França2015-12-171-0/+1
|\ | | | | Add OrderPredications back into Nodes::Function
| * Add OrderPredications back into Nodes::Function (removed with deprecation of ↵Carson Reinke2015-07-231-0/+1
| | | | | | | | Expression)
* | Add case sensitive regexpKeenan Brock2015-12-052-2/+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-1/+3
|/ | | | | | | Explicitly declare if this is case sensitive or not most implementation assume case sensitive postgres assumes case insensitive
* Move casted to its own fileVipul A M2015-05-311-0/+40
|
* Delete should respect 'limit'Bradford Folkens2015-02-231-0/+2
| | | | | Conflicts: lib/arel/visitors/to_sql.rb
* Change the interface of `having` to match that of `where`Sean Griffin2015-01-272-6/+5
| | | | | | 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/+3
| | | | | 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/+8
| | | | | | | | | 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 `engine` from `TreeManager` and subclassesSean Griffin2014-11-291-4/+0
| | | | | | 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.
* Add order to BindParams in the ToSql collectorSean Griffin2014-11-172-3/+6
| | | | | | | | | | | | 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.
* Binary nodes should not generate the same hash as nodes of other classesSean Griffin2014-10-241-1/+1
|
* {Matches,DoesNotMatch} support the ESCAPE clauseTamir Duberstein2014-09-252-2/+14
|
* Remove unused @alias, being referenced in hashing.Vipul A M2014-09-161-1/+1
|
* `Extract#as` should not mutate the receiverTamir Duberstein2014-09-131-10/+3
| | | | Fixes https://github.com/rails/rails/issues/16913
* Windowing: Calling #rows or #range should assign framing only once.Alexander Staubo2014-06-221-2/+10
|
* Windowing support for PARTITION BY clause.Alexander Staubo2014-06-201-2/+13
|
* - Remove four year old deprecationVipul A M2014-06-011-5/+1
|
* Allow INSERT INTO <table> SELECT queriesJean Boussier2014-04-101-2/+5
|
* Merge branch 'master' into collectorAaron Patterson2014-04-083-0/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * Add Regexp and NotRegexp nodes for PostgreSQLJames Le Cuirot2014-04-081-0/+2
| |
| * Added right and full outer joinsStephen Prater & Fire-Dragon-DoL2014-03-302-0/+12
| |
* | bind visitor working with collector objectAaron Patterson2014-04-081-1/+5
|/
* build quoted nodes in factory methodsAaron Patterson2014-03-241-2/+0
|
* add the casting node to the AST at build timeAaron Patterson2014-03-241-0/+2
| | | | | If we add the casting node to the ast at build time, then we can avoid doing the lookup at visit time.
* Remove deprecated Arel::ExpressionRafael Mendonça França2014-02-103-4/+0
|
* Add :encode_with for proper YAML serializationIvan Antropov2013-11-091-0/+4
|
* record who created the node when $DEBUG is trueAaron Patterson2013-05-201-1/+8
|
* call super from initializeAaron Patterson2013-05-178-0/+10
|
* Add equality to ALL THE THINGS (that matter)Ernie Miller2012-08-1814-2/+174
| | | | | | | | | | | | People are often trying to use ARel nodes inside ActiveRecord, and when they do so, lots of things can break, because ActiveRecord relies on Array#uniq and sometimes hash key equality to handle values that end up in wheres, havings, etc. By implementing equality for all the nodes, we should hopefully be able to prevent any nodes (even nodes containing other nodes) from failing an equality check they should otherwise pass, and alleviate many of these errors. Fixes #130
* Add Nodes::TableAlias#engineJon Leighton2012-07-131-0/+4
| | | | | Eventually #engine should go away, but until that time, this means that Table and Nodes::TableAlias can be used more interchangeably.
* Remove ArgumentError.Jon Leighton2012-07-131-2/+1
| | | | | | | | | | It is untested. There is no `@frame` variable. Presumably it is supposed to be `@framing`, but changing that shows that some of the tests *are* setting frame twice. I don't see why this level of strictness is necessary. If someone disagrees, they should add a test for this behaviour and make the other tests pass.
* Include Predications in GroupingErnie Miller2012-05-193-7/+7
| | | | | | Also, removed unused ordering.rb file, since it is identical to the one being created in unary.rb already, and isn't required anywhere.
* Must support aliases for OVER operator.Alexander Staubo2012-02-231-0/+2
|
* Add #extract, which produces ANSI SQL function EXTRACT(<field> from <expr>).Alexander Staubo2012-02-231-0/+23
|
* Support ANSI SQL2003 window functions.Alexander Staubo2012-02-224-1/+95
|
* bind parameters can be differentiated from sql literalsAaron Patterson2012-02-201-0/+3
|
* while using activerecord-sqlserver-adapter 3.1.5 with Rails 3.1 with Arel ↵Adam H2012-01-201-1/+1
| | | | | | | | | | 2.2.1 we encountered the error uninitialized constant Arel::Nodes::Visitors::DepthFirst apparently Arel was trying to call a relative namespace with Visitors::DepthFirst.new(block).accept self we fixed this by making it call an absolute namespace with ::Arel::Visitors::DepthFirst.new(block).accept self
* Allow using non-table alias as a rhs relation name, fix for #84 and #59JoelJuliano2011-10-301-1/+1
|
* Make it the responsibility of the connection to hold on to a visitor for ↵Jon Leighton2011-08-081-2/+1
| | | | generating SQL, rather than the TreeManager. (There is a related commit coming in Active Record.)
* Support update statements containing joinsJon Leighton2011-08-081-0/+4
|
* Remove short circuit evaluation and leave AST as it isDaniel Cadenas2011-08-032-22/+0
|
* Add nodes for boolean constantsDaniel Cadenas2011-08-032-0/+34
| | | | | | | | | | | | This is useful for dynamically created predicates e.g: expr1 = table.create_false expr2 = table.create_false expr1 = create_a_predicate() if some_condition expr2 = create_another_predicate() if some_other_condition table.where(expr1.and(expr2))
* Break Ordering into Ascending/Descending nodes, allow reversalErnie Miller2011-06-154-15/+48
|