Sha256: 76ef220d5aa7c87b4e8413fef657721a849fe32bac2f5c450c571c430a20e4e0

Contents?: true

Size: 597 Bytes

Versions: 21

Compression:

Stored size: 597 Bytes

Contents

require 'mysql2'
require 'flydata-core/mysql/config'

module Flydata
  module SourceMysql
    module MysqlAccessible
      def initialize(conf)
        @conf = conf
        @mysql_db_opts = build_mysql_db_opts(conf)
      end

      def exec_mysql_query(query)
        cli = mysql_client
        cli.query(query)
      ensure
        if cli
          cli.close rescue nil
        end
      end

      def build_mysql_db_opts(conf)
        FlydataCore::Mysql::Config.build_mysql_db_opts(conf)
      end

      def mysql_client
        Mysql2::Client.new(@mysql_db_opts)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
flydata-0.8.10.2 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.10.1 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.9.11 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.10 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.9 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.8 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.7 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.6 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.5 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.4 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.3 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.2 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.1 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.8.0 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.7.19 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.7.18 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.7.17 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.7.16 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.7.15 lib/flydata/source_mysql/mysql_accessible.rb
flydata-0.7.14 lib/flydata/source_mysql/mysql_accessible.rb