class Marten::Conf::GlobalSettings::Database

Overview

Defines the configuration of a specific database connection.

Defined in:

marten/conf/global_settings/database.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(id : String) #

[View source]

Instance Method Detail

def backend : String? #

Returns the connection backend of the database.


[View source]
def backend=(val : Nil | String | Symbol) #

Allows to set the connection backend of the database.


[View source]
def checkout_timeout : Float64 #

Returns the number of seconds to wait for a connection to become available when the max pool size is reached.


[View source]
def checkout_timeout=(checkout_timeout : Float64) #

Allows to set the seconds to wait for a connection to become available when the max pool size is reached.


[View source]
def from_url(url : String) #

Allows to set the database configuration from a connection URL.


[View source]
def host : String? #

Returns the database host.


[View source]
def host=(val : Nil | String | Symbol) #

Allows to set the database host.


[View source]
def id : String #

Returns the identifier of the database.


[View source]
def initial_pool_size : Int32 #

Returns the initial number of connections created for the database connections pool.


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

Allows to set the initial number of connections created for the database connections pool.


[View source]
def max_idle_pool_size : Int32 #

Returns the maximum number of idle connections for the database connections pool.

When released, a connection will be closed only if there are already #max_idle_pool_size idle connections.


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

Allows to set the maximum number of idle connections for the database connections pool.


[View source]
def max_pool_size : Int32 #

Returns the maximum number of connections that will be held by the database connections pool.

When set to 0, this means that there is no limit to the number of connections.


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

Allows to set the maximum number of connections that will be held by the database connections pool.


[View source]
def name : String? #

Returns the database name.


[View source]
def name=(val : Nil | Path | String | Symbol) #

Allows to set the database name.


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

Returns the database options.


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

Allows to set additional database options.


[View source]
def password : String? #

Returns the database password.


[View source]
def password=(val : Nil | String | Symbol) #

Allows to set the database password.


[View source]
def port : Int32? #

Returns the database port.


[View source]
def port=(val : Int | Nil) #

Allows to set the database port.


[View source]
def retry_attempts : Int32 #

Returns the maximum number of attempts to retry re-establishing a lost connection.


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

Allows to set the maximum number of attempts to retry re-establishing a lost connection.


[View source]
def retry_delay : Float64 #

Returns the delay to wait between each retry at re-establishing a lost connection.


[View source]
def retry_delay=(retry_delay : Float64) #

Allows to set the delay to wait between each retry at re-establishing a lost connection.


[View source]
def user : String? #

Returns the database user name.


[View source]
def user=(val : Nil | String | Symbol) #

Allows to set the database user name.


[View source]