lib/slacker.rb
def query_script(example, sql, log_name=nil)
      log_name ||= 'Run SQL Script'

      debuggable_sql = SqlPreprocessor.debuggable_sql(sql)
      executable_sql = SqlPreprocessor.executable_sql(sql, example)

      example.metadata[:sql] += ((example.metadata[:sql] == '' ? '' : "\n\n") + "-- #{log_name.split(/\r\n|\n/).join("\n-- ")}\n#{debuggable_sql}")
      application.query_script(executable_sql)
    end
# Run a SQL query against an example
Run a SQL query against an example
Run a SQL query against an example
def query_script(example, sql, log_name=nil)
      log_name ||= 'Run SQL Script'
      debuggable_sql = SqlPreprocessor.debuggable_sql(sql)
      executable_sql = SqlPreprocessor.executable_sql(sql, example)
      example.metadata[:sql] += ((example.metadata[:sql] == '' ? '' : "\n\n") + "-- #{log_name.split(/\r\n|\n/).join("\n-- ")}\n#{debuggable_sql}")
      application.query_script(executable_sql)
    end
def query_script ( example , sql , log_name = nil ) log_name ||= 'Run SQL Script' debuggable_sql = SqlPreprocessor . debuggable_sql ( sql ) executable_sql = SqlPreprocessor . executable_sql ( sql , example ) example . metadata [ :sql ] += ( ( example . metadata [ :sql ] == '' ? '' : "\n\n" ) + "-- #{log_name.split(/\r\n|\n/).join("\n-- ")}\n#{debuggable_sql}" ) application . query_script ( executable_sql ) end
Run a SQL query against an example
Run a SQL query against an example
example
sql
log_name