Merge pull request #62 from spectator/seamless_database_pool
Seamless database pool adapter
This commit is contained in:
commit
75a63d77d1
6
Gemfile
6
Gemfile
|
@ -14,6 +14,7 @@ group :test do
|
|||
gem "mysql2", "~> 0.3.0"
|
||||
gem "pg", "~> 0.9"
|
||||
gem "sqlite3-ruby", "~> 1.3.1"
|
||||
gem "seamless_database_pool", "~> 1.0.11"
|
||||
end
|
||||
|
||||
platforms :jruby do
|
||||
|
@ -24,7 +25,7 @@ group :test do
|
|||
# Support libs
|
||||
gem "factory_girl", "~> 1.3.3"
|
||||
gem "delorean", "~> 0.2.0"
|
||||
|
||||
|
||||
# Debugging
|
||||
platforms :mri_18 do
|
||||
gem "ruby-debug", "= 0.10.4"
|
||||
|
@ -36,7 +37,6 @@ group :test do
|
|||
end
|
||||
|
||||
platforms :mri_19 do
|
||||
# TODO: Remove the conditional when ruby-debug19 supports Ruby >= 1.9.3
|
||||
gem "ruby-debug19" if RUBY_VERSION < "1.9.3"
|
||||
gem "debugger"
|
||||
end
|
||||
end
|
||||
|
|
25
Gemfile.lock
25
Gemfile.lock
|
@ -16,11 +16,17 @@ GEM
|
|||
activesupport (3.2.7)
|
||||
i18n (~> 0.6)
|
||||
multi_json (~> 1.0)
|
||||
archive-tar-minitar (0.5.2)
|
||||
arel (3.0.2)
|
||||
builder (3.0.0)
|
||||
chronic (0.7.0)
|
||||
columnize (0.3.6)
|
||||
debugger (1.2.0)
|
||||
columnize (>= 0.3.1)
|
||||
debugger-linecache (~> 1.1.1)
|
||||
debugger-ruby_core_source (~> 1.1.3)
|
||||
debugger-linecache (1.1.2)
|
||||
debugger-ruby_core_source (>= 1.1.1)
|
||||
debugger-ruby_core_source (1.1.3)
|
||||
delorean (0.2.1)
|
||||
chronic
|
||||
factory_girl (1.3.3)
|
||||
|
@ -36,8 +42,6 @@ GEM
|
|||
json (1.7.4-java)
|
||||
linecache (0.46)
|
||||
rbx-require-relative (> 0.0.4)
|
||||
linecache19 (0.5.12)
|
||||
ruby_core_source (>= 0.1.4)
|
||||
multi_json (1.3.6)
|
||||
mysql (2.8.1)
|
||||
mysql2 (0.3.11)
|
||||
|
@ -52,16 +56,8 @@ GEM
|
|||
ruby-debug-base (0.10.4)
|
||||
linecache (>= 0.3)
|
||||
ruby-debug-base (0.10.4-java)
|
||||
ruby-debug-base19 (0.11.25)
|
||||
columnize (>= 0.3.1)
|
||||
linecache19 (>= 0.5.11)
|
||||
ruby_core_source (>= 0.1.4)
|
||||
ruby-debug19 (0.11.6)
|
||||
columnize (>= 0.3.1)
|
||||
linecache19 (>= 0.5.11)
|
||||
ruby-debug-base19 (>= 0.11.19)
|
||||
ruby_core_source (0.1.5)
|
||||
archive-tar-minitar (>= 0.5.2)
|
||||
seamless_database_pool (1.0.11)
|
||||
activerecord (>= 2.2.2)
|
||||
sqlite3 (1.3.6)
|
||||
sqlite3-ruby (1.3.3)
|
||||
sqlite3 (>= 1.3.3)
|
||||
|
@ -74,6 +70,7 @@ PLATFORMS
|
|||
DEPENDENCIES
|
||||
activerecord (~> 3.0)
|
||||
activerecord-jdbcmysql-adapter
|
||||
debugger
|
||||
delorean (~> 0.2.0)
|
||||
factory_girl (~> 1.3.3)
|
||||
jdbc-mysql
|
||||
|
@ -84,5 +81,5 @@ DEPENDENCIES
|
|||
rake
|
||||
ruby-debug (= 0.10.4)
|
||||
ruby-debug-base (= 0.10.4)
|
||||
ruby-debug19
|
||||
seamless_database_pool (~> 1.0.11)
|
||||
sqlite3-ruby (~> 1.3.1)
|
||||
|
|
2
Rakefile
2
Rakefile
|
@ -36,7 +36,7 @@ namespace :display do
|
|||
end
|
||||
task :default => ["display:notice"]
|
||||
|
||||
ADAPTERS = %w(mysql mysql2 jdbcmysql postgresql sqlite3)
|
||||
ADAPTERS = %w(mysql mysql2 jdbcmysql postgresql sqlite3 seamless_database_pool)
|
||||
ADAPTERS.each do |adapter|
|
||||
namespace :test do
|
||||
desc "Runs #{adapter} database tests."
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
require "seamless_database_pool"
|
||||
require "active_record/connection_adapters/seamless_database_pool_adapter"
|
||||
require "activerecord-import/adapters/mysql_adapter"
|
||||
|
||||
class ActiveRecord::ConnectionAdapters::SeamlessDatabasePoolAdapter
|
||||
include ActiveRecord::Import::MysqlAdapter
|
||||
end
|
|
@ -1 +1 @@
|
|||
ENV["ARE_DB"] = "mysql2"
|
||||
ENV["ARE_DB"] = "mysql2"
|
||||
|
|
1
test/adapters/seamless_database_pool.rb
Normal file
1
test/adapters/seamless_database_pool.rb
Normal file
|
@ -0,0 +1 @@
|
|||
ENV["ARE_DB"] = "seamless_database_pool"
|
|
@ -13,6 +13,13 @@ mysql2:
|
|||
<<: *common
|
||||
adapter: mysql2
|
||||
|
||||
seamless_database_pool:
|
||||
<<: *common
|
||||
adapter: seamless_database_pool
|
||||
pool_adapter: mysql2
|
||||
master:
|
||||
host: localhost
|
||||
|
||||
postgresql:
|
||||
<<: *common
|
||||
username: postgres
|
||||
|
|
Loading…
Reference in a new issue