aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use the type object for type casting HStore columnsSean Griffin2014-07-031-43/+0
|
* Remove unused `array_member` from PG quoting for HStore columnsSean Griffin2014-06-291-2/+1
| | | | | Hstore no longer needs additional quoting to be used in an array, the array type handles it sufficiently.
* Use the type object when sending point columns to the DBSean Griffin2014-06-291-8/+0
|
* Use the type object for sending JSON to the databaseSean Griffin2014-06-291-16/+0
|
* Detect in-place changes on point typesSean Griffin2014-06-171-1/+5
|
* Merge pull request #15778 from sgrif/sg-pg-mutable-arraysMatthew Draper2014-06-181-28/+0
|\ | | | | Move pg array database type casting to the Array type
| * Move array database type casting to the Array typeSean Griffin2014-06-171-28/+0
| | | | | | | | | | | | | | | | | | The case where we have a column object, but don't have a type cast method involves type casting the default value when changing the schema. We get one of the column definition structs instead. That is a case that I'm trying to remove overall, but in the short term, we can achieve the same behavior without needing to pass the adapter to the array type by creating a fake type that proxies to the adapter.
* | Don't assume that Hstore columns have always changedSean Griffin2014-06-171-1/+1
|/ | | | | | | | | HStore columns come back from the database separated by a comma and a space, not just a comma. We need to mirror that behavior since we compare the two values. Also adds a regression test against JSON to ensure we don't have the same bug there.
* Inline PG array type casting helperSean Griffin2014-06-101-12/+0
|
* Rename `type_cast` to `type_cast_from_database`Sean Griffin2014-06-091-1/+1
| | | | | | | | In some cases there is a difference between the two, we should always be doing one or the other. For convenience, `type_cast` is still a private method on type, so new types that do not need different behavior don't need to implement two methods, but it has been moved to private so it cannot be used accidentally.
* pg, inline casting methods into `OID::Type` objects.Yves Senn2014-06-021-31/+0
| | | | | | | | This inlines casting for the most obvious types. The rest will follow eventually. I need to put some tests in place, to make sure that the inlining is not causing regressions. /cc @sgrif
* Inline type cast method for PG pointsSean Griffin2014-05-231-7/+0
|
* Have Postgres OID types inherit from general typesSean Griffin2014-05-201-13/+0
| | | | | Using general types where possible. Several more can go away once infinity gets figured out.
* pg, add missing nodocs for extracted modules.Yves Senn2014-05-191-1/+1
|
* Methods of these modules are internalRafael Mendonça França2014-05-141-13/+13
| | | | | They should not be used on people application so they should not be present on the API documentation.
* introduce AR::ConnectionAdapters::PostgreSQL for sharing modules (with AR-JDBC)kares2014-05-141-1/+1
| | | ... 'shared' OID, ArrayParser and Cast helpers, also re-arranged Column's dependencies
* Merge branch '4-1-0-beta2'Rafael Mendonça França2014-02-181-1/+5
|\ | | | | | | | | | | Conflicts: actionview/CHANGELOG.md activerecord/CHANGELOG.md
| * Correctly escape PostgreSQL arrays.Aaron Patterson2014-02-181-1/+5
| | | | | | | | | | | | Thanks Godfrey Chan for reporting this! Fixes: CVE-2014-0080
* | Resolve encoding issues with arrays of hstore (bug 11135).Josh Goodall2014-02-171-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We didn't have enough encoding for the wire protocol to store an array of hstore types. So, further encode any hstore that is an array member. Whilst we're here, ensure it's an HashWithIndifferentAccess being returned, to be consistent with other serialized forms, and add testing for arrays of hstore. So now the following migration: enable_extension "hstore" create_table :servers do |t| t.string :name t.hstore :interfaces, array: true end produces a model that can used like this, to store an array of hashes: server = Server.create(name: "server01", interfaces: [ { name: "bge0", ipv4: "192.0.2.2", state: "up" }, { name: "de0", state: "disabled", by: "misha" }, { name: "fe0", state: "up" }, ]) More at http://inopinatus.org/2013/07/12/using-arrays-of-hstore-with-rails-4/
* | fix quoting non-stringsDamien Mathieu2013-12-221-1/+1
|/ | | | Closes #13444
* Drop unused param `should_be_quoted` to `PostgreSQLColumn#array_to_string`Vipul A M2013-11-171-1/+1
|
* Use infinity constKonstantin Shabanov2013-08-221-2/+2
|
* Rescue invalid ip address exceptions on assign.Paul Nikitochkin2013-08-141-1/+5
| | | | In order that set attribute should not be bang method
* Fix multidimensional PG arrays containing non-string itemsYves Senn2013-08-071-1/+9
|
* Support array as root element in JSONAlexey Noskov2013-05-141-1/+1
|
* Fix #7619. 0x prefix must be added when assigning hexadecimal string into ↵kennyj2013-04-171-2/+4
| | | | bit column in Postgresql, because solving ambiguity.
* Add OID::Bit for supporting bit string.kennyj2013-04-161-0/+7
|
* Make Postgres point type correspond to ruby array with two floats insideMartin Schürrer2013-03-251-0/+11
|
* Fix regex to strip quotations from hstore valuesjlxw2013-03-231-2/+2
| | | | Previously regex did not strip quotation marks where hstore values were multi-line strings.
* Add postgresql range types supportbUg2013-01-231-30/+6
|
* AR supporting new int4range and int8range data type on PostgreSQL >= 9.2. ↵Alexey2012-12-171-4/+11
| | | | Fix realization
* AR supporting new intrange data type on PostgreSQL >= 9.2Alexey2012-12-161-0/+23
|
* Fix postgresql adapter to handle bc timestamps correctlyBogdan Gusiev2012-11-211-0/+2
|
* Moves column dump specific code to a module included in AbstractAdapterDan McClain2012-09-141-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having column related schema dumper code in the AbstractAdapter. The code remains the same, but by placing it in the AbstractAdapter, we can then overwrite it with Adapter specific methods that will help with Adapter specific data types. The goal of moving this code here is to create a new migration key for PostgreSQL's array type. Since any datatype can be an array, the goal is to have ':array => true' as a migration option, turning the datatype into an array. I've implemented this in postgres_ext, the syntax is shown here: https://github.com/dockyard/postgres_ext#arrays Adds array migration support Adds array_test.rb outlining the test cases for array data type Adds pg_array_parser to Gemfile for testing Adds pg_array_parser to postgresql_adapter (unused in this commit) Adds schema dump support for arrays Adds postgres array type casting support Updates changelog, adds note for inet and cidr support, which I forgot to add before Removing debugger, Adds pg_array_parser to JRuby platform Removes pg_array_parser requirement, creates ArrayParser module used by PostgreSQLAdapter
* ActiveRecord support to PostgreSQL 9.2 JSON typeDickson S. Guedes2012-09-051-0/+16
| | | | | | | | | This implements the support to encode/decode JSON data to/from database and creating columns of type JSON using a native type [1] supported by PostgreSQL from version 9.2. [1] http://www.postgresql.org/docs/9.2/static/datatype-json.html
* Modularize postgresql adapterKonstantin Shabanov2012-09-051-0/+80