aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
Commit message (Collapse)AuthorAgeFilesLines
* Relax the UUID regexGodfrey Chan2014-12-181-9/+2
| | | | | | | | Apparently PG does not validate against RFC 4122. The intent of the original patch is just to protect against PG errors (which potentially breaks txns, etc) because of bad user input, so we shouldn't try any harder than PG itself. Closes #17931
* Merge pull request #17793 from kamipo/fix_undesirable_range_errorSean Griffin2014-12-111-5/+16
|\ | | | | Fix undesirable RangeError by Type::Integer. Add Type::UnsignedInteger.
| * Fix undesirable RangeError by Type::Integer. Add Type::UnsignedInteger.Ryuta Kamizono2014-12-121-5/+16
| |
* | Refactor `quoted_date`Ryuta Kamizono2014-12-114-25/+13
|/ | | | Move microseconds formatting to `AbstractAdapter`.
* Revert to 4.1 behavior for casting PG arraysSean Griffin2014-12-081-0/+3
| | | | | | | | | | The user is able to pass PG string literals in 4.1, and have it converted to an array. This is also possible in 4.2, but it would remain in string form until saving and reloading, which breaks our `attr = save.reload.attr` contract. I think we should deprecate this in 5.0, and only allow array input from user sources. However, this currently constitutes a breaking change to public API that did not go through a deprecation cycle.
* minor sentences fixesNeeraj Singh2014-12-071-3/+3
|
* Correctly respect subtypes for PG arrays and rangesSean Griffin2014-12-052-10/+25
| | | | | | | | | | | | | The type registration was simply looking for the OID, and eagerly fetching/constructing the sub type when it was registered. However, numeric types have additional parameters which are extracted from the actual SQL string of the type during lookup, and can have their behavior change based on the result. We simply need to use the block form of registration, and look up the subtype lazily instead. Fixes #17935
* Failure to rollback t.timestamps when within a change_table migrationnoam2014-12-033-4/+4
| | | | | | | | | | | | | When running the following migration: change_table(:table_name) { |t| t/timestamps } The following error was produced: wrong number of arguments (2 for 1) .... /connection_adapters/abstract/schema_statements.rb:851:in `remove_timestamps' This is due to `arguments` containing an empty hash as its second argument.
* no need to pass native_database_types aroundYves Senn2014-12-022-5/+5
|
* Fix value extracted from negative integers for PostgreSQL.Guo Xiang Tan2014-12-011-1/+1
| | | | Fixes: https://github.com/rails/rails/issues/17856.
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-296-17/+11
|
* Merge pull request #17799 from kamipo/refactor_add_column_optionsRafael Mendonça França2014-11-282-6/+14
|\ | | | | Refactor `add_column_options!`, to move the quoting of default value for :uuid in `quote_value`.
| * Rename to `quote_default_expression` from `quote_value`Ryuta Kamizono2014-11-282-3/+3
| |
| * Refactor `add_column_options!`, to move the quoting of default value for ↵Ryuta Kamizono2014-11-281-4/+12
| | | | | | | | :uuid in `quote_value`.
* | Refactor `SchemaCreation#visit_AddColumn`Ryuta Kamizono2014-11-272-9/+1
|/
* Move PG float quoting to the correct locationSean Griffin2014-11-251-16/+6
| | | | | Not sure how we missed this case when we moved everything else to the `_quote` method.
* allow types to be passed in for USING castsAaron Patterson2014-11-241-0/+3
| | | | | | | This allows us so abstract the migration from the type that is actually used by Rails. For example, ":string" may be a varchar or something, but the framework does that translation, and the app shouldn't need to know.
* allow the "USING" statement to be specified on change column callsAaron Patterson2014-11-241-1/+3
|
* Mark comments that should not be in the docsclaudiob2014-11-244-0/+14
| | | | | | | | | | | Some comments that are meant to separate blocks of code in a file show up on http://api.rubyonrails.org as though they were part of the documentation. This commit hides those comments from the documentation. Stems from the discussion with @zzak at https://github.com/voloko/sdoc/issues/79#issuecomment-64158738 [ci skip]
* Rename the primary key index when renaming a table in pgSean Griffin2014-11-221-0/+3
| | | | | | | | Also checked to make sure this does not affect foreign key constraints. (It doesn't). Fixes #12856 Closes #14088
* ConnectionAdapter#substitute_at is technically public API...Sean Griffin2014-11-211-1/+1
| | | | We can't change the signature without a deprecation cycle.
* Merge pull request #17695 from claudiob/replace-all-backticks-with-plusesYves Senn2014-11-213-4/+4
|\ | | | | Wrap code snippets in +, not backticks, in sdoc [ci skip]
| * Wrap code snippets in +, not backticks, in sdocclaudiob2014-11-203-4/+4
| | | | | | | | | | | | | | | | I grepped the source code for code snippets wrapped in backticks in the comments and replaced the backticks with plus signs so they are correctly displayed in the Rails documentation. [ci skip]
* | raise a better exception for renaming long indexesAaron Patterson2014-11-202-0/+6
|/
* synchronize code and docs for `timestamps` and `add_timestamps`.Yves Senn2014-11-203-8/+11
| | | | | | | | 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)
* Revert "PERF: optimise type lookup to avoid invoking procs"Sean Griffin2014-11-191-13/+7
| | | | This reverts commit da99a2a2982d35f670ad9647463e09bfe9032b70.
* Support symbol foreign key to deletedtaniwaki2014-11-191-1/+1
|
* 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-172-5/+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
* Improve the performance of quoting table names on PGSean Griffin2014-11-171-4/+15
| | | | | | This caused a pretty major performance regression for 4.2, as this is a hotspot for query construction. We're still slightly slower than 4.1, but it's much less significant.
* PERF: optimise type lookup to avoid invoking procsSam2014-11-171-7/+13
|
* exec_prepared is GVL friendly, so lets use it.Aaron Patterson2014-11-131-4/+2
| | | | | also increase the version of pg required so that people will get the GVL friendly version
* Merge pull request #17580 from ccutrer/change_table_nameYves Senn2014-11-111-17/+19
|\ | | | | | | add a Table#name accessor like TableDefinition#name
| * add a Table#name accessor like TableDefinition#nameCody Cutrer2014-11-101-17/+19
| |
* | Merge pull request #17585 from aderyabin/remove_limited_update_conditionsRafael Mendonça França2014-11-102-8/+0
|\ \ | |/ |/| remove never called method `limited_update_conditions`
| * remove never called method `limited_update_conditions`Andrey Deryabin2014-11-112-8/+0
| |
* | tiny code improvement in sqlite3 adapter:Andrey Deryabin2014-11-101-6/+2
|/ | | | | - remove unused method `supports_add_column?` - change additional restriction method to `valid_alter_table_type?` - fix code style
* Revert the behavior of booleans in string columns to that of 4.1Sean Griffin2014-11-091-1/+23
| | | | | | | | | | | | | | | | | | | | | Why are people assigning booleans to string columns? >_> We unintentionally changed the behavior on Sqlite3 and PostgreSQL. Boolean values should cast to the database's representation of true and false. This is 't' and 'f' by default, and "1" and "0" on Mysql. The implementation to make the connection adapter specific behavior is hacky at best, and should be re-visted once we decide how we actually want to separate the concerns related to things that should change based on the database adapter. That said, this isn't something I'd expect to change based on my database adapter. We're storing a string, so the way the database represents a boolean should be irrelevant. It also seems strange for us to give booleans special behavior at all in string columns. Why is `to_s` not sufficient? It's inconsistent and confusing. Perhaps we should consider deprecating in the future. Fixes #17571
* docs, the abstract data type `:timestamp` was removed. See #15184 [ci skip]Yves Senn2014-11-071-2/+2
|
* Merge pull request #17473 from vipulnsward/rm-unused-methodYves Senn2014-11-051-8/+0
|\ | | | | Remove unused duplicated method `add_column_position` from AbstractMysqlAdapter.
| * - Remove unused duplicated method `add_column_position` from ↵Vipul A M2014-11-011-8/+0
| | | | | | | | AbstractMysqlAdapter
* | Added SchemaDumper support for tables with jsonb columns.Ted O'Meara2014-11-041-0/+1
| |
* | Remove unneeded autoloadRafael Mendonça França2014-11-031-4/+1
| |
* | Avoid unnecessary allocations/callsPablo Herrero2014-11-022-2/+2
| |
* | Correctly cast calculation results on PGSean Griffin2014-11-012-0/+14
| | | | | | | | | | MySQL reports the column name as `"MAX(developer_id)"`. PG will report it as `"max"`
* | Merge pull request #17463 from mrgilman/remove-index-from-substitute-atSean Griffin2014-11-012-2/+2
|\ \ | |/ |/| Remove redundant substitute index when constructing bind values
| * Remove redundant substitute index when constructing bind valuesMelanie Gilman2014-10-312-2/+2
| | | | | | | | | | | | 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.
* | remove unused and untested APIAaron Patterson2014-10-311-6/+2
| |
* | fix set_pk_sequence and add a test for it.Aaron Patterson2014-10-311-1/+1
| |
* | Added region sequencing of primary keys for Postgres.Joe Rafaniello2014-10-311-0/+21
|/ | | | | | | Skip setting sequence on a table create if the value is 0 since it will start the first value at 1 anyway. This fixes the PG error 'setval: value 0 is out of bounds for sequence vms_id_seq...' encountered when migrating a new DB. BugzID: 15452,9772,13475,16850