Skip to content

Commit

Permalink
Add support for Trilogy
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane authored and pat committed Mar 29, 2024
1 parent b3bf79a commit c2b32b2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
ruby: [ '2.6', '2.7', '3.0', '3.1', '3.2', '3.3' ]
bundler: [ '1.17.3', '2.3.12' ]
database: [ 'mysql2', 'postgresql', 'sqlite3' ]
database: [ 'mysql2', 'postgresql', 'sqlite3', 'trilogy' ]
exclude:
- ruby: '2.6'
bundler: '2.3.12'
Expand All @@ -25,6 +25,10 @@ jobs:
bundler: '1.17.3'
- ruby: '3.3'
bundler: '1.17.3'
- ruby: '2.6'
database: 'trilogy'
- ruby: '2.7'
database: 'trilogy'

services:
postgres:
Expand Down
5 changes: 5 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if RUBY_VERSION.to_f >= 2.5 && RUBY_VERSION.to_f < 3.1
gem "rails", "~> 6.0.0"
gem "mysql2", "~> 0.5.0"
gem "sqlite3", "~> 1.4", "< 1.5.0"
gem "activerecord-trilogy-adapter", "~> 3.1"
end
end

Expand All @@ -32,6 +33,7 @@ if RUBY_VERSION.to_f >= 2.5
gem "rails", "~> 6.1.0"
gem "mysql2", "~> 0.5.0"
gem "sqlite3", "~> 1.4", "< 1.6.0"
gem "activerecord-trilogy-adapter", "~> 3.1"
end
end

Expand All @@ -40,12 +42,14 @@ if RUBY_VERSION.to_f >= 2.7
gem "rails", "~> 7.0.1"
gem "mysql2", "~> 0.5.0"
gem "sqlite3", "~> 1.4"
gem "activerecord-trilogy-adapter", "~> 3.1"
end

appraise "rails-7.1" do
gem "rails", "~> 7.1.2"
gem "mysql2", "~> 0.5.0"
gem "sqlite3", "~> 1.4"
gem "trilogy", "~> 2.7"
end
end

Expand All @@ -54,5 +58,6 @@ if RUBY_VERSION.to_f >= 3.1
gem "rails", :git => "https://github.com/rails/rails.git", :branch => "main"
gem "mysql2", "~> 0.5.0"
gem "sqlite3", "~> 1.4"
gem "trilogy", "~> 2.7"
end
end
2 changes: 1 addition & 1 deletion lib/combustion/database/reset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Combustion::Database::Reset
UnsupportedDatabase = Class.new StandardError

OPERATOR_PATTERNS = {
Combustion::Databases::MySQL => [/mysql/],
Combustion::Databases::MySQL => [/mysql/, /trilogy/],
Combustion::Databases::PostgreSQL => [/postgres/, /postgis/],
Combustion::Databases::SQLite => [/sqlite/],
Combustion::Databases::SQLServer => [/sqlserver/],
Expand Down
2 changes: 2 additions & 0 deletions lib/combustion/databases/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def error_class
ArJdbcMySQL::Error
elsif configuration[:adapter][/mysql2/] && defined?(Mysql2)
Mysql2::Error
elsif configuration[:adapter][/trilogy/] && defined?(Trilogy)
Trilogy::Error
else
Mysql::Error
end
Expand Down

0 comments on commit c2b32b2

Please sign in to comment.