Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Ensure `ToSql` collector returns a UTF-8 string | Sean Griffin | 2017-07-21 | 2 | -1/+9 |
| | | | | | | | | Switching from `''.dup` to `String.new` had the side effect of changing the encoding on Ruby 2.4 and later. Oddly, `String.new(encoding: Encoding::UTF_8)` is significantly slower than `''.dup`. This seems like a bug in Ruby, but not something we're going to address right now. A test has been added to ensure this regression doesn't occur again. | ||||
* | Refactor `substitute_binds` to perform substitution immediately | Sean Griffin | 2017-07-21 | 6 | -68/+35 |
| | | | | | | | | | | | | | | | | | | I'm honestly not sure if replacing bind params with their concrete values is something that belongs in Arel at all, as it's something that will need to be coupled to the quoting mechanism of the caller, and could just be accomplished by using `Quoted` instead. Still, with the new structure we can provide a much simpler API around substitution. The expectation of the quoter responding to `quote` is a reasonably minimal API. I originally used `DelegateClass` here, with the one line override of `add_bind`, but realized that we have some funky code going on where the collector returns the next collector to use (in practice `self` is always returned, and I don't see why we'd ever want to do this). Removing that would likely be worthwhile, but would be a larger refactoring | ||||
* | Add a value field `Nodes::BindParam` | Sean Griffin | 2017-07-21 | 14 | -125/+37 |
| | | | | | | | | | | | | | | | | | | | | This is part of a greater refactoring to have the `BindParam` nodes hold onto their values. We want to generally keep the AST decoupled from what you're actually doing with those values, but ultimately the usage of `BindParam` is almost identical to how you'd use `Casted` or `Quoted`. Forcing consumers of Arel's API to maintain the bind values separately from the AST makes manipulating the AST essentially impossible, as you would need to perform a full walk of the AST to determine whether a given node contains bind parameters, and which value it maps to. By storing the value on the bind parameter directly, we can collect them in another AST pass (realistically it'll be part of the same pass that performs SQL construction for performance reasons). This will dramatically simplify AST manipulation for Rails or any other consumers that work with bind params. As part of this change I've removed the `BindVisitor`, which appears to be dead code, and had tests break from this change. | ||||
* | Rename `Collectors::Bind` | Sean Griffin | 2017-07-21 | 5 | -15/+4 |
| | | | | | | The "bind collector" does not actually collect bind params at all, it substitutes them out of the final AST, replacing them with a quoted value. | ||||
* | Merge pull request #484 from kirs/multiple-insert-v2 | Rafael França | 2017-06-15 | 5 | -0/+94 |
|\ | | | | | Support INSERT with multiple values (v2) | ||||
| * | Support INSERT with multiple values | Kir Shatrov | 2017-05-22 | 5 | -0/+94 |
| | | |||||
* | | Merge pull request #472 from film42/master | Matthew Draper | 2017-06-05 | 5 | -4/+57 |
|\ \ | |/ |/| | Make Visitor visit thread safe by holding dispatch method reference | ||||
| * | Test concurrency of visitor superclass fallback | Matthew Draper | 2017-06-05 | 3 | -0/+51 |
| | | |||||
| * | Make Visitor visit thread safe by holding dispatch method reference | Garrett Thornburg | 2017-02-17 | 2 | -4/+6 |
| | | |||||
* | | Merge pull request #483 from kamipo/remove_unused_engine | Rafael França | 2017-05-05 | 2 | -3/+3 |
|\ \ | | | | | | | Remove unused `engine` | ||||
| * | | Remove unused `engine` | Ryuta Kamizono | 2017-05-04 | 2 | -3/+3 |
| | | | | | | | | | | | | | | | | | | Follow up of 98fc25991137ee09b6800578117f8c1c322680f2. `engine` is only used for `to_sql` and `where_sql` now. | ||||
* | | | Add regression test | Rafael Mendonça França | 2017-05-04 | 1 | -0/+11 |
| | | | |||||
* | | | Revert "Merge pull request #482 from kirs/multiple-insert" | Rafael Mendonça França | 2017-05-04 | 7 | -54/+5 |
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 6d105c7f891a14316eab47dfff3bf1b94f3204e7, reversing changes made to 437aa3a4bb8ad4f3f4eba299dbb1112852f9c7ac. This broke Active Record when the values are sql literals | ||||
* | | | Merge pull request #482 from kirs/multiple-insert | Rafael França | 2017-05-04 | 7 | -5/+54 |
|\ \ \ | |/ / |/| | | Support multiple inserts | ||||
| * | | Support multiple inserts | Kir Shatrov | 2017-05-01 | 7 | -5/+54 |
|/ / | |||||
* | | Merge pull request #475 from PedroSena/chainable-insert | Rafael França | 2017-02-28 | 2 | -0/+8 |
|\ \ | | | | | | | Made InsertManager#insert chainable | ||||
| * | | Made InsertManager#insert chainable | Pedro Sena | 2017-02-28 | 2 | -0/+8 |
|/ / | |||||
* | | Merge pull request #474 from JaKXz/patch-1 | Rafael França | 2017-02-22 | 1 | -1/+8 |
|\ \ | | | | | | | docs: add distinct example to README | ||||
| * | | docs(distinct): tweaks [skip ci] | Jason Kurian | 2017-02-22 | 1 | -1/+1 |
| | | | |||||
| * | | docs(distinct): fix distinct example [skip ci] | Jason Kurian | 2017-02-22 | 1 | -2/+2 |
| | | | |||||
| * | | docs: add distinct to README | Jason Kurian | 2017-02-22 | 1 | -1/+8 |
|/ / | |||||
* | | Prepare to 8.0.0 | Rafael Mendonça França | 2017-02-21 | 2 | -1/+4 |
| | | |||||
* | | Merge pull request #470 from kmmndr/named_function_eq_nil | Rafael França | 2017-02-21 | 1 | -0/+6 |
|\ \ | |/ |/| | named functions compared to nil | ||||
| * | named functions compared to nil | Thomas Kienlen | 2017-02-02 | 1 | -0/+6 |
| | | |||||
* | | Merge pull request #471 from rails/frozen-string-literal | Rafael França | 2017-02-14 | 132 | -1/+138 |
|\ \ | |/ |/| | Enable frozen_string_literal in all files in arel | ||||
| * | Enable frozen_string_literal in all files in arel | Rafael Mendonça França | 2017-02-13 | 132 | -1/+138 |
|/ | |||||
* | Merge pull request #468 from zhufenggood/master | Rafael França | 2017-01-30 | 1 | -4/+4 |
|\ | | | | | Update to_sql.rb. Little performance improvement. | ||||
| * | Performance improvement. | zhufenggood | 2017-01-27 | 1 | -4/+4 |
|/ | |||||
* | Merge pull request #467 from composerinteralia/custom-errors | Rafael França | 2017-01-17 | 6 | -2/+27 |
|\ | | | | | Raise custom error on empty join | ||||
| * | Raise custom error on empty join | Daniel Colson | 2017-01-17 | 6 | -2/+27 |
|/ | |||||
* | Merge pull request #463 from yahonda/use_assert_nil | Kasper Timm Hansen | 2016-12-30 | 1 | -2/+2 |
|\ | | | | | Address `Use assert_nil if expecting nil` warnings | ||||
| * | Address `Use assert_nil if expecting nil` warnings | Yasuo Honda | 2016-12-30 | 1 | -2/+2 |
|/ | |||||
* | Remove dead code now that attr is not used anymore | Rafael Mendonça França | 2016-12-29 | 1 | -1/+1 |
| | |||||
* | Merge pull request #462 from rails/arel-without-deprecation | Rafael França | 2016-12-29 | 9 | -157/+23 |
|\ | | | | | Remove deprecated type cast support from Arel | ||||
| * | Test with Ruby 2.4 | Rafael Mendonça França | 2016-12-29 | 1 | -0/+1 |
| | | |||||
| * | Fix identation | Rafael Mendonça França | 2016-12-29 | 1 | -7/+7 |
| | | |||||
| * | Bump arel to 8.0.0 | Rafael Mendonça França | 2016-12-29 | 1 | -1/+1 |
| | | |||||
| * | Remove deprecated type cast support in Arel | Rafael Mendonça França | 2016-12-29 | 6 | -137/+14 |
| | | |||||
| * | Remove dead code | Rafael Mendonça França | 2016-12-29 | 1 | -12/+0 |
|/ | |||||
* | Arel master is alre 7.2 | Rafael Mendonça França | 2016-12-28 | 1 | -1/+1 |
| | | | | closes #461 | ||||
* | Merge pull request #459 from danielpclark/patch-1 | Rafael França | 2016-12-19 | 1 | -1/+1 |
|\ | | | | | missing asterisk | ||||
| * | missing asterisk | Daniel P. Clark | 2016-12-19 | 1 | -1/+1 |
|/ | |||||
* | Merge pull request #458 from mcls/patch-1 | Rafael França | 2016-12-01 | 1 | -0/+1 |
|\ | | | | | Link to the API docs | ||||
| * | Link to the API docs | Maarten Claes | 2016-12-01 | 1 | -0/+1 |
|/ | |||||
* | Merge pull request #451 from kbrock/ignore_rbx | Matthew Draper | 2016-10-15 | 1 | -0/+1 |
|\ | | | | | Fix Build: Allow failures from rubinius | ||||
| * | Allow failures from rubinius | Keenan Brock | 2016-10-14 | 1 | -0/+1 |
|/ | | | | | | | | | | | | Per https://github.com/travis-ci/travis-ci/issues/5294 It looks like rvm is having trouble installing rubinius ``` rvm use rbx-2 --install --binary --fuzzy ``` I think this is the culpret for all builds failing since September | ||||
* | Merge pull request #446 from abonec/deprecated_table_exists | Rafael França | 2016-10-10 | 2 | -2/+2 |
|\ | | | | | use #data_source_exists? if possible instead of deprecated #table_exi… | ||||
| * | use #data_source_exists? instead of deprecated #table_exists? | Alexander Baronec | 2016-10-08 | 2 | -2/+2 |
|/ | |||||
* | Merge pull request #443 from mgbatchelor/master | Rafael França | 2016-10-07 | 2 | -1/+12 |
|\ | | | | | remove union mapping as :binary node when performing DepthFirst enumeration | ||||
| * | remove union mapping as :binary node when performing DepthFirst enumeration | Michael Batchelor | 2016-08-19 | 2 | -1/+12 |
| | |