<commit_before># encoding: utf-8

module Veritas
  module Adapter
    class DataObjects

      # Executes generated SQL statements
      class Statement
        include Enumerable, Immutable

        # Initialize a statement
        #
        # @param [::DataObjects::Connection] connection
        #   the database connection
        # @param [Relation] relation
        #   the relation to generate the SQL from
        # @param [SQL::Generator::Relation] generator
        #   the object to generate the SQL with
        #
        # @return [undefined]
        #
        # @api private
        def initialize(connection, relation, generator)
          @connection = connection
          @relation   = relation
          @generator  = generator
        end

        # Iterate over each row in the results
        #
        # @example
        #   statement = Statement.new(connection, relation, generator)
        #   statement.each { |row| ... }
        #
        # @yield [row]
        #
        # @yieldparam [Array] row
        #   each row in the results
        #
        # @return [self]
        #
        # @api public
        def each
          return to_enum unless block_given?
          each_row(command.execute_reader) { |row| yield row }
          self
        end

        # Return the SQL query
        #
        # @return [String]
        #<commit_msg>Added missing YARD docs<commit_after># encoding: utf-8

module Veritas
  module Adapter
    class DataObjects

      # Executes generated SQL statements
      class Statement
        include Enumerable, Immutable

        # Initialize a statement
        #
        # @param [::DataObjects::Connection] connection
        #   the database connection
        # @param [Relation] relation
        #   the relation to generate the SQL from
        # @param [SQL::Generator::Relation] generator
        #   the object to generate the SQL with
        #
        # @return [undefined]
        #
        # @api private
        def initialize(connection, relation, generator)
          @connection = connection
          @relation   = relation
          @generator  = generator
        end

        # Iterate over each row in the results
        #
        # @example
        #   statement = Statement.new(connection, relation, generator)
        #   statement.each { |row| ... }
        #
        # @yield [row]
        #
        # @yieldparam [Array] row
        #   each row in the results
        #
        # @return [self]
        #
        # @api public
        def each
          return to_enum unless block_given?
          each_row(command.execute_reader) { |row| yield row }
          self
        end

        # Return the SQL query
        #
        # @example
        #   statement.to_s  # => SQL representation of the relation
        #
        # @return [String]
        #
{'fraction_non_alphanumeric': 0.07657182999648753, 'fraction_numerical': 0.0007024938531787847, 'mean_word_length': 1.5703971119133573, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1552416', 'n_tokens_mistral': 727, 'n_tokens_neox': 709, 'n_words': 226}