module CQL::Configure

Overview

Centralized configuration for CQL.

Quick setup for different environments:

Development (run with CRYSTAL_ENV=development to get SQL logging)

CQL.configure do |config|
  config.db = "postgresql://localhost/myapp"
end

Production

CQL.configure do |config|
  config.db = ENV["DATABASE_URL"]
  config.env = "production"
  config.pool_size = 25
end

Custom Development Setup

CQL.configure do |config|
  config.db = "postgresql://localhost/myapp"
  config.sql_logging_colorize = false # Plain SQL logging output
end

Defined in:

configure.cr
configure/cache_config.cr
configure/config_validator.cr
configure/connection_pooling_config.cr
configure/database_config.cr
configure/database_url_builder.cr
configure/enviroment_strategy.cr
configure/ssl_config.cr

Class Method Summary

Class Method Detail

def self.configured? : Bool #

Check if configuration has been initialized


[View source]
def self.current : Config #

Get the current configuration instance (thread-safe)


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

Reset configuration to defaults (useful for testing)


[View source]