Sha256: 82801f48c6f679ebf062c2331222909d6a5c721521203f2c574acbf931c1d379

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

# encoding: utf-8
require "fluent-query/queries/abstract"

module FluentQuery
    module Queries
    
         ##
         # Compiled query.
         #
         
         class Compiled < FluentQuery::Queries::Abstract
            
            ##
            # Holds query in compiled form.
            #
            
            @raw
            attr_accessor :raw

            ##
            # Constructor.
            #

            public
            def initialize(connection, query)
                super(connection)
                @raw = query.processor.compile(@connection.driver.build_query(query, :compile))
            end
            
            ##
            # Builds prepared query string to final form.
            #
            
            public
            def build(*args)
                @raw.complete(*args)
            end
            
            ##
            # Returns all selected rows ordered according to datafield from it.
            #

            public
            def assoc(specification, *args)
                self.execute(*args).assoc(specification)
            end
            
        end
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fluent-query-0.9.5 lib/fluent-query/queries/compiled.rb
fluent-query-0.9.3 lib/fluent-query/queries/compiled.rb
fluent-query-0.9.1 lib/fluent-query/queries/compiled.rb
fluent-query-0.9.0 lib/fluent-query/queries/compiled.rb