class CQL::Postgres::StatementCache

Overview

Least-recently-used map from SQL text to the statement the server holds for it. Entries over capacity are handed back for closing, never dropped silently, because the server keeps prepared statements until told to close.

Defined in:

postgres/statement_cache.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(capacity : Int32) #

[View source]

Instance Method Detail

def clear : Nil #

[View source]
def delete(sql : String) : PreparedStatement | Nil #

[View source]
def enabled? : Bool #

[View source]
def evict(room : Int32, keep : Set(String) = Set(String).new) : Array(PreparedStatement) #

Removes the least recently used statements until room more fit, except those in keep (statements about to be used), and returns them to be closed.


[View source]
def fetch(sql : String) : PreparedStatement | Nil #

[View source]
def next_name : String #

[View source]
def size : Int32 #

[View source]
def store(sql : String, statement : PreparedStatement) : Nil #

[View source]