Sha256: 3c3df2da5adc22693d3f732cca116dc07fb807f0882e2fb947844b2af468d3d5

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

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

module FluentQuery
    module Queries
    
         ##
         # Prepared query.
         #
         
         class Prepared < FluentQuery::Queries::Abstract
            
            ##
            # Holds query in prepared form.
            #
            
            @query

            ##
            # Constructor.
            #

            public
            def initialize(connection, query)
                super(connection)
                @query = @connection.driver.prepare(query)
            end
            
            ##
            # Builds prepared query string to final form.
            #
            
            public
            def build(*args)
                [@query, 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

2 entries across 2 versions & 1 rubygems

Version Path
fluent-query-0.9.5 lib/fluent-query/queries/prepared.rb
fluent-query-0.9.3 lib/fluent-query/queries/prepared.rb