Module: Sequel::DbOpts

Defined in:
lib/sequel/extensions/db_opts.rb

Overview

DbOpts

Sequel extension that provides database-specific options handling. This extension allows setting database-specific configuration options that get applied during connection establishment.

The extension looks for options in the database configuration that match the pattern ‘database_typedb_optoption_name` and converts them to appropriate SQL SET statements.

Examples:

# For PostgreSQL, options like:
postgres_db_opt_work_mem: '256MB'
postgres_db_opt_shared_preload_libraries: 'pg_stat_statements'

# Will generate:
SET work_mem='256MB'
SET shared_preload_libraries='pg_stat_statements'

Defined Under Namespace

Classes: DbOptions

Instance Method Summary collapse

Instance Method Details

#db_optsDbOptions

Returns a DbOptions instance for this database.

Returns:

  • (DbOptions)

    the database options handler



94
95
96
# File 'lib/sequel/extensions/db_opts.rb', line 94

def db_opts
  @db_opts ||= DbOptions.new(self)
end