Class: Flydata::SourcePostgresql::SyncGenerateTableDdl

Inherits:
Flydata::Source::SyncGenerateTableDdl show all
Defined in:
lib/flydata/source_postgresql/sync_generate_table_ddl.rb

Defined Under Namespace

Classes: TableMissingError

Instance Attribute Summary

Attributes inherited from Flydata::Source::SyncGenerateTableDdl

#dp

Instance Method Summary collapse

Methods inherited from Flydata::Source::SyncGenerateTableDdl

#generate_flydata_tabledef, inherited, #initialize

Methods inherited from Flydata::Source::Component

#initialize

Constructor Details

This class inherits a constructor from Flydata::Source::SyncGenerateTableDdl

Instance Method Details

#data_entry_prefsObject



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

def data_entry_prefs
  de['postgresql_data_entry_preference']
end

#data_source_type_display_nameObject



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

def data_source_type_display_name
  "PostgreSQL database"
end

#each_source_tabledef(tables, options, &block) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/flydata/source_postgresql/sync_generate_table_ddl.rb', line 21

def each_source_tabledef(tables, options, &block)
  # PostgreSQL options.
  tables = tables.clone
  missing_tables = []
  begin
    if tables.to_s == '' || tables.to_s == '[]'
      raise ArgumentError, "tables is nil or empty"
    end
    _each_tabledef(tables, options, &block)
  rescue TableMissingError => e
    tables.delete e.table
    missing_tables << e.table
    return missing_tables if tables.empty?
    retry
  end
  missing_tables
end

#run_compatibility_checkObject



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

def run_compatibility_check
  # do nothing for now
end