Skip to content

module Athena::ORM::DriverManager #

Picks the AORM::Driver adapting connections from each supported crystal-db driver shard:

Driver name Driver shard Driver
postgres will/crystal-pg AORM::Driver::Postgres
mysql crystal-lang/crystal-mysql AORM::Driver::MySQL
sqlite3 crystal-lang/crystal-sqlite3 AORM::Driver::SQLite3

Constants#

DRIVER_MAP = {"postgres" => AORM::Driver::Postgres, "mysql" => AORM::Driver::MySQL, "sqlite3" => AORM::Driver::SQLite3}#

The driver for each driver shard, keyed by the name the shard registers its connections with (DB::Connection#driver_name).

Class methods#

.driver(connection : DB::Connection) : AORM::Driver#

Returns the driver adapting connection's driver shard.

Raises AORM::Exceptions::UnknownDriver if the ORM doesn't support it.

View source