Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seamless database pool adapter #62

Merged
merged 8 commits into from Aug 30, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Gemfile
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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 changes: 11 additions & 14 deletions Gemfile.lock
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -74,6 +70,7 @@ PLATFORMS
DEPENDENCIES
activerecord (~> 3.0)
activerecord-jdbcmysql-adapter
debugger
delorean (~> 0.2.0)
factory_girl (~> 1.3.3)
jdbc-mysql
Expand All @@ -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 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -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."
Expand Down
@@ -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
2 changes: 1 addition & 1 deletion test/adapters/mysql2.rb
@@ -1 +1 @@
ENV["ARE_DB"] = "mysql2"
ENV["ARE_DB"] = "mysql2"
1 change: 1 addition & 0 deletions test/adapters/seamless_database_pool.rb
@@ -0,0 +1 @@
ENV["ARE_DB"] = "seamless_database_pool"
7 changes: 7 additions & 0 deletions test/database.yml.sample
Expand Up @@ -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
Expand Down