class CQL::Configure::Config

Overview

The settings CQL.configure yields. Read them back with CQL.config.

Defined in:

configure.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def adapter : Adapter #

Get the database adapter type


[View source]
def adapter_options : Hash(String, String) #

Custom database adapter settings


[View source]
def adapter_options=(adapter_options : Hash(String, String)) #

Custom database adapter settings


[View source]
def add_validator(validator : ConfigValidator) : Nil #

Add custom validator


[View source]
def auto_load : Bool #

Auto-load model files on startup


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

Auto-load model files on startup


[View source]
def auto_load? : Bool #

Check if auto-loading is enabled


[View source]
def auto_sync : Bool #

Keep schema file in sync with database


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

Keep schema file in sync with database


[View source]
def auto_sync? : Bool #

Check if auto-sync is enabled


[View source]
def bootstrap : Bool #

Create schema from existing database on first run


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

Create schema from existing database on first run


[View source]
def bootstrap? : Bool #

Check if bootstrap is enabled


[View source]
def build_fragment_cache : CQL::Cache::FragmentCache #

Create fragment cache with current settings


[View source]
def build_memory_cache : CQL::Cache::MemoryCache #

Create memory cache with current settings


[View source]
def build_migrator(schema : Schema) : CQL::Migrator #

Create a configured migrator


[View source]
def cache : CacheConfig #

Centralized cache configuration (use config.cache.* to configure)


[View source]
def cache_stats : Hash(String, String | Int32 | Int64 | Float64 | Bool) #

Get cache statistics


[View source]
def cache_summary : String #

Get cache performance summary


[View source]
def db : String #

Primary database connection URL


[View source]
def db=(db : String) #

Primary database connection URL


[View source]
def db_config : DatabaseConfig #

Get database-specific configuration


[View source]
def effective_logger : Log #

Get the effective logger with proper level


[View source]
def env : String #

Environment (auto-detects from CRYSTAL_ENV; unset means development)


[View source]
def env=(value : String) #

[View source]
def full_db_url : String #

Get complete database URL with all settings applied


[View source]
def log_level : Log::Severity #

Shortcut for log level (maps to logger.level)


[View source]
def log_level=(log_level : Log::Severity) #

Shortcut for log level (maps to logger.level)


[View source]
def logger : Log #

Main application logger


[View source]
def logger=(logger : Log) #

Main application logger


[View source]
def migrations_table : Symbol #

Database table for tracking migrations


[View source]
def migrations_table=(migrations_table : Symbol) #

Database table for tracking migrations


[View source]
def migrator_config(schema_path : String | Nil = nil, schema_class : Symbol | Nil = nil, schema_name : Symbol | Nil = nil, migrations_table : Symbol | Nil = nil, auto_sync : Bool | Nil = nil) : CQL::MigratorConfig #

Create migrator configuration


[View source]
def migrator_config_for(environment : String) : CQL::MigratorConfig #

Create environment-specific migrator config


[View source]
def monitor_performance : Bool #

Enable performance monitoring and tracking


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

Enable performance monitoring and tracking


[View source]
def monitor_performance? : Bool #

Check if performance monitoring is enabled


[View source]
def mysql : MySQLConfig #

[View source]
def pool : ConnectionPoolConfig #

Detailed connection pool settings


[View source]
def pool_size : Int32 #

Number of database connections in pool


[View source]
def pool_size=(size : Int32) #

[View source]
def postgres : PostgreSQLConfig #

[View source]
def reset_cache! : Nil #

Reset cache statistics


[View source]
def schema_class : Symbol #

Schema class name in Crystal code


[View source]
def schema_class=(schema_class : Symbol) #

Schema class name in Crystal code


[View source]
def schema_dir : String #

Directory containing schema files


[View source]
def schema_dir=(schema_dir : String) #

Directory containing schema files


[View source]
def schema_file : String #

Main schema file name


[View source]
def schema_file=(schema_file : String) #

Main schema file name


[View source]
def schema_name : Symbol #

Schema instance symbol


[View source]
def schema_name=(schema_name : Symbol) #

Schema instance symbol


[View source]
def schema_path : String #

Get full path to schema file


[View source]
def setup_cache_system : Nil #

[View source]
def setup_sql_logging : Nil #

[View source]
def sql_logging : Bool #

[View source]
def sql_logging=(sql_logging : Bool | Nil) #

[View source]
def sql_logging? : Bool #

Check if SQL logging is enabled


[View source]
def sql_logging_async : Bool #

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

[View source]
def sql_logging_colorize : Bool #

SQL logging options


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

SQL logging options


[View source]
def sqlite : SQLiteConfig #

[View source]
def ssl : SSLConfig #

SSL/TLS configuration


[View source]
def timezone : Symbol #

Timezone for date/time operations


[View source]
def timezone=(timezone : Symbol) #

Timezone for date/time operations


[View source]
def validate! : Nil #

[View source]
def verify_schema : Bool #

Verify schema matches database on startup


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

Verify schema matches database on startup


[View source]
def verify_schema? : Bool #

Check if schema verification is enabled


[View source]