Class: Flydata::Source::SyncGenerateTableDdl

Inherits:
Component
  • Object
show all
Defined in:
lib/flydata/source/sync_generate_table_ddl.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, dp, options) ⇒ SyncGenerateTableDdl

Returns a new instance of SyncGenerateTableDdl.



13
14
15
16
# File 'lib/flydata/source/sync_generate_table_ddl.rb', line 13

def initialize(source, dp, options)
  super(source, options)
  @dp = dp
end

Instance Attribute Details

#dpObject (readonly)

Returns the value of attribute dp.



17
18
19
# File 'lib/flydata/source/sync_generate_table_ddl.rb', line 17

def dp
  @dp
end

Class Method Details

.inherited(child_class) ⇒ Object



9
10
11
# File 'lib/flydata/source/sync_generate_table_ddl.rb', line 9

def self.inherited(child_class)
  Source.register(child_class, self)
end

Instance Method Details

#generate_flydata_tabledef(tables, options) ⇒ Object

Public Interface: Generate FlyData table definitions for given tables

tables - An array of table names options - A hash of options

Returns flydata_tabledefs, errors

flydata_tablesdefs - An array of FlyData tabledefs
errors - An array of error hashes for tables whose tabledef generation failed


37
38
39
# File 'lib/flydata/source/sync_generate_table_ddl.rb', line 37

def generate_flydata_tabledef(tables, options)
  raise UnsupportedSourceError,  "subclass must implement"
end

#run_compatibility_checkObject

Public Interface: Run compatibility check

Run whatever check (compatibility, connectivity, privilege, etc) to ensure that the ‘sync:generate_table_ddl’ command can run without an issue.

Raises exception when check fails



25
26
27
# File 'lib/flydata/source/sync_generate_table_ddl.rb', line 25

def run_compatibility_check
  raise UnsupportedSourceError,  "subclass must implement"
end