class ODBC::Config

Overview

Configuration options for ODBC connections and operations.

Values are applied to each new connection via Connection#apply_config. Can be configured programmatically or via environment variables.

ODBC::Config.configure do |c|
  c.connection_timeout = 60.seconds
  c.query_timeout = 30.seconds
  c.enable_tracing = true
end

Defined in:

odbc/config.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.from_env : Config #

Load configuration from environment variables. Called automatically on first access of Config.instance.


[View source]
def self.instance : Config #

[View source]

Class Method Detail

def self.configure(&) : Nil #

[View source]
def self.reset! : Nil #

Reset configuration to defaults (useful for testing)


[View source]

Instance Method Detail

def auto_commit=(auto_commit : Bool) #

[View source]
def auto_commit? : Bool #

[View source]
def connection_timeout : Time::Span #

[View source]
def connection_timeout=(connection_timeout : Time::Span) #

[View source]
def default_buffer_size : Int32 #

[View source]
def default_buffer_size=(default_buffer_size : Int32) #

[View source]
def enable_tracing=(enable_tracing : Bool) #

[View source]
def enable_tracing? : Bool #

[View source]
def login_timeout : Time::Span #

[View source]
def login_timeout=(login_timeout : Time::Span) #

[View source]
def max_string_length : Int32 #

[View source]
def max_string_length=(max_string_length : Int32) #

[View source]
def query_timeout : Time::Span #

[View source]
def query_timeout=(query_timeout : Time::Span) #

[View source]
def trace_file : String #

def trace_file=(trace_file : String) #