| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| | |
Informix versions < 10 use 'FIRST' keyword instead of 'LIMIT'
|
| |
| |
| |
| | |
Still supported in versions 10+
|
|\ \
| |/
|/| |
Added a visitor for Set objects
|
| | |
|
| |
| |
| |
| | |
Fixes #128
|
|\ \
| | |
| | | |
Wrap nested Nodes::Grouping in brackets only once
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
- Fix typo: `test_opertaion_ordering` => `test_operation_ordering`
|
| | | |
|
|/ / |
|
| |
| |
| |
| | |
Ref https://github.com/rails/arel/commit/93d72131bcc24ccb5536bec672d2dac94f8de651
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
this lets our old depth first and dot visitors to work normally
|
|\ \
| | |
| | |
| | |
| | | |
* master:
removing unused join_sql method
|
| | | |
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* 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
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
This reverts commit 6d3ed6d96c4a3ac85b97d81bad95b7254b2aa2d4, reversing
changes made to a35fede61ac1a2fcff519ad052f2fcb8808922b9.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
|/ / |
|
| |
| |
| |
| | |
also fixed the test case for : test/visitors/test_to_sql.rb:22 which pass in the parameter attribute e.g the parameter a.
|
| |
| |
| |
| |
| | |
If we add the casting node to the ast at build time, then we can avoid
doing the lookup at visit time.
|
| |
| |
| |
| | |
The evaluates the assignment of two unqualified columns.
|
| | |
|
|\ \
| | |
| | |
| | | |
Bump minitest to 5.1.
|
| | | |
|
|/ /
| |
| |
| | |
using matches() or does_not_match().
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The last_column feature of the ToSql visitor and its descendants is what
enabled quoting based on the column last visited -- in other words, if
you have a standard condition like an equality with a string attribute
on the left side and an integer on the right side, then when ARel visits
the node, it'll first visit the left side attribute, setting the
column of the string attribute as the last column, and resulting in the
right side of the condition getting the appropriate quoting.
The downside is that this means that visitors can't be shared between
threads, because of the state mutation. It also makes for some really
weird behavior in the event that the visitor visits a node that happens
to contain an attribute you weren't expecting to be there, since it'll
potentially quote something based on that attribute. So, it prevents
reversing an equality condition. column = value will work, but not value
= column, since the last column wouldn't be the column you're hoping
for.
This is a first pass at fixing this by changing the signature of the
visit methods to accept the currently-relevant attribute, if any.
|
| | |
|
| | |
|