aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/to_sql.rb
Commit message (Collapse)AuthorAgeFilesLines
* Documented the case-insensitive nature of the match feature.Robb Shecter2013-12-051-0/+4
| | | Documenting the library's behavior. People and other libraries (cf. Squeel) have come to depend on this behavior, and so am submitting this pull request to specify it authoritatively.
* Remove deprecated calls to using `UpdateManager` without setting ↵Vipul A M2013-11-101-11/+1
| | | | `UpdateManager#key`
* fix one deprecation warningAaron Patterson2013-10-141-1/+1
|
* Make visitors threadsafe by removing @last_columnErnie Miller2013-04-281-167/+171
| | | | | | | | | | | | | | | | | | | | | | 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.
* ARel -> ArelXavier Noria2013-04-141-1/+1
| | | | | | | The project uses "Arel" most of the time, but there were a few "ARel" here and there. I checked with @brynary back in 2010 to pick one for the Rails documentation guidelines and "Arel" was chosen and documented. This patch chooses "Arel" vs "ARel" based on that.
* call the columns hash methodAaron Patterson2013-03-141-3/+3
|
* Denied the quoting of SqlLiteralsNoemj2013-01-291-0/+1
|
* avoid extra string objects in the inner join caseAaron Patterson2012-10-151-1/+6
|
* more roflscaling strings in the visitorAaron Patterson2012-10-121-8/+26
|
* adding some roflscale to the sql visitorAaron Patterson2012-10-121-13/+96
|
* Merge pull request #140 from sunaku/GH-139Aaron Patterson2012-09-241-4/+4
|\ | | | | bugfix: some aggregations lacked DISTINCT emission
| * GH-139: some aggregations lacked DISTINCT emissionSuraj N. Kurapati2012-09-211-4/+4
| |
* | to_sql: add support for emitting SQL subqueriesSuraj N. Kurapati2012-09-221-0/+4
|/
* Fix in [] to be false, in [] to be trueErnie Miller2012-06-141-2/+10
| | | | This is in response to discussion on 62207fa
* Do not generate NOT IN (NULL) when empty rightSantiago Pastorino2012-06-131-1/+1
|
* Add #extract, which produces ANSI SQL function EXTRACT(<field> from <expr>).Alexander Staubo2012-02-231-0/+4
|
* Support ANSI SQL2003 window functions.Alexander Staubo2012-02-221-0/+54
|
* added a module for visiting and transforming bind valuesAaron Patterson2012-02-211-2/+2
|
* bind parameters can be differentiated from sql literalsAaron Patterson2012-02-201-0/+1
|
* bumping to 3.0.0Aaron Patterson2012-01-121-1/+1
|
* Ensure @last_column is cleared after visiting objectNorman Clarke2012-01-071-1/+1
|
* calling cache methods against the connectionAaron Patterson2011-11-191-18/+12
|
* Support locking by default and disable it only for SQLite.Edgars Beigarts2011-08-261-2/+1
|
* Make it the responsibility of the connection to hold on to a visitor for ↵Jon Leighton2011-08-081-4/+2
| | | | generating SQL, rather than the TreeManager. (There is a related commit coming in Active Record.)
* Support update statements containing joinsJon Leighton2011-08-081-4/+1
|
* Add nodes for boolean constantsDaniel Cadenas2011-08-031-0/+8
| | | | | | | | | | | | This is useful for dynamically created predicates e.g: expr1 = table.create_false expr2 = table.create_false expr1 = create_a_predicate() if some_condition expr2 = create_another_predicate() if some_other_condition table.where(expr1.and(expr2))
* Break Ordering into Ascending/Descending nodes, allow reversalErnie Miller2011-06-151-2/+6
|
* do not cache sql literal valuesAaron Patterson2011-05-171-1/+2
|
* refactoring to a methodAaron Patterson2011-05-101-3/+11
|
* Make ToSql more thread safe.Damon McCormick + Cameron Walters2011-05-101-5/+4
| | | | | | | Because the ToSql visitor instance is shared across all threads, there is a race condition around column types for binary nodes. It's possible, for instance, to end up with ActiveRecord converting a string value in the final SQL to an integer during heavy concurrent operations.
* raising not implemented exceptions for distinct on where it is not supportedAaron Patterson2011-04-211-0/+4
|
* adding Distinct ON nodeAaron Patterson2011-04-211-2/+2
|
* adding a DISTINCT nodeAaron Patterson2011-04-211-0/+5
|
* adding a Bin node to emit mysql BINARY keywordsAaron Patterson2011-04-111-0/+4
|
* use TableAlias nodes for aliasing subselectsAaron Patterson2011-03-301-1/+1
|
* allowing sql literals for values in insert statementsAaron Patterson2011-03-211-1/+5
|
* Merge branch 'master' of github.com:rails/arelAaron Patterson2011-03-211-13/+6
|\ | | | | | | | | | | * 'master' of github.com:rails/arel: Make as factory method convert alias name to SqlLiteral Replace MathOperation with InfixOperation to support more operators
| * Replace MathOperation with InfixOperation to support more operatorsErnie Miller2011-03-091-13/+6
| |
* | Fixes rails bug #6058.Hugo Peixoto2011-03-211-0/+1
|/ | | | Propagates 'where' clauses when subquerying is triggered on the UpdateManager.
* Merge branch 'master' of github.com:rails/arelAaron Patterson2011-03-071-1/+1
|\ | | | | | | | | * 'master' of github.com:rails/arel: Add an #table_name method to Table and TableAlias, which always returns the actual table name, not the alias. Then fix ToSql#column_for to use this table name when checking whether the table exists (rather than before, where it was checking whether a table with the alias name exists, which was incorrect).
| * Add an #table_name method to Table and TableAlias, which always returns the ↵Jon Leighton2011-03-041-1/+1
| | | | | | | | actual table name, not the alias. Then fix ToSql#column_for to use this table name when checking whether the table exists (rather than before, where it was checking whether a table with the alias name exists, which was incorrect).
* | Merge remote branch 'stiff/master' into omgAaron Patterson2011-03-071-0/+16
|\ \ | |/ |/| | | | | * stiff/master: implemented support for math operations in numeric attributes
| * implemented support for math operations in numeric attributesVladimir Meremyanin2011-01-291-0/+16
| |
* | use the cache mechanism in the connection pool rather than our own cacheAaron Patterson2011-02-071-28/+3
| |
* | adding TOP to sub selects for mssqlAaron Patterson2011-02-021-9/+12
|/
* Added support for INTERSECT and EXCEPTBrian Cardarella2011-01-221-0/+8
|
* WTF, tabs?Paul Sadauskas2011-01-211-17/+17
|
* WITH expr as array in visitorPaul Sadauskas2011-01-211-2/+2
|
* Don't need with_recursivePaul Sadauskas2011-01-211-1/+0
|
* Add support for WITH and UNIONPaul Sadauskas2011-01-211-0/+18
| | | | | | PostgreSQL WITH RECURSIVE support Make WITH be a unary node