aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* pg, `PostgreSQL::Name` to hold schema qualified names.Yves Senn2014-05-303-17/+53
|
* Refactor serialized types to be partially defined as custom propertiesSean Griffin2014-05-291-4/+0
| | | | | | | Many of the methods defined in `AttributeMethods::Serialization` can be refactored onto this type as well, but this is a reasonable small step. Removes the `Type` class, and the need for `decorate_columns` to handle serialized types.
* Ensure we always use instances of the adapter specific column classSean Griffin2014-05-281-1/+5
| | | | | | - 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.
* pg, keep `hstore` and `json` attributes as `Hash` in @attributes.Yves Senn2014-05-282-2/+14
| | | | | | | | | | | The solution presented in this patch is not efficient. We should replace it in the near future. The following needs to be worked out: * Is `@attributes` storing the Ruby or SQL representation? * `cacheable_column?` is broken but `hstore` and `json` rely on that behavior Refs #15369. /cc @sgrif @rafaelfranca
* remove unwanted `to_sym` call.Kuldeep Aggarwal2014-05-261-1/+1
|
* pg, remove duplicated code.Yves Senn2014-05-241-4/+0
|
* pg, extract schema definitions into separate file.Yves Senn2014-05-241-0/+138
| | | | | | | This mirrors the layout of abstract adapter and puts the definitions inside the `PostgreSQL` namespace (no longer under the adapter namespace). /cc @kares
* Merge pull request #15280 from sgrif/sg-postgres-defaultsRafael Mendonça França2014-05-232-76/+7
|\ | | | | Move parsing of PG sql strings for defaults out of column
| * Move parsing of PG sql strings for defaults out of columnSean Griffin2014-05-232-76/+7
| |
* | Inline type cast method for PG pointsSean Griffin2014-05-232-8/+4
|/
* Push limit to type objectsSean Griffin2014-05-221-9/+0
| | | | | Columns and injected types no longer have any conditionals based on the format of SQL type strings! Hooray!
* Push scale to type objectsSean Griffin2014-05-221-1/+1
| | | | | | 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.
* Move `extract_precision` onto type objectsDan Croak and Sean Griffin2014-05-222-13/+2
|
* Merge pull request #15249 from sgrif/sg-register-types-in-adapterRafael Mendonça França2014-05-222-73/+13
|\ | | | | Use the generic type map for all PG type registrations
| * Use the generic type map for all PG type registrationsSean Griffin2014-05-222-73/+13
| | | | | | | | | | | | | | We're going to want all of the benefits of the type map object for registrations, including block registration and real aliasing. Moves type name registrations to the adapter, and aliases the OIDs to the named types
* | Allow additional arguments to be used during type map lookupsSean Griffin2014-05-221-1/+1
|/ | | | | | | | Determining things like precision and scale in postgresql will require the given blocks to take additional arguments besides the OID. - Adds the ability to handle additional arguments to `TypeMap` - Passes the column type to blocks when looking up PG types
* Merge pull request #15218 from sgrif/sg-move-oid-typesRafael Mendonça França2014-05-2123-353/+532
|\ | | | | Move PG OID types to their own files
| * Move PG OID types to their own filesSean Griffin2014-05-2123-353/+532
| | | | | | | | | | | | | | As we promote these classes to first class concepts, these classes are starting to gain enough behavior to warrant being moved into their own files. Many of them will become quite large as we move additional behavior to the type objects.
* | Rename `oid_type` to `cast_type` to make PG columns consistentSean Griffin2014-05-211-5/+4
|/
* push `extract_scale` to the `Type`.Yves Senn2014-05-212-6/+4
| | | | | | | - `extract_precision`, `extract_limit`, and `extract_default` probably need to follow. - would be good to remove the delegation `Column#extract_scale`. /cc @sgrif
* Delegate `type_cast_for_write` to injected type objectSean Griffin2014-05-201-11/+0
|
* Merge pull request #15206 from sgrif/sg-type-map-postgresqlRafael Mendonça França2014-05-201-42/+5
|\ | | | | Use the generic type map for PostgreSQL OID registrations
| * Use the generic type map for PostgreSQL OID registrationsSean Griffin2014-05-201-42/+5
| |
* | Delegate predicate methods to injected type object on ColumnSean Griffin2014-05-202-8/+4
|/
* Merge pull request #15203 from sgrif/sg-delegate-type-castRafael Mendonça França2014-05-201-7/+0
|\ | | | | Replace `type_cast` case statement with delegation
| * Replace `type_cast` case statement with delegationSean Griffin2014-05-201-7/+0
| | | | | | | | | | | | | | | | All subclasses of column were now delegating `type_cast` to their injected type object. We can remove the overriding methods, and generalize it on the `Column` class itself. This also enabled us to remove several column classes completely, as they no longer had any meaningful behavior of their own.
* | Have Postgres OID types inherit from general typesSean Griffin2014-05-202-146/+80
|/ | | | | Using general types where possible. Several more can go away once infinity gets figured out.
* Delegate `Column#type` to the injected type objectSean Griffin2014-05-192-13/+5
| | | | | | | | | | | | | | | | 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.
* pg, re-introduce `PostgreSQL::Utils` to unify schema/table extraction.Yves Senn2014-05-193-24/+30
| | | | Partial revert of c0bfc3f412834ffe8327a15ae3a46602cc28e425
* pg, add missing nodocs for extracted modules.Yves Senn2014-05-194-6/+6
|
* Merge pull request #15156 from sgrif/sg-postgres-timestampsYves Senn2014-05-181-6/+3
|\ | | | | PostgreSQL timestamps should always be datetimes
| * PostgreSQL timestamps are always datetimesSean Griffin2014-05-171-6/+3
| | | | | | | | | | | | | | | | The current behavior is that they are treated as `datetime` normally, but if they are part of an array, they are treated as `timestamp`. The only place that seems to be impacted by this is schema dumping, which shouldn't matter since `t.datetime` and `t.timestamp` are equivalent in the `PostgreSQL` adapter, anyway.
* | Add a type object to Column constructorSean Griffin2014-05-171-2/+2
|/ | | | | | 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`.
* :scissors:Rafael Mendonça França2014-05-142-2/+0
|
* Methods of these modules are internalRafael Mendonça França2014-05-142-14/+14
| | | | | They should not be used on people application so they should not be present on the API documentation.
* PostgreSQLAdapter::Utils seems to be only used from a single spot - quite ↵kares2014-05-141-1/+19
| | | | redundant
* move PostgreSQL's DatabaseStatements out of the PostgreSQLAdapter name-spacekares2014-05-141-1/+6
|
* PostgreSQL's SchemaStatements seems a could candidate for re-use (with AR-JDBC)kares2014-05-141-6/+2
|
* introduce AR::ConnectionAdapters::PostgreSQL for sharing modules (with AR-JDBC)kares2014-05-146-9/+10
| | | ... 'shared' OID, ArrayParser and Cast helpers, also re-arranged Column's dependencies
* Merge pull request #15092 from kares/pg-array-parserRafael Mendonça França2014-05-132-27/+27
|\ | | | | [postgres] include PgArrayParser directly
| * [postgres] include PgArrayParser directly and only load/include ArrayParser ↵kares2014-05-132-27/+27
| | | | | | | | if not found
* | extract pg type map initialization process to `TypeMapInitializer`.Yves Senn2014-05-131-0/+71
|/
* pg, `change_column_default` accepts `[]`. Closes #11586.Yves Senn2014-05-122-2/+3
|
* pg, map `char` and `name` types as string. [dark-panda & Yves Senn]Yves Senn2014-05-121-0/+1
| | | | Closes #10802.
* pg, fix Infinity and NaN values conversion.Innokenty Mihailov2014-05-121-3/+8
| | | | Before this patch `Infinity`, `-Infinity` and `Nan` were read as `0`.
* Handle other pk types in PostgreSQL gracefully.Patrick Robertson2014-05-121-1/+1
| | | | | | | | | | | | | | In #10410 it was noted that you can no longer create PK's with the type of bigserial in PostgreSQL in 4.0.0.rc1. This is mostly because the newer adapter is checking for column type with the id column instead of just letting it pass through like it did before. Side effects: You may just create a PK column of a type that you really don't want to be your PK. As far as I can tell this was allowed in 3.2.X and perhaps an exception should be raised if you try and do something extremely dumb.
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2014-05-101-0/+3
|\
| * copy edits [ci skip]Vijay Dev2014-05-081-1/+1
| |
| * [ci skip] document type_cast_for_writeschneems2014-05-071-0/+3
| |
* | refactor, move `column_for` to `AbstractAdapter` for better reuse.Yves Senn2014-05-041-4/+0
|/