rails/activerecord/test/config.example.yml
Rafael Mendonça França 1ba87a80b6
Make we always type cast TimeWithZone objects before passing to mysql2
mysql2 knows how to handle Time and Date objects but doesn't know
about TimeWithZone. This was causing failures when prepared statements
were enabled since we were passing TimeWithZone objects that mysql2 didn't
know how to deal with.

An new environment variable to enable prepared statements were added to
config.example.yml, so we can test in our CI and prevent regressions.

Fixes #41368.
2021-02-11 22:45:14 +00:00

98 lines
2.3 KiB
YAML

default_connection: <%= defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3' %>
connections:
jdbcderby:
arunit: activerecord_unittest
arunit2: activerecord_unittest2
jdbch2:
arunit: activerecord_unittest
arunit2: activerecord_unittest2
jdbchsqldb:
arunit: activerecord_unittest
arunit2: activerecord_unittest2
jdbcmysql:
arunit:
username: rails
encoding: utf8
arunit2:
username: rails
encoding: utf8
jdbcpostgresql:
arunit:
username: <%= ENV['user'] || 'rails' %>
arunit2:
username: <%= ENV['user'] || 'rails' %>
jdbcsqlite3:
arunit:
database: <%= FIXTURES_ROOT %>/fixture_database.sqlite3
timeout: 5000
arunit2:
database: <%= FIXTURES_ROOT %>/fixture_database_2.sqlite3
timeout: 5000
mysql2:
arunit:
username: rails
encoding: utf8mb4
collation: utf8mb4_unicode_ci
<% if ENV['MYSQL_PREPARED_STATEMENTS'] %>
prepared_statements: true
<% end %>
<% if ENV['MYSQL_HOST'] %>
host: <%= ENV['MYSQL_HOST'] %>
<% end %>
arunit2:
username: rails
encoding: utf8mb4
collation: utf8mb4_general_ci
<% if ENV['MYSQL_PREPARED_STATEMENTS'] %>
prepared_statements: true
<% end %>
<% if ENV['MYSQL_HOST'] %>
host: <%= ENV['MYSQL_HOST'] %>
<% end %>
oracle:
arunit:
adapter: oracle_enhanced
database: <%= ENV['ARUNIT_DB_NAME'] || 'orcl' %>
username: <%= ENV['ARUNIT_USER_NAME'] || 'arunit' %>
password: <%= ENV['ARUNIT_PASSWORD'] || 'arunit' %>
emulate_oracle_adapter: true
arunit2:
adapter: oracle_enhanced
database: <%= ENV['ARUNIT_DB_NAME'] || 'orcl' %>
username: <%= ENV['ARUNIT2_USER_NAME'] || 'arunit2' %>
password: <%= ENV['ARUNIT2_PASSWORD'] || 'arunit2' %>
emulate_oracle_adapter: true
postgresql:
arunit:
min_messages: warning
arunit_without_prepared_statements:
min_messages: warning
prepared_statements: false
arunit2:
min_messages: warning
sqlite3:
arunit:
database: <%= FIXTURES_ROOT %>/fixture_database.sqlite3
timeout: 5000
arunit2:
database: <%= FIXTURES_ROOT %>/fixture_database_2.sqlite3
timeout: 5000
sqlite3_mem:
arunit:
adapter: sqlite3
database: ':memory:'
arunit2:
adapter: sqlite3
database: ':memory:'