aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Properly lookup the limit for bigintSean Griffin2015-02-021-1/+6
| | | | Fixes #18787.
* Remove Relation#bind_paramsSean Griffin2015-01-271-1/+1
| | | | | | | | `bound_attributes` is now used universally across the board, removing the need for the conversion layer. These changes are mostly mechanical, with the exception of the log subscriber. Additional, we had to implement `hash` on the attribute objects, so they could be used as a key for query caching.
* Stop passing a column to `quote` when prepared statements are turned offSean Griffin2015-01-101-1/+2
| | | | | | | I'm planning on deprecating the column argument to mirror the deprecation in [arel]. [arel]: https://github.com/rails/arel/commit/6160bfbda1d1781c3b08a33ec4955f170e95be11
* Fix count on a separate connection (fixes #18359)brainopia2015-01-081-1/+1
| | | | | | | | Previosly count and other AR calculations would convert column_name_for_operation to sql on a default Arel::Table.engine (AR::Base) connection. That could lead to trouble if current model has a connection to a different adapter or Base connection is inaccessible.
* Change the default `null` value for `timestamps` to `false`Rafael Mendonça França2015-01-041-1/+0
|
* Merge pull request #8547 from printercu/patch-1Rafael Mendonça França2015-01-021-1/+6
|\ | | | | | | | | | | | | | | fix for messages in invalid encoding from db-drivers Conflicts: activerecord/lib/active_record/connection_adapters/abstract_adapter.rb activerecord/test/cases/connection_adapters/abstract_adapter_test.rb
| * fix for messages in invalid encoding from db-driversMax Melentiev2013-12-071-1/+5
| |
* | Merge pull request #17820 from fw42/restore_query_cache_on_rollbackRafael Mendonça França2015-01-021-3/+0
|\ \ | | | | | | | | | Clear query cache on rollback
| * | Restore query cache on rollbackFlorian Weingarten2014-12-011-3/+0
| | |
* | | add autoload for `ForeignKeyDefinition`.Yves Senn2014-12-271-0/+1
| | | | | | | | | | | | /cc @sgrif
* | | Refactor `quoted_date`Ryuta Kamizono2014-12-111-0/+10
|/ / | | | | | | Move microseconds formatting to `AbstractAdapter`.
* | ConnectionAdapter#substitute_at is technically public API...Sean Griffin2014-11-211-1/+1
| | | | | | | | We can't change the signature without a deprecation cycle.
* | synchronize code and docs for `timestamps` and `add_timestamps`.Yves Senn2014-11-201-0/+1
| | | | | | | | | | | | | | | | This makes the following changes: * warn if `:null` is not passed to `add_timestamps` * `timestamps` method docs link to `add_timestamps` docs * explain where additional options go * adjust examples to include `null: false` (to prevent deprecation warnings)
* | Remove the unused second argument to `substitute_at`Sean Griffin2014-11-171-2/+2
| | | | | | | | Oh hey, we got to remove some code because of that!
* | rm `reorder_bind_params`Sean Griffin2014-11-171-1/+1
| | | | | | | | | | | | Arel handles this for us automatically. Updated tests, as BindParam is no longer a subclass of SqlLiteral. We should remove the second argument to substitute_at entirely, as it's no longer used
* | Remove unneeded autoloadRafael Mendonça França2014-11-031-4/+1
| |
* | Correctly cast calculation results on PGSean Griffin2014-11-011-0/+4
| | | | | | | | | | MySQL reports the column name as `"MAX(developer_id)"`. PG will report it as `"max"`
* | Remove redundant substitute index when constructing bind valuesMelanie Gilman2014-10-311-1/+1
| | | | | | | | | | | | We end up re-ordering them either way when we construct the Arel AST (in order to deal with rewhere, etc), so we shouldn't bother giving it a number in the first place beforehand.
* | introduce `connection.supports_views?` and basic view tests.Yves Senn2014-09-091-0/+5
| | | | | | | | | | | | | | `AbstractAdapter#supports_views?` defaults to `false` so we have to turn it on in adapter subclasses. Currently the flag only controls test execution. /cc @yahonda
* | Freeze ADAPTER_NAME in adaptersAbdelkader Boudih2014-09-051-1/+2
| |
* | Replace ClosedTransaction with NullTransactionArthur Neves2014-07-311-1/+1
| |
* | savepoint_name should return nil for non-savepoint transactionsArthur Neves2014-07-281-3/+1
| | | | | | | | Also add test to assets the savepoint name
* | Transactions refactoringArthur Neves2014-07-281-0/+1
| | | | | | | | | | | | | | Add a transaction manager per connection, so it can controls the connection responsibilities. Delegate transaction methods to transaction_manager
* | Remove finishing? method from transaction.Arthur Neves2014-07-241-1/+3
| | | | | | | | | | | | | | | | | | | | The finishing variable on the transaction object was a work-around for the savepoint name, so after a rollback/commit the savepoint could be released with the previous name. related: 9296e6939bcc786149a07dac334267c4035b623a 60c88e64e26682a954f7c8cd6669d409ffffcc8b
* | Always pass a column with a type object to quoteSean Griffin2014-06-281-2/+2
| | | | | | | | | | | | | | | | The only case where we got a column that was not `nil`, but did not respond to `cast_type` was when type casting the default value during schema creation. We can look up the cast type, and add that object to the column definition. Will allow us to consistently rely on the type objects for type casting in all directions.
* | fk: `add_foreign_key` and `remove_foreign_key` for PostgreSQL adapter.Yves Senn2014-06-261-0/+5
| |
* | have an actual `NullColumn` object and update docs accordingly.Yves Senn2014-06-041-1/+4
| | | | | | | | | | | | Follow up to #15438 and #15502. /cc @sgrif
* | Ensure we always use instances of the adapter specific column classSean Griffin2014-05-281-0/+4
| | | | | | | | | | | | - Create a consistent API across adapters for building new columns - Use it for custom properties so we don't get `UndefinedMethodError`s in stuff I'm implementing elsewhere.
* | Keep closer to other methods that touch @transactionArthur Neves2014-05-281-4/+0
| |
* | Move types to the top level `ActiveRecord` namespaceSean Griffin2014-05-271-1/+1
| | | | | | | | | | `ActiveRecord::ConnectionAdapters::Type::Value` => `ActiveRecord::Type::Value`
* | Deprecate decimal columns being automatically treated as integersSean Griffin2014-05-271-0/+1
| | | | | | | | | | | | With ActiveRecord::Properties, we now have a reasonable path for users to continue to keep this behavior if they want it. This is an edge case that has added a lot of complexity to the code base.
* | Remove special case in schema dumper for decimal without scaleSean Griffin2014-05-231-1/+1
| |
* | Push limit to type objectsSean Griffin2014-05-221-15/+28
| | | | | | | | | | Columns and injected types no longer have any conditionals based on the format of SQL type strings! Hooray!
* | Push precision to type objectsSean Griffin2014-05-221-2/+7
| |
* | Push scale to type objectsSean Griffin2014-05-221-2/+11
| | | | | | | | | | | | Ideally types will be usable without having to specify a sql type string, so we should keep the information related to parsing them on the adapter or another object.
* | Remove :timestamp column typeSean Griffin2014-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The `:timestamp` type for columns is unused. All database adapters treat them as the same database type. All code in `ActiveRecord` which changes its behavior based on the column's type acts the same in both cases. However, when the type is passed to code that checks for the `:datetime` type, but not `:timestamp` (such as XML serialization), the result is unexpected behavior. Existing schema definitions will continue to work, and the `timestamp` type is transparently aliased to `datetime`.
* | Delegate `Column#type` to the injected type objectSean Griffin2014-05-191-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The decision to wrap type registrations in a proc was made for two reasons. 1. Some cases need to make an additional decision based on the type (e.g. a `Decimal` with a 0 scale) 2. Aliased types are automatically updated if they type they point to is updated later. If a user or another adapter decides to change the object used for `decimal` columns, `numeric`, and `number` will automatically point to the new type, without having to track what types are aliased explicitly. Everything else here should be pretty straightforward. PostgreSQL ranges had to change slightly, since the `simplified_type` method is gone.
* | Add a type object to Column constructorSean Griffin2014-05-171-0/+5
| | | | | | | | | | | | Part of #15134. In order to perform typecasting polymorphically, we need to add another argument to the constructor. The order was chosen to match the `oid_type` on `PostgreSQLColumn`.
* | Use the reader attribute rather than the instance var when possibleCarlos Antonio da Silva2014-05-041-2/+2
| |
* | Simplify unless conditional with ORCarlos Antonio da Silva2014-05-041-4/+2
| |
* | Convert column name to string only onceCarlos Antonio da Silva2014-05-041-1/+2
| |
* | refactor, move `column_for` to `AbstractAdapter` for better reuse.Yves Senn2014-05-041-0/+7
| |
* | push the collectors up to the abstract adapterAaron Patterson2014-04-091-0/+22
| |
* | add a bind collector, remove the bind visitorAaron Patterson2014-04-091-6/+1
| |
* | remove the bind substitution visitor. to_sql should never return bind valuesAaron Patterson2014-04-091-4/+0
| |
* | wrap the literal value before handing it to arelAaron Patterson2014-04-071-3/+4
| | | | | | | | this lets arel know how to correctly quote the value
* | Merge branch 'master' into adequaterecordAaron Patterson2014-04-071-23/+13
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (122 commits) Rails.application should be set inside before_configuration hook remove check for present? from delete_all Remove useless begin..end Build the reverse_order on its proper method. Use connection-specific bytea escaping Ignore order when doing count. make enums distinct per class Remove unused `subclass_controller_with_flash_type_bar` var from flash test. fix CollectionProxy delete_all documentation Added OS X specific commands to installation guide [ci skip] Recommended using homebrew for installing MySQL and PostgreSQL Fix setup of adding _flash_types test. Use SVG version of travis build status badge [skip ci] W3C CSP document moved to gihub.io URL [ci skip] sprockets-rails was released Fix the test defining the models in the right place Add CHANGELOG entry for #11650 [ci skip] Declare the assets dependency Use sass-rails 4.0.3 Make possible to use sprockets-rails 2.1 add missing parentheses to validates_with documentation [skip ci] ...
| * | Remove unused methodRafael Mendonça França2014-03-261-5/+0
| | | | | | | | | | | | | | | This method is not being called anywhere in our code and a GitHub search show it is not being used in any project.
| * | Remove unneeded comments about feature support on the adaptersRafael Mendonça França2014-03-261-20/+9
| | | | | | | | | | | | | | | These comments will likely be outdated with time and doesn't include any information that can't be found in the adapters
| * | create indexes inline in CREATE TABLE for MySQLCody Cutrer2014-03-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | This is important, because adding an index on a temporary table after it has been created would commit the transaction Conflicts: activerecord/CHANGELOG.md