| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Improve error message when passed unsupported type
|
| | |
|
|\ \
| | |
| | | |
No need to quote limit for Oracle12 visitor
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Explicitly declare if this is case sensitive or not
currently postgres assumes case insensitive regexp
no other databases support regexps
|
|/
|
|
|
|
|
| |
Explicitly declare if this is case sensitive or not
most implementation assume case sensitive
postgres assumes case insensitive
|
|\
| |
| | |
Support Oracle 12c top-N query
|
| |
| |
| |
| | |
to support `FETCH FIRST n ROWS` and `OFFSET` for Oracle 12c database
|
|/ |
|
|
|
|
|
| |
Refernce:
https://technet.microsoft.com/en-us/library/ms175486%28v=sql.105%29.aspx
|
|
|
|
|
|
| |
These two clauses have nearly identical semantics with regards to how
they would be constructed as an AST. It doesn't make sense for their
interfaces to be separate.
|
|
|
|
|
| |
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
|