aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* tests are responsible to clean up afterwards.Yves Senn2014-02-131-82/+114
| | | | | remove created state after test execution, not before the next test. This prevents the leak of the `ex` table outside of a single test.
* used user-defined configurations for running tests that might depend on ↵Kuldeep Aggarwal2013-12-291-1/+2
| | | | user's system configuration
* Tell how to Create a Database in Error Messageschneems2013-12-231-0/+7
| | | | | | | | | | | | | | | | Currently if you attempt to use a database that does not exist you get an error: ``` PG::ConnectionBad FATAL: database "db_error" does not exist ``` The solution is easy, create and migrate your database however new developers may not know these commands by memory. Instead of requiring the developer to search for a solution, tell them how to fix the problem in the error message: ``` ActiveRecord::NoDatabase: FATAL: database "db_error" does not exist Run `$ bin/rake db:create db:migrate` to create your database ``` Active Record should not know about `rake db:migrate` so this additional information needs to come from the railtie. Potential alternative implementation suggestions are welcome.
* Fix PostgreSQL insert to properly extract table name from multiline string SQL.Kuldeep Aggarwal2013-12-191-0/+12
| | | | | | | | | | | | Previously, executing an insert SQL in PostgreSQL with a command like this: insert into articles( number) values( 5152 ) would not work because the adapter was unable to extract the correct articles table name.
* Remove deprecated SchemaStatements#distinctFrancesco Rodriguez2013-07-021-46/+0
|
* Merge pull request #10556 from Empact/deprecate-schema-statements-distinctRafael Mendonça França2013-05-121-12/+24
| | | | | | Deprecate SchemaStatements#distinct, and make SchemaStatements#columns_for_distinct nodoc. Conflicts: activerecord/CHANGELOG.md
* Fix that #exists? can produce invalid SQL: "SELECT DISTINCT DISTINCT"Ben Woosley2013-05-101-0/+34
| | | | | | | | | | | | The combination of a :uniq => true association and the #distinct call in #construct_limited_ids_condition combine to create invalid SQL, because we're explicitly selecting DISTINCT, and also sending #distinct on to AREL, via the relation#distinct_value. Rather than build a select distinct clause in #construct_limited_ids_condition, I set #distinct! and pass just the columns into the select statement. This requires introducing a #columns_for_distinct method to return the select columns but not the statement itself.
* Created a layer of abstraction for the valid type checking in schema dumper. ↵Ranjay Krishna2013-03-251-0/+9
| | | | Now, connection handles the check for valid types so that each database can handle the changes individually.
* Wrong exception is occured when raising no translatable exceptionkennyj2013-03-011-0/+6
|
* Revert "checking in the abstractions for valid type checking:"Jon Leighton2013-02-151-9/+0
| | | | | | | | | | | | | | | | This reverts commit c321b309a9a90bbfa0912832c11b3fef52e71840. Conflicts: activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb Reason: failing test 1) Error: test_valid_column(ActiveRecord::ConnectionAdapters::SQLite3AdapterTest): NoMethodError: undefined method `column' for test/cases/adapters/sqlite3/sqlite3_adapter_test.rb:29:in `test_valid_column'
* checking in the abstractions for valid type checking:Ranjay Krishna2013-02-121-0/+9
|
* Refactoring, testing and documenting pg_connection.distinctSemyon Perepelitsa2012-11-211-0/+29
|
* PostgreSQL, quote table names when fetching the primary key. Closes #5920Yves Senn2012-10-051-0/+4
|
* refactor configuration of insert_returningDoug Cole2012-04-071-19/+15
|
* pick better names and add a little documentationDoug Cole2012-04-011-8/+8
|
* improve test coverageDoug Cole2012-03-311-0/+26
|
* add use_returning as a postgresql connection configDoug Cole2012-03-311-0/+9
|
* Remove NULLS FIRST/LAST. closes #5152kennyj2012-02-251-0/+5
|
* Made schema dumper recognize partial indices' where statementsMarcelo Silveira2012-02-091-0/+6
|
* remove table quoting in primary_key methodPaul Gallagher2011-06-111-0/+30
| | | * add/cleanup tests
* apply private method indentation conventionPaul Gallagher2011-06-101-1/+1
| | | * tidy test code and fix my typo
* Improve PostgreSQL adapter schema-awarenessPaul Gallagher2011-06-101-0/+39
| | | | | | | * table_exists? scoped by schema search path unless schema is explicitly named. Added tests and doc to clarify the behaviour * extract_schema_and_table tests and implementation extended to cover all cases * primary_key does not ignore schema information * add current_schema and schema_exists? methods * more robust table referencing in insert_sql and sql_for_insert methods
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* use index based substitution for bind parametersAaron Patterson2011-04-131-3/+3
|
* wrap the pg_get_serial_sequence function and reuse it for the default ↵Aaron Patterson2011-04-111-0/+25
| | | | sequence name
* adding exec_insert for postgresqlAaron Patterson2011-04-111-1/+37
|
* renaming exec in the PG adapterAaron Patterson2010-11-051-9/+9
|
* bind substitution is working properlyAaron Patterson2010-10-261-0/+8
|
* bind parameters are now typecastAaron Patterson2010-10-261-0/+14
|
* basic bind parameters are workingAaron Patterson2010-10-261-0/+12
|
* initial exec() method is working in pg adapterAaron Patterson2010-10-261-0/+17
|
* Let's initialize instance variables in the postgres adapter.Aaron Patterson2010-07-141-0/+17