Sha256: d7593dbb14a1e15eb7cb76112d57cd3b1cb4cc7172c6e199245b8a9645ab6872

Contents?: true

Size: 546 Bytes

Versions: 17

Compression:

Stored size: 546 Bytes

Contents

# frozen_string_literal: true

module Ad
  module AgentArchitecture
    module Database
      class SQLQuery
        SQL_DIR = File.expand_path('../sql', __dir__)

        def self.query(sql_filename, params = {})
          sql_path = File.join(SQL_DIR, "#{sql_filename}.sql")

          # puts "SQL_DIR: #{SQL_DIR}"
          # puts "SQL Path: #{sql_path}"
          raise "SQL file not found: #{sql_path}" unless File.exist?(sql_path)

          sql = File.read(sql_path)
          DB.fetch(sql, params)
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ad-agent_architecture-0.0.24 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.23 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.22 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.21 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.20 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.19 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.18 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.17 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.16 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.15 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.14 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.13 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.12 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.11 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.10 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.9 lib/ad/agent_architecture/database/sql_query.rb
ad-agent_architecture-0.0.8 lib/ad/agent_architecture/database/sql_query.rb