module Marten::DB::Connection

Defined in:

marten/db/connection.cr
marten/db/connection/base.cr
marten/db/connection/mysql.cr
marten/db/connection/postgresql.cr
marten/db/connection/sqlite.cr

Constant Summary

DEFAULT_CONNECTION_NAME = "default"
IMPLEMENTATIONS = {MYSQL_ID => MySQL, POSTGRESQL_ID => PostgreSQL, SQLITE_ID => SQLite}
MYSQL_ID = "mysql"
POSTGRESQL_ID = "postgresql"
SQLITE_ID = "sqlite"

Class Method Summary

Class Method Detail

def self.default #

Returns the default database connection.


[View source]
def self.for(table_name) #

Returns the connection to use for the passed table_name.


[View source]
def self.get(db_alias : String | Symbol) #

Returns the database connection configured for a given db_alias.

If no database connection can be found, a Marten::DB::Errors::UnknownConnection exception is raised.


[View source]
def self.register(db_config : Conf::GlobalSettings::Database) #

[View source]
def self.registry #

[View source]