aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #20448 from sgrif/sg-postgresql-point-typeSean Griffin2015-06-073-0/+53
|\ | | | | Return a `Point` object from the PG Point type
| * Return a `Point` object from the PG Point typeSean Griffin2015-06-053-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a deprecation cycle to change the behavior of the default point type in the PostgreSQL adapter. The old behavior will continue to be available for the immediate future as `:legacy_point`. The current behavior of returning an `Array` causes several problems, the most significant of which is that we cannot differentiate between an array of points, and a point itself in the case of a column with the `point[]` type. The attributes API gives us a reasonable way to have a proper deprecation cycle for this change, so let's take advantage of it. If we like this change, we can also add proper support for the other geometric types (line, lseg, box, path, polygon, and circle), all of which are just aliases for string today. Fixes #20441
* | A few documentation tweaks [ci skip]Robin Dupret2015-06-071-1/+1
|/ | | | [Robin Dupret & Shunsuke Aida]
* Fixed typos in guidemanish-shrivastava2015-06-011-1/+1
|
* Add collation support for string and text columns in SQLite3Akshay Vishnoi2015-05-282-4/+66
|
* If specify `strict: :default` explicitly, do not set sql_mode.Ryuta Kamizono2015-05-261-2/+4
| | | | Related with #17370.
* Updated postgresql documentation link to use latest version [ci skip]Ronak Jangir2015-05-202-5/+5
|
* Remove unused already requireRyuta Kamizono2015-05-192-7/+0
|
* Remove `require 'arel/visitors/bind_visitor'`Ryuta Kamizono2015-05-193-4/+0
| | | | | This line introduced by the commit fd398475 for using `Arel::Visitors::BindVisitor`. Currently it is not used.
* Merge pull request #20212 from kamipo/avoid_heredocRafael Mendonça França2015-05-191-20/+5
|\ | | | | Avoid the heredoc in one line queries and simple queries
| * Avoid the heredoc in one line queries and simple queriesRyuta Kamizono2015-05-191-20/+5
| | | | | | | | Related with #20028.
* | Eliminate the duplication code of `StatementPool`Ryuta Kamizono2015-05-194-92/+36
|/
* Merge pull request #20175 from eugeneius/copy_schema_cache_after_forkRafael Mendonça França2015-05-181-1/+3
|\ | | | | Add schema cache to new connection pool after fork
| * Add schema cache to new connection pool after forkEugene Kenny2015-05-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Active Record detects when the process has forked and automatically creates a new connection pool to avoid sharing file descriptors. If the existing connection pool had a schema cache associated with it, the new pool should copy it to avoid unnecessarily querying the database for its schema. The code to detect that the process has forked is in ConnectionHandler, but the existing test for it was in the ConnectionManagement test file. I moved it to the right place while I was writing the new test for this change.
* | Merge pull request #20192 from kamipo/divide_to_column_options_handling_methodsRafael Mendonça França2015-05-182-10/+34
|\ \ | | | | | | Divide methods for handling column options separately
| * | Divide methods for handling column options separatelyRyuta Kamizono2015-05-182-10/+34
| |/
* | Merge pull request #20190 from kamipo/fix_serial_with_quoted_sequence_nameRafael Mendonça França2015-05-181-1/+2
|\ \ | | | | | | Fix `serial?` with quoted sequence name
| * | Fix `serial?` with quoted sequence nameRyuta Kamizono2015-05-181-1/+2
| |/
* / better `add_reference` documentation. [ci skip]Yves Senn2015-05-182-20/+18
|/ | | | | | | | | This patch - reduces the duplication among the `reference`-family methods. - better explains all the optians available for `add_reference`. - redirects to user from `references` to `add_reference`. Originated by #20184.
* Merge pull request #14938 from thedarkone/pool-lock-fixMatthew Draper2015-05-162-85/+406
|\ | | | | Reducing AR::ConPool's critical (synchronized) section
| * AR::ConPool - remove synchronization around connection cache.thedarkone2015-05-141-79/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed `@reserved_connections` -> `@thread_cached_conns`. New name clearly conveys the purpose of the cache, which is to speed-up `#connection` method. The new `@thread_cached_conns` now also uses `Thread` objects as keys (instead of previously `Thread.current.object_id`). Since there is no longer any synchronization around `@thread_cached_conns`, `disconnect!` and `clear_reloadable_connections!` methods now pre-emptively obtain ownership (via `checkout`) of all existing connections, before modifying internal data structures. A private method `release` has been renamed `thread_conn_uncache` to clear-up its purpose. Fixed some brittle `thread.status == "sleep"` tests (threads can go into sleep even without locks).
| * AR::ConPool - establish connections outside of critical section.thedarkone2015-05-141-27/+101
| |
| * AR::ConPool - reduce post checkout critical section.thedarkone2015-05-142-13/+35
| | | | | | | | Move post checkout connection verification out of mutex.synchronize.
* | Remove redundant require 'set' linesMehmet Emin İNAÇ2015-05-152-2/+0
|/
* :nodoc: postgresql add_columnTony Miller2015-05-131-3/+1
|
* Refactor abstract_mysql_adapter type_to_sql methodMehmet Emin İNAÇ2015-05-131-21/+33
|
* :nodoc: rename_column in postgresql/schema_statements.rbTony Miller2015-05-081-1/+1
| | | | | Its already doc'ed in activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
* Merge pull request #20047 from mcfiredrill/make-subquery-for-privateRafael Mendonça França2015-05-061-13/+13
|\ | | | | make AbstractAdapter#subquery_for private
| * make AbstractAdapter#subquery_for privateTony Miller2015-05-061-13/+13
| |
* | Merge pull request #20025 from kamipo/dont_use_exec_query_for_performanceMatthew Draper2015-05-052-22/+17
|\ \ | | | | | | Use `select_value` for avoid `ActiveRecord::Result` instance creating
| * | Use `select_value` for avoid `ActiveRecord::Result` instance creatingRyuta Kamizono2015-05-052-22/+17
| | | | | | | | | | | | | | | `exec_query` create `ActiveRecord::Result` instance. It is better to use `select_value` instead of `exec_query` for performance.
* | | Merge pull request #20024 from ↵Matthew Draper2015-05-051-2/+3
|\ \ \ | | | | | | | | | | | | | | | | kamipo/use_select_rows_instead_of_select_one_in_select_values Use `select_rows` instead of `select_one` in `select_value`
| * | | Use `select_rows` instead of `select_one` in `select_value`Ryuta Kamizono2015-05-051-2/+3
| |/ / | | | | | | | | | | | | `select_one` create `ActiveRecord::Result` instance. It is better to use `select_rows` instead of `select_one` for performance.
* | | Merge pull request #17632 from eugeneius/schema_cache_dump_connection_poolAaron Patterson2015-05-042-2/+12
|\ \ \ | |/ / |/| | Apply schema cache dump when creating connections
| * | Apply schema cache dump when creating connectionsEugene Kenny2015-04-292-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `db:schema:cache:dump` rake task dumps the database schema structure to `db/schema_cache.dump`. If this file is present, the schema details are loaded into the currently checked out connection by a railtie while Rails is booting, to avoid having to query the database for its schema. The schema cache dump is only applied to the initial connection used to boot the application though; other connections from the same pool are created with an empty schema cache, and still have to load the structure of each table directly from the database. With this change, a copy of the schema cache is associated with the connection pool and applied to connections as they are created.
* | | More exercise the create index sql testsRyuta Kamizono2015-05-042-4/+5
| | |
* | | Do not use options that does not supportRyuta Kamizono2015-05-041-4/+4
| | | | | | | | | | | | | | | MySQL does not support partial index. And, the create index algorithm in create table can not be specified.
* | | Merge pull request #17569 from kamipo/dump_table_optionsRafael Mendonça França2015-05-032-0/+14
|\ \ \ | | | | | | | | | | | | Correctly dump `:options` on `create_table` for MySQL
| * | | Correctly dump `:options` on `create_table` for MySQLRyuta Kamizono2015-05-032-0/+14
| | | |
* | | | Merge pull request #19978 from kamipo/collation_option_support_for_postgresqlRafael Mendonça França2015-05-038-32/+52
|\ \ \ \ | | | | | | | | | | PostgreSQL: `:collation` support for string and text columns
| * | | | PostgreSQL: `:collation` support for string and text columnsRyuta Kamizono2015-05-042-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example: create_table :foos do |t| t.string :string_en, collation: 'en_US.UTF-8' t.text :text_ja, collation: 'ja_JP.UTF-8' end
| * | | | Move the collation handling code from the MySQL adapter to common classesRyuta Kamizono2015-05-047-29/+37
| | | | | | | | | | | | | | | | | | | | | | | | | Some databases like MySQL allow defining collation charset for specific columns.
* | | | | Merge pull request #19989 from kamipo/change_visit_addcolumn_visibiltyRafael Mendonça França2015-05-033-11/+14
|\ \ \ \ \ | | | | | | | | | | | | Change the `visit_AddColumn` visiblity for the internal API
| * | | | | Change the `visit_AddColumn` visiblity for the internal APIRyuta Kamizono2015-05-033-11/+14
| | | | | |
* | | | | | Missing `:bigint` [ci skip]Ryuta Kamizono2015-05-041-1/+1
| |/ / / / |/| | | |
* | | | | Merge pull request #19988 from kamipo/move_comment_about_microsecondsZachary Scott2015-05-032-2/+3
|\ \ \ \ \ | |_|_|_|/ |/| | | | Move comment about microseconds [ci skip]
| * | | | Move comment about microseconds [ci skip]Ryuta Kamizono2015-05-032-2/+3
| |/ / / | | | | | | | | | | | | The microseconds handling was already moved to `Quoting#quoted_date`.
* | | | gem 'mysql2', '~> 0.3.18'Ryuta Kamizono2015-05-041-1/+1
| | | | | | | | | | | | | | | | Follow up #18914.
* | | | `:nodoc:` postgresql's change_columnTony Miller2015-05-031-2/+1
|/ / / | | | | | | | | | | | | Its nodoc'ed for the other implementations, and doc'ed in the base class, just like the other change_column* methods.
* / / :nodoc: change_column_null in the implmenting adaptersTony Miller2015-05-033-3/+3
|/ / | | | | | | | | | | `change_column_null` is doc'ed only in ActiveRecord::ConnectionAdapters::SchemaStatements, so it would make sense to :nodoc: it elsewhere.