Sha256: a24eaf05a74dbffced7cbbbc44207aeb790a99ffd32bf168f8bffa5329568744

Contents?: true

Size: 666 Bytes

Versions: 3

Compression:

Stored size: 666 Bytes

Contents

require 'legion/data/connections/mysql_base'

module Legion
  module Data
    module Connections
      class MySQL < Legion::Data::Connections::MySQLBase
        attr_accessor :connection
        def initialize(_options = {})
          Legion::Logging.debug('Connecting to MySQL with MySQL2 Connector')
          @connection = connect

          Legion::Logging.info("Legion is connected to database #{Legion::Settings[:data][:mysql][:database]}")
          Legion::Settings[:data][:connected] = true
        end

        def adapter
          'mysql2'
        end

        def connect
          super(adapter, creds_builder)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
legion-data-0.2.0 lib/legion/data/connections/mysql.rb
legion-data-0.1.1 lib/legion/data/connections/mysql.rb
legion-data-0.1.0 lib/legion/data/connections/mysql.rb