Sha256: 32099e300ad1e175ee99d9e7889c3494be7a86c0090aa7bc4828eb32ba38acc2

Contents?: true

Size: 1003 Bytes

Versions: 44

Compression:

Stored size: 1003 Bytes

Contents

require 'flydata/source/sync_generate_table_ddl'
require 'flydata/source_mysql/mysql_compatibility_check'
require 'flydata-core/mysql/command_generator'

module Flydata
module SourceMysql

class SyncGenerateTableDdl < Source::SyncGenerateTableDdl
  def run_compatibility_check
    MysqlCompatibilityCheck.new(dp, de['mysql_data_entry_preference']).check
    if `which mysqldump`.empty?
      raise "mysqldump is not installed.  mysqldump is required to run the command"
    end
    %w(host username database).each do |conf_name|
      raise "MySQL `#{conf_name}` is neither defined in the data entry nor the local config file" if de['mysql_data_entry_preference'][conf_name].to_s.empty?
    end
  end

  private

  def data_source_type_display_name
    "MySQL database"
  end

  def data_entry_prefs
    de['mysql_data_entry_preference']
  end

  def each_source_tabledef(tables, options, &block)
    FlydataCore::Mysql::CommandGenerator.each_mysql_tabledef(tables, options, &block) 
  end
end

end
end

Version data entries

44 entries across 44 versions & 1 rubygems

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