Skip to content

abstract struct Athena::ORM::Driver
inherits Struct #

What the ORM needs to know about a crystal-db driver shard, beyond the API DB::Connection already shares across shards.

The ORM has one for each supported driver shard, picked by AORM::DriverManager from the name the shard registers its connections with (DB::Connection#driver_name).

Direct known subclasses

Athena::ORM::Driver::MySQL Athena::ORM::Driver::Postgres Athena::ORM::Driver::SQLite3

Constructors#

Methods#

abstract #database_platform(connection : DB::Connection) : Platforms::Platform#

Returns the platform of the database connection is to.

View source

#initialize#

View source

#last_insert_id(connection : DB::Connection, reported_id : Int64) : Int64#

Returns the identifier generated by the last statement executed on connection, for which the driver shard reported reported_id.

Raises AORM::Exceptions::NoIdentityValue if that statement didn't generate one.

View source

#prepare(connection : DB::Connection, sql : String) : DB::Statement#

Returns the statement executing sql on connection.

View source