Class: ArJdbc::Tasks::MSSQLDatabaseTasks

Inherits:
JdbcDatabaseTasks show all
Defined in:
lib/arjdbc/tasks/mssql_database_tasks.rb

Instance Attribute Summary

Attributes inherited from JdbcDatabaseTasks

#configuration

Instance Method Summary collapse

Methods inherited from JdbcDatabaseTasks

#charset, #collation, #create, #drop, #expand_path, #initialize, #resolve_database, #resolve_database_from_url

Constructor Details

This class inherits a constructor from ArJdbc::Tasks::JdbcDatabaseTasks

Instance Method Details

#purgeObject



7
8
9
10
11
12
13
# File 'lib/arjdbc/tasks/mssql_database_tasks.rb', line 7

def purge
  test = deep_dup(configuration)
  test_database = resolve_database(test)
  test['database'] = 'master'
  establish_connection(test)
  connection.recreate_database!(test_database)
end

#structure_dump(filename) ⇒ Object



15
16
17
18
# File 'lib/arjdbc/tasks/mssql_database_tasks.rb', line 15

def structure_dump(filename)
  config = config_from_url_if_needed
  `smoscript -s #{config['host']} -d #{config['database']} -u #{config['username']} -p #{config['password']} -f #{filename} -A -U`
end

#structure_load(filename) ⇒ Object



20
21
22
23
# File 'lib/arjdbc/tasks/mssql_database_tasks.rb', line 20

def structure_load(filename)
  config = config_from_url_if_needed
  `sqlcmd -S #{config['host']} -d #{config['database']} -U #{config['username']} -P #{config['password']} -i #{filename}`
end