Sha256: a7e4107ee86d83b9a8518ba1f6845da2f2fbea319dadf2a12d3a00082d238b6a

Contents?: true

Size: 473 Bytes

Versions: 9

Compression:

Stored size: 473 Bytes

Contents

# frozen_string_literal: true

require "mini_sql/abstract/prepared_cache"

module MiniSql
  module Postgres
    class PreparedCache < ::MiniSql::Abstract::PreparedCache

      private

      def alloc(sql)
        alloc_key = next_key
        @connection.prepare(alloc_key, sql)

        alloc_key
      end

      def dealloc(key)
        @connection.query "DEALLOCATE #{key}" if @connection.status == PG::CONNECTION_OK
      rescue PG::Error
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mini_sql-1.6.0 lib/mini_sql/postgres/prepared_cache.rb
mini_sql-1.5.0 lib/mini_sql/postgres/prepared_cache.rb
mini_sql-1.4.0 lib/mini_sql/postgres/prepared_cache.rb
mini_sql-1.3.0 lib/mini_sql/postgres/prepared_cache.rb
mini_sql-1.2.0 lib/mini_sql/postgres/prepared_cache.rb
mini_sql-1.1.3 lib/mini_sql/postgres/prepared_cache.rb
mini_sql-1.1.2 lib/mini_sql/postgres/prepared_cache.rb
mini_sql-1.1.1 lib/mini_sql/postgres/prepared_cache.rb
mini_sql-1.1.0 lib/mini_sql/postgres/prepared_cache.rb