Sha256: e7f9224068fc189919f90e61af312ab3c7a8e460d68d20c62c3277f390987e28

Contents?: true

Size: 424 Bytes

Versions: 4

Compression:

Stored size: 424 Bytes

Contents

module Cucumber
  module ThinkingSphinx
    module SqlLogger
      IGNORED_SQL = [
        /^PRAGMA/, /^SELECT currval/, /^SELECT CAST/, /^SELECT @@IDENTITY/,
        /^SELECT @@ROWCOUNT/, /^SHOW FIELDS/
      ]

      def log(sql, name = 'SQL', binds = [])
        $queries_executed ||= []
        $queries_executed << sql unless IGNORED_SQL.any? { |r| sql =~ r }
        super sql, name, binds
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
thinking-sphinx-2.0.11 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-2.0.10 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-2.0.9 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-2.0.8 lib/cucumber/thinking_sphinx/sql_logger.rb