aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Implement equality for `BindParam`Sean Griffin2015-01-252-0/+18
| | | | | It is impossible to test equality of things constructing trees with bind params otherwise.
* Merge pull request #352 from splattael/jruby-headSean Griffin2015-01-231-1/+4
|\ | | | | Remove jruby and add jruby-head on Travis
| * Speed up jruby testsPeter Suschlik2015-01-211-0/+3
| | | | | | | | Improve startup time and give Java more memory.
| * Remove jruby and add jruby-head on TravisPeter Suschlik2015-01-211-1/+1
|/ | | | | | | | | Arel 7.0 dropped support for 1.9 (see f1a3421ce7083181ebd463c8147c2d4b95539ca8). We should remove jruby (1.7.18) which only supports 1.9 and test the latest jruby head (9.0.0.0.pre1). After jruby 9k has been released (and Travis has updated) we can safely switch back to jruby.
* Merge pull request #346 from vipulnsward/add-default-taskRafael Mendonça França2015-01-011-0/+3
|\ | | | | Add default rake task as test.
| * Add default rake task as test.Vipul A M2015-01-011-0/+3
|/
* Change the version to 7.0.0.alphaSean Griffin2014-12-291-1/+1
|
* Remove 1.9 from the Travis buildsSean Griffin2014-12-291-1/+0
| | | | Arel 7.0 will not support Ruby 1.9
* Allow a type caster to be given to the `Arel::Table` objectSean Griffin2014-12-296-16/+89
| | | | | | | | | 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-262-0/+13
| | | | | | | | 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-262-6/+61
| | | | | Since Active Record needs to eagerly cast values, we need to check for quoted infinity in our range handling
* Merge pull request #344 from kaznum/support_the_escape_clause_of_postgresqlMatthew Draper2014-12-252-2/+28
|\ | | | | {Matches,DoesNotMatch} support the ESCAPE clause with PostgreSQL
| * {Matches,DoesNotMatch} support the ESCAPE clause with PostgreSQLKazuya NUMATA2014-12-252-2/+28
|/ | | | | to_SQL already has supported the ESCAPE clause in #318. PostgreSQL can use the ESCAPE clause too.
* 💣Sean Griffin2014-12-041-1/+1
| | | | `nil?` not `nil`
* Quoted nodes respond to `nil?` in the same way as `Casted` nodesSean Griffin2014-12-041-0/+1
|
* Quoted nodes respond to the same method as Casted nodesSean Griffin2014-12-041-0/+1
| | | | We need to be able to not care which we've gotten in ActiveRecord
* Don't re-quote nodes which are already quotedSean Griffin2014-12-021-1/+1
| | | | | | | | We're going to start working on removing type casting from arel. To avoid doing one gigantic commit which moves everything over to eager casting, we need a way to tell Arel that we've already cast it. The easiest path to that is to give it a quoted node, and then we remove this case once we're never returning a Casted node
* Remove `engine` from `TreeManager` and subclassesSean Griffin2014-11-2917-170/+149
| | | | | | 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-294-103/+49
| | | | | | | | | | | | | | | 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-263-17/+37
| | | | | | | 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.
* Merge pull request #177 from NARKOZ/patch-0Sean Griffin2014-11-262-2/+8
|\ | | | | remove extra space from select statement
| * remove extra space before 'ORDER BY'Nihad Abbasov2014-11-262-2/+8
|/
* Rake is a development dependecyRafael Mendonça França2014-11-252-0/+2
|
* Prepare for 6.0.0Rafael Mendonça França2014-11-252-2/+2
|
* Only include the lib folder in the gemRafael Mendonça França2014-11-252-2/+2
|
* Merge pull request #338 from yahonda/add_order_to_bindparams_oracleSean Griffin2014-11-242-1/+16
|\ | | | | Support Oracle bind parameter value
| * Support Oracle bind parameter valueYasuo Honda2014-11-202-1/+16
|/
* Use class objects rather than strings for the dispatch cacheSean Griffin2014-11-183-19/+11
| | | | | | | | 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-1712-16/+48
| | | | | | | | | | | | 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
|
* Look for `Enumerable` rather than `Array` in predicatesSean Griffin2014-11-021-2/+2
| | | | | It's not quite duck typed, but it will allow us to pass in our own objects with additional logic (like type casting).
* Fix rake test taskRafael Mendonça França2014-10-311-0/+9
|
* Revert "Revert "Merge pull request #300 from jpcody/master""Sean Griffin2014-10-313-19/+17
| | | | | | This reverts commit 9b92af7098b2728ced578ab9a7679176d20f120f. beta2 is out, and we've fixed the issue that this caused in Rails
* Bump to 6.0.0.beta2Godfrey Chan2014-10-301-1/+1
|
* Update the GemfileRafael Mendonça França2014-10-301-10/+1
|
* hoe is not the dependecy anymoreRafael Mendonça França2014-10-302-2/+2
|
* Stop using hoe to release the gemRafael Mendonça França2014-10-306-210/+52
|
* Revert "Merge pull request #300 from jpcody/master"Sean Griffin2014-10-303-17/+19
| | | | | This reverts commit 36836fa5e7c084c0dce2818577e6fd0cf815f786, reversing changes made to 53bc8426648cc93695525e8f12102cd416b2d772.
* Dry up building quoted nodes in predicationSean Griffin2014-10-271-15/+23
| | | | | Given that we are going to remove casting from Arel in the near future, having a single place nodes in predications will help.
* Merge pull request #333 from sgrif/sg-separate-range-methodSean Griffin2014-10-274-180/+192
|\ | | | | Deprecate passing ranges to `#in` and `#not_in`
| * Deprecate passing ranges to `#in` and `#not_in`Sean Griffin2014-10-254-180/+192
|/ | | | | | | 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.
* Refactor `#in` and `#not_in`Sean Griffin2014-10-251-16/+20
| | | | | | | These methods duplicate a lot of logic from the other predications. We can just use those methods directly, and only build nodes with the same name in our method directly. We've already had one bug that came from building nodes directly, rather than using the proper predicate.
* 💣Sean Griffin2014-10-251-4/+4
|
* Merge pull request #331 from sgrif/sg-in-should-not-break-queriesSean Griffin2014-10-242-7/+7
|\ | | | | `#not_in` with a range should respect proper precedence
| * `#not_in` with a range should respect proper precedenceSean Griffin2014-10-242-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #330 from sgrif/sg-binary-node-hash-equalitySean Griffin2014-10-242-1/+27
|\ \ | |/ |/| Binary nodes should not generate the same hash as nodes of other classes
| * Binary nodes should not generate the same hash as nodes of other classesSean Griffin2014-10-242-1/+27
|/