require 'flydata/source' require 'flydata/source/component' require 'flydata/source/errors' module Flydata module Source class SyncGenerateTableDdl < Component def self.inherited(child_class) Source.register(child_class, self) end def initialize(source, dp, options) super(source, options) @dp = dp end attr_reader :dp # 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 def run_compatibility_check raise UnsupportedSourceError, "subclass must implement" end # 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 def generate_flydata_tabledef(tables, options) raise UnsupportedSourceError, "subclass must implement" end end end end