Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Added MariaDB Driver support
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Rzegocki committed Apr 24, 2016
1 parent 6118154 commit 197b7de
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ to do is create a layer and application with assigned RDS data source, then
## Support

* Database
* MariaDB
* MySQL
* PostgreSQL
* SCM
Expand Down Expand Up @@ -74,7 +75,7 @@ you don't need to use them. The chef will do all the job, and determine them
for you.

* `app['database']['adapter']`
* **Supported values:** `postgresql`, `mysql`
* **Supported values:** `mariadb`, `mysql`, `postgresql`
* **Default:** `postgresql`
* ActiveRecord adapter which will be used for database connection.
* `app['database']['username']`
Expand Down
2 changes: 1 addition & 1 deletion libraries/drivers_db_mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Drivers
module Db
class Mysql < Base
adapter :mysql2
allowed_engines :mysql, :mysql2
allowed_engines :mysql, :mysql2, :mariadb
packages debian: 'libmysqlclient-dev', rhel: 'mysql-devel'
end
end
Expand Down
12 changes: 6 additions & 6 deletions libraries/drivers_dsl_packages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ module Packages
def self.included(klass)
klass.instance_eval do
def packages(*to_support)
@packages ||= []
(to_support || []).each do |pkg|
@packages.push((pkg.is_a?(Hash) ? pkg : { all: pkg.to_s }).stringify_keys)
@packages ||= {}
Array.wrap(to_support).each do |pkg|
@packages = (pkg.is_a?(Hash) ? pkg : { all: Array.wrap(pkg).map(&:to_s) }).stringify_keys
end
@packages.uniq
@packages
end
end
end
Expand All @@ -19,8 +19,8 @@ def packages
end

def handle_packages(context)
packages.each do |pkg|
context.package(pkg.key?('all') ? pkg['all'] : pkg[node['platform_family']] || pkg[node['platform']]) do
Array.wrap(packages['all'] || packages[node['platform_family']] || packages[node['platform']]).each do |pkg|
context.package pkg do
action :install
end
end
Expand Down

0 comments on commit 197b7de

Please sign in to comment.