Sha256: e9d20348d4a5aeacbafcb7ac6d2089442c650f75916ea5a6ca1f58cb5667dff1

Contents?: true

Size: 584 Bytes

Versions: 1

Compression:

Stored size: 584 Bytes

Contents

module ARTest
  module SQLServer

    module SqlCounterSqlserver

      # Only return the log vs. log_all
      def capture_sql_ss
        ActiveRecord::SQLCounter.clear_log
        yield
        ActiveRecord::SQLCounter.log.dup
      end

    end

    ignored_sql = [
      /INFORMATION_SCHEMA\.(TABLES|VIEWS|COLUMNS)/im,
      /SELECT @@version/,
      /SELECT @@TRANCOUNT/,
      /(BEGIN|COMMIT|ROLLBACK|SAVE) TRANSACTION/,
      /SELECT CAST\(.* AS .*\) AS value/,
      /SELECT DATABASEPROPERTYEX/im
    ]

    ActiveRecord::SQLCounter.ignored_sql.concat(ignored_sql)

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-jdbcsqlserver-adapter-50.1.0 test/support/sql_counter_sqlserver.rb