Method: Sip::Sipper#create_scripts

Defined in:
lib/sip/sipper.rb

#create_scripts(dbconf, tableconf) ⇒ Object

return number of scripts created



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/sip/sipper.rb', line 22

def create_scripts(dbconf, tableconf)
  @scripts = []
  db = DBBase.make_interface dbconf['type'], dbconf, self

  # set default columns if necessary
  tableconf['columns'] = db.columns(tableconf['tablename']).map { |c| c.first } if tableconf['columns'].nil?

  if tableconf['incremental_index'].nil?
    create_script_without_index(dbconf, tableconf, db)
  else
    create_scripts_with_index(dbconf, tableconf, db)
  end

  @scripts.length
end