| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
to_SQL already has supported the ESCAPE clause in #318.
PostgreSQL can use the ESCAPE clause too.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|