Class: Flydata::SourcePostgresql::SyncGenerateTableDdl
- Inherits:
-
Flydata::Source::SyncGenerateTableDdl
- Object
- Flydata::Source::Component
- Flydata::Source::SyncGenerateTableDdl
- Flydata::SourcePostgresql::SyncGenerateTableDdl
- 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
Instance Method Summary collapse
- #data_entry_prefs ⇒ Object
- #data_source_type_display_name ⇒ Object
- #each_source_tabledef(tables, options, &block) ⇒ Object
- #run_compatibility_check ⇒ Object
Methods inherited from Flydata::Source::SyncGenerateTableDdl
#generate_flydata_tabledef, inherited, #initialize
Methods inherited from Flydata::Source::Component
Constructor Details
This class inherits a constructor from Flydata::Source::SyncGenerateTableDdl
Instance Method Details
#data_entry_prefs ⇒ Object
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_name ⇒ Object
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 38 39 40 41 42 43 44 45 |
# File 'lib/flydata/source_postgresql/sync_generate_table_ddl.rb', line 21 def each_source_tabledef(tables, , &block) pg_opts = { host: ['host'], port: ['port'], dbname: ['database'], user: ['username'], password: ['password'], sslmode: :prefer, } # 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, , pg_opts, &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_check ⇒ Object
9 10 11 |
# File 'lib/flydata/source_postgresql/sync_generate_table_ddl.rb', line 9 def run_compatibility_check # do nothing for now end |