| 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This reverts commit 9b92af7098b2728ced578ab9a7679176d20f120f.
beta2 is out, and we've fixed the issue that this caused in Rails
|
|
|
|
|
| |
This reverts commit 36836fa5e7c084c0dce2818577e6fd0cf815f786, reversing
changes made to 53bc8426648cc93695525e8f12102cd416b2d772.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| | |
`#not_in` with a range should respect proper precedence
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
Improve test coverage for `#in` and `#not_in`
|
| |/
| |
| |
| |
| |
| | |
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.
|
|/ |
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
| |
| |
| | |
Fixes https://github.com/rails/rails/issues/16913
|
|\ \
| | |
| | | |
Add SelectManager#distinct_on to set/unset Arel::Nodes::DistinctOn quantifier
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix lt & lteq don't accept most of values.
|
| | | | |
|
| | | | |
|
|\ \ \ \
| |_|/ /
|/| | | |
Wrap nested Nodes::Grouping in brackets only once
|
| | | | |
|
|\ \ \ \
| |_|/ /
|/| | | |
Allow for alias omission in aggregate expressions
|
| | | | |
|
| | | | |
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Cleanup SelectManager Test
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
- Remove redundant `ast` variable creation
- Rename similar join tests name to what they actually test
- Move "joins itself" test to "joins" describe instead of defining describe block twice
- Move update manager statement tests in logical order
- Move `project` tests in logical order
|
| | | | |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Modify Visitors::Dot's API to use collectors
|
| |/ / / |
|
|/ / /
| | |
| | |
| | |
| | | |
- Rename into test to indicate it accepts table and chains on it
- Rename "combo" test to what it actually tests
|
|\ \ \
| | | |
| | | | |
Support passing of SelectManager to attribute methods
|
| | | | |
|
|/ / / |
|
| | | |
|
| | |
| | |
| | |
| | | |
- Fix typo: `test_opertaion_ordering` => `test_operation_ordering`
|