require 'kvm/log' module KVM module Db module Oracle def self.create_user(username, password) [ %Q(create user #{username} identified by "#{password}" default tablespace users), "grant connect, resource to #{username}", "grant create view to #{username}" ] end def self.drop_user(user) [ "drop user #{user} cascade" ] end def self.parse_sql(db, file) sql = File.read(file) # naively strip comments and split statements statements = sql.gsub(/^--.*$/, '').split(/^\/$/).map { |s| s.strip } end end end end