aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add an invert method for remove_foreign_keyAster Ryan2015-06-111-1/+6
|/
* A few documentation tweaks [ci skip]Robin Dupret2015-06-071-1/+1
| | | | [Robin Dupret & Shunsuke Aida]
* Updated postgresql documentation link to use latest version [ci skip]Ronak Jangir2015-05-201-1/+1
|
* Remove unused already requireRyuta Kamizono2015-05-191-4/+0
|
* 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-181-4/+24
|\ \ | | | | | | Divide methods for handling column options separately
| * | Divide methods for handling column options separatelyRyuta Kamizono2015-05-181-4/+24
| |/
* / 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-161-80/+394
|\ | | | | 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-141-8/+23
| | | | | | | | Move post checkout connection verification out of mutex.synchronize.
* | Remove redundant require 'set' linesMehmet Emin İNAÇ2015-05-152-2/+0
|/
* 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-041-2/+4
|\ \ | |/ |/| Apply schema cache dump when creating connections
| * Apply schema cache dump when creating connectionsEugene Kenny2015-04-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-041-2/+2
| |
* | Merge pull request #17569 from kamipo/dump_table_optionsRafael Mendonça França2015-05-031-0/+4
|\ \ | | | | | | | | | Correctly dump `:options` on `create_table` for MySQL
| * | Correctly dump `:options` on `create_table` for MySQLRyuta Kamizono2015-05-031-0/+4
| | |
* | | Merge pull request #19978 from kamipo/collation_option_support_for_postgresqlRafael Mendonça França2015-05-033-2/+12
|\ \ \ | | | | | | | | PostgreSQL: `:collation` support for string and text columns
| * | | Move the collation handling code from the MySQL adapter to common classesRyuta Kamizono2015-05-043-2/+12
| | | | | | | | | | | | | | | | | | | | 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-032-6/+9
|\ \ \ \ | | | | | | | | | | Change the `visit_AddColumn` visiblity for the internal API
| * | | | Change the `visit_AddColumn` visiblity for the internal APIRyuta Kamizono2015-05-032-6/+9
| | |/ / | |/| |
* | | | Missing `:bigint` [ci skip]Ryuta Kamizono2015-05-041-1/+1
| |/ / |/| |
* | | Move comment about microseconds [ci skip]Ryuta Kamizono2015-05-031-0/+2
|/ / | | | | | | The microseconds handling was already moved to `Quoting#quoted_date`.
* | Merge pull request #19962 from prathamesh-sonpatki/nodoc-validate-index-lengthYves Senn2015-04-301-1/+1
|\ \ | | | | | | Nodoc validate_index_length! method
| * | Nodoc validate_index_length! methodPrathamesh Sonpatki2015-04-301-1/+1
| |/ | | | | | | - This method is used only by adapters to validate length of new index names.
* / Added documentation for PostGreSQL database_statements [ci skip]Prathamesh Sonpatki2015-04-301-2/+2
|/ | | | | | - Added documentation for index_name_exists? and rename_index. - Also changed rails to \Rails in documentation of allowed_index_name_length.
* use a more descriptive example. [ci skip]Yves Senn2015-04-241-6/+4
| | | | follow up to 107526e809ea2b6de8b2775ecf83e55d60833206
* docs for `create_table` and non-int primary keys. [ci skip]Yves Senn2015-04-241-0/+17
|
* Fix missing index when using timestamps with indexPaul Mucur2015-04-151-0/+1
| | | | | | | | | | | The `index` option used with `timestamps` should be passed to both `column` definitions for `created_at` and `updated_at` rather than just the first. This was happening because `Hash#delete` is used to extract the `index` option passed to `timestamps`, thereby mutating the `options` hash in-place. Now take a copy of the `options` before deleting so that the original is not modified.
* Document that partial indexes are only supported by Postgres and SQLite.Grey Baker2015-04-131-0/+2
| | | | Fixes #18106
* Add a note regarding add_column restricted API [ci skip]Zachary Scott2015-04-121-0/+4
| | | | | | We should document current behavior, and this is design of API for now. Closes #17597
* fix documentation for SchemaStatements#add_foreign_keySimon Stemplinger2015-04-081-2/+2
| | | | | | The implementation of the generation of the foreign key name was changed between Rails 4.2.0 and 4.2.1 from a random to a deterministic behavior, however the documentation still describes the old randomized behavior.
* Merge pull request #19448 from tgxworld/fix_activesupport_callbacks_clash_on_runRafael Mendonça França2015-04-061-2/+2
|\ | | | | Fix AS::Callbacks raising an error when `:run` callback is defined.
| * Revert "Reduce allocations when running AR callbacks."Guo Xiang Tan2015-03-221-2/+2
| | | | | | | | This reverts commit 796cab45561fce268aa74e6587cdb9cae3bb243e.
* | No need to document drop_table in the PostgreSQLAdapterRafael Mendonça França2015-04-061-0/+3
| | | | | | | | | | | | It behaves in the same way that the abstract adapter. [ci skip]
* | use singular table name if pluralize_table_names is setted as false while ↵Mehmet Emin İNAÇ2015-04-062-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | creating foreign key test case for use singular table name if pluralize_table_names is setted as false while creating foreign key refactor references foreign key addition tests use singular table name while removing foreign key merge foreign key singular table name methods remove unnecessary drop table from test
* | Freeze static arguments for gsubbrainopia2015-04-021-1/+1
| |
* | Prefer string patterns for gsubbrainopia2015-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/ruby/ruby/pull/579 - there is a new optimization since ruby 2.2 Previously regexp patterns were faster (since a string was converted to regexp underneath anyway). But now string patterns are faster and better reflect the purpose. Benchmark.ips do |bm| bm.report('regexp') { 'this is ::a random string'.gsub(/::/, '/') } bm.report('string') { 'this is ::a random string'.gsub('::', '/') } bm.compare! end # string: 753724.4 i/s # regexp: 501443.1 i/s - 1.50x slower
* | [ci skip] Remove unacceptable method nameyui-knk2015-03-241-1/+1
|/
* Updated MySQL documentation link to MySQL latest version 5.6 everywhere [ci ↵amitkumarsuroliya2015-03-191-2/+2
| | | | skip]
* Fix before_commit when updating a record on the callbackArthur Neves2015-03-141-23/+22
|
* Correctly dump `serial` and `bigserial`Ryuta Kamizono2015-03-041-1/+5
|
* Merge pull request #19171 from JuanitoFatas/doc/more-examplesSean Griffin2015-03-021-0/+16
|\ | | | | Add more documents for AR connection_adapters abstract schema_definitions. [ci skip]
| * Add more documents for AR connection_adapters abstract schema_definitions. ↵Juanito Fatas2015-03-031-0/+16
| | | | | | | | | | | | | | | | | | [ci skip] - Add example to column_exists? - Add example to index_exists? - Add document for foreign_key - Add document for foreign_key_exists?
* | Revert "delete unused method"Carlos Antonio da Silva2015-03-021-0/+4
| | | | | | | | | | | | | | | | This reverts commit a38732c8e6ab76ea0db4e1a617a1fa84b53a9750. Since the mutation logic was reverted in 07278519bb6db5579171fea70bccdfee1306f1d4, we must bring the reader method back as well, since the implementation relies on it.
* | Revert "mutate the transaction object to reflect state"Aaron Patterson2015-03-021-29/+25
| | | | | | | | | | | | | | | | This reverts commit 393e65b4170608593ad82377a9eadc918e85698d and ec51c3fedd16b561d096dcc1a6705fdc02ab7666 We don't want the records to hold hard references to transactions because they point at records that have callbacks.