aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
Commit message (Collapse)AuthorAgeFilesLines
* Refactor `case_{sensitive|insensitive}_comparison`Ryuta Kamizono2016-01-012-17/+10
| | | | | | | | | | | | | | Before: ``` SELECT 1 AS one FROM "topics" WHERE "topics"."title" = 'abc' LIMIT $1 [["LIMIT", 1]] ``` After: ``` SELECT 1 AS one FROM "topics" WHERE "topics"."title" = $1 LIMIT $2 [["title", "abc"], ["LIMIT", 1]] ```
* Merge pull request #22848 from derekprior/dp-postgresql-versionRafael França2015-12-301-5/+5
|\ | | | | Make `postgresql_version` public
| * Make `postgresql_version` publicDerek Prior2015-12-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | This is useful to libraries that want to feature gate based on the version of PostgreSQL the user is connected to. For instance, I want to know if the user is connected to a version of Postgres that supports concurrent materialized view refreshes. I could add that as a method on the adapter as a PR, but rails has no need for this itself. Rails is already using the postgresql_version for its own feature gating and this makes that possible for other libraries.
* | Merge pull request #22241 from kamipo/add_columns_for_distinct_for_mysql57Rafael França2015-12-302-5/+23
|\ \ | | | | | | Add `columns_for_distinct` for MySQL 5.7 with ONLY_FULL_GROUP_BY
| * | Add `columns_for_distinct` for MySQL 5.7 with ONLY_FULL_GROUP_BYRyuta Kamizono2015-12-232-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | In MySQL 5.7.5 and up, ONLY_FULL_GROUP_BY affects handling of queries that use DISTINCT and ORDER BY. It requires the ORDER BY columns in the select list for distinct queries, and requires that the ORDER BY include the distinct column. See https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html
| * | Avoid `distinct` if a subquery has already materializedRyuta Kamizono2015-12-231-3/+5
| | | | | | | | | | | | Follow up to #19359 and avoid #22241.
* | | Merge pull request #22803 from kamipo/improve_select_one_in_mysql2_adapterRafael França2015-12-301-27/+9
|\ \ \ | | | | | | | | Improve `select_one` in `Mysql2Adapter`
| * | | Remove outdated commentRyuta Kamizono2015-12-271-28/+0
| | | | | | | | | | | | | | | | These `select_*` methods improved already.
| * | | Improve `select_one` in `Mysql2Adapter`Ryuta Kamizono2015-12-271-0/+10
| | | | | | | | | | | | | | | | | | | | Avoid instanciate `ActiveRecord::Result` and calling `ActiveRecord::Result#hash_rows` for the performance.
* | | | Merge pull request #22547 from kamipo/fix_create_table_info_cacheRafael França2015-12-291-2/+6
|\ \ \ \ | |/ / / |/| | | Correctly cache create_table_info
| * | | Correctly cache create_table_infoRyuta Kamizono2015-12-171-2/+6
| | | | | | | | | | | | | | | | Follow up to #21664.
* | | | Fix varbinary with default ''Ryuta Kamizono2015-12-241-13/+0
| |_|/ |/| | | | | | | | | | | | | | | | | A `(?:var)?binary` with default '' is a correct definition. Remove `missing_default_forged_as_empty_string?` method for fixing this issue because this method is a workaround for older mysql legacy adapter (19c99ac, f7015336).
* | | Merge pull request #22620 from kamipo/join_to_delete_is_same_as_join_to_updateRafael França2015-12-222-9/+3
|\ \ \ | | | | | | | | `join_to_delete` is same as `join_to_update`
| * | | `join_to_delete` is same as `join_to_update`Ryuta Kamizono2015-12-172-9/+3
| | | | | | | | | | | | | | | | Reapply #22615.
* | | | Add support for passing flags to MySQL2 adapter by arrayStephen Blackstone2015-12-221-1/+6
| | | |
* | | | Remove legacy mysql adapterRyuta Kamizono2015-12-213-9/+8
| | | | | | | | | | | | | | | | Follow up to #22642.
* | | | mysql2 adapter instead of mysql [ci skip]Rajarshi Das2015-12-202-3/+3
| |_|/ |/| |
* | | Handle specified schemas when removing a Postgres indexGrey Baker2015-12-181-3/+16
| | |
* | | Merge pull request #20815 from ↵Matthew Draper2015-12-181-2/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | byroot/do-not-include-column-limit-if-it-is-default Do not include column limit in schema.rb if it matches the default
| * | | Do not include column limit in schema.rb if it matches the defaultJean Boussier2015-07-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When working on engines that supports multiple databases, it's very annoying to have a different schema.rb output based on which database you use. MySQL being the primary offender. This patch should reduce the disparities a bit.
* | | | Merge pull request #22623 from greysteil/support-passing-schema-name-to-indexesMatthew Draper2015-12-181-9/+12
|\ \ \ \ | | | | | | | | | | | | | | | Support passing the schema name prefix to `conenction.indexes`
| * | | | Support passing the schema name prefix to `conenction.indexes`Grey Baker2015-12-171-9/+12
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | Support passing the schema name as a prefix to table name in `ConnectionAdapters::SchemaStatements#indexes`. Previously the prefix would be considered a full part of the index name, and only the schema in the current search path would be considered.
* | | | Merge pull request #19456 from greysteil/index-exists-behaviourMatthew Draper2015-12-181-15/+28
|\ \ \ \ | | | | | | | | | | | | | | | Ignore index name in `index_exists?` when not passed a name to check for
| * | | | Support removing custom-names indexes when only specifying column namesGrey Baker2015-12-151-13/+27
| | | | |
| * | | | Ignore index name in `index_exists?` when not passed a name to check forGrey Baker2015-12-151-2/+1
| | | | |
* | | | | Merge pull request #22642 from seuros/remove-mysql-adapterMatthew Draper2015-12-183-485/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Remove legacy mysql adapter
| * | | | | Remove legacy mysql adapterAbdelkader Boudih2015-12-173-485/+1
| | |/ / / | |/| | |
* / | | | Call the new point behavior `:point`, not `:rails_5_1_point`Sean Griffin2015-12-171-2/+1
|/ / / / | | | | | | | | | | | | | | | | Since the attributes API is new in Rails 5, we don't actually need to keep the behavior of `attribute :point`, as it's not a breaking change.
* | | | Revert "Merge pull request #22615 from ↵Rafael Mendonça França2015-12-172-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kamipo/join_to_delete_is_same_as_join_to_update" This reverts commit 4d06ea9a829de8f6f5a345589828e182eacab6a3, reversing changes made to e9d15072a94e2ae4dec5b7a121c84a5db38547b8. Reason: This will break oracle-enhanced, see https://github.com/rsim/oracle-enhanced/blob/3c42131db82b64ac41645db3affc6e4650289df6/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb#L1254
* | | | `join_to_delete` is same as `join_to_update`Ryuta Kamizono2015-12-172-9/+3
| |_|/ |/| |
* | | Merge pull request #22562 from sblackstone/masterJeremy Daer2015-12-151-2/+2
|\ \ \ | |/ / |/| | Allow users to pass flags from database.yml
| * | Allow users to pass flags from database.ymlStephen Blackstone2015-12-151-2/+2
| | | | | | | | | | | | | | | | | | Fix white-space Add test case demonstrating flags are received by the adapter
* | | Use a real migration version number in docsMatthew Draper2015-12-151-1/+1
| | | | | | | | | | | | | | | Even though this means more things to change when we bump after a release, it's more important that our examples are directly copyable.
* | | Use a deliberately-invalid migration version in all doc examplesMatthew Draper2015-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we use a real version, at best that'll be an onerous update required for each release; at worst, it will encourage users to write new migrations against an older version than they're using. The other option would be to leave these bare, without any version specifier. But as that's just a variant spelling of "4.2", it would seem to raise the same concerns as above.
* | | Merge pull request #22381 from yahonda/use_adapter_subsecond_precision_supportedAaron Patterson2015-12-131-0/+4
|\ \ \ | |/ / |/| | Use adapter supports_datetime_with_precision
| * | Support supports_datetime_with_precision? for sqlite3Yasuo Honda2015-11-301-0/+4
| | |
* | | Merge pull request #22449 from dnagir/database_connection_messageYves Senn2015-12-011-1/+1
|\ \ \ | |/ / |/| | Explain the connection pool error message better [ci skip]
| * | Explain the connection pool error message betterDmytrii Nagirniak2015-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous message was misleading (especially for Ops guys) when diagnosing problems related to the database connection. The message was suggesting that the connection cannot be obtained which normally assumes the need to look at the database. But this isn't the case as the connection could not be retrieved from the application's internal connection pool. The new message should make it more explicit and remove the confusion.
* | | Refactor `AbstractAdapter#initialize`Ryuta Kamizono2015-11-304-8/+7
|/ / | | | | | | `pool` in args is unused anymore. And `config` is used in all adapters.
* | `connection_options` is only needed for `MysqlAdapter`Ryuta Kamizono2015-11-293-3/+3
| | | | | | | | Not needed for `Mysql2Adapter` and `AbstractMysqlAdapter`.
* | Revert "Add prepared statements support for `Mysql2Adapter`"Sean Griffin2015-11-263-145/+151
| |
* | Add prepared statements support for `Mysql2Adapter`Ryuta Kamizono2015-11-263-151/+145
| |
* | Merge pull request #22304 from ↵Yves Senn2015-11-241-6/+12
|\ \ | | | | | | | | | | | | kamipo/schema_dumping_support_for_postgresql_geometric_types Add schema dumping support for PostgreSQL geometric data types
| * | Add schema dumping support for PostgreSQL geometric data typesRyuta Kamizono2015-11-241-6/+12
| | |
* | | Merge pull request #22214 from ↵Rafael França2015-11-244-15/+6
|\ \ \ | | | | | | | | | | | | | | | | kamipo/not_passing_native_database_types_to_table_definition Not passing `native_database_types` to `TableDefinition`
| * | | Not passing `native_database_types` to `TableDefinition`Ryuta Kamizono2015-11-084-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | The `native_database_types` only used in `TableDefinition` for look up the default `:limit` option. But this is duplicated process with `type_to_sql`. Passing `native_database_types` is not needed.
* | | | `set_field_encoding` is only needed for `MysqlAdapter`Ryuta Kamizono2015-11-243-9/+8
| |/ / |/| | | | | | | | Not needed for `Mysql2Adapter` and `AbstractMysqlAdapter`.
* | | Revert "Allow specifying the default table options for mysql adapters"Sean Griffin2015-11-191-2/+1
| | | | | | | | | | | | | | | | | | | | | This reverts commit 8246b593bff71f2cebf274c133bb8917f1e094c8. There was concern about this modifying the behavior of past migrations. We're going to add an way to modify the migration generator instead.
* | | Allow specifying the default table options for mysql adaptersSean Griffin2015-11-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's often the case that you want to have an option that you cannot specify at the database level, but want applied to *all* tables that you create. For example, you might want to specify `ROW_FORMAT=DYNAMIC` to not have to limit text columns to length 171 for indexing when using utf8mb4. This allows an easy way to specify this in your database configuration. While this change affects both MySQL and MySQL2, the test only covers MySQL2, as the legacy mysql adapter appears to always return ASCII strings, and is tangential to what we're actually doing.
* | | Rename 'key' to 'lock_id' or 'lock_name' for advisory lockingSam Davies2015-11-183-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | - key was a poor choice of name. A key implies something that will unlock a lock. The concept is actually more like a 'lock identifier' - mysql documentation calls this a 'lock name' - postgres documentation calls it a 'lock_id' - Updated variable names to reflect the preferred terminology for the database in question