Skip to content

abstract class Athena::ORM::Platforms::AbstractMySQL
inherits Athena::ORM::Platforms::Platform #

Base platform for MySQL-like platforms.

Connections from the mysql driver shard use AORM::Platforms::Maria or AORM::Platforms::MySQL, depending on whether the driver reports the server as MariaDB (DB::Connection#server_name).

Identifiers are quoted with backticks.

Direct known subclasses

Athena::ORM::Platforms::Maria Athena::ORM::Platforms::MySQL

Methods#

#big_int_type_declaration_sql(column : Schema::Column) : String#

Returns the SQL declaring column as a big (8 byte) integer column.

View source

#blob_type_declaration_sql(column : Schema::Column) : String#

Returns the SQL declaring column as a binary large object column.

View source

#boolean_type_declaration_sql(column : Schema::Column) : String#

Returns the SQL declaring column as a boolean column.

View source

#create_metadata_provider(connection : AORM::Connection) : Schema::Metadata::MetadataProviderInterface#

Returns the metadata provider that reads the metadata of the schema objects of the database connection is to.

View source

#create_schema_manager(connection : AORM::Connection) : Schema::AbstractSchemaManager#

Returns the schema manager that inspects the schema of the database connection is to, see AORM::Connection#create_schema_manager.

View source

#date_time_type_declaration_sql(column : Schema::Column) : String#

Returns the SQL declaring column as a date and time column without a time zone.

View source

#decimal_type_declaration_sql(column : Schema::Column) : String#

Returns the SQL declaring column as an exact numeric column, e.g. NUMERIC(10, 2).

Raises AORM::Exception::InvalidColumnDeclaration if column has no precision or scale.

View source

#float_declaration_sql(column : Schema::Column) : String#

Returns the SQL declaring column as a double precision floating point column.

View source

#integer_type_declaration_sql(column : Schema::Column) : String#

Returns the SQL declaring column as an integer (4 byte) column.

View source

#quote_single_identifier(identifier : String) : String#

Returns identifier quoted for use as a table or column name.

By default, identifiers are wrapped in double quotes, with any embedded double quotes doubled.

MySQL and MariaDB wrap identifiers in backticks instead, with any embedded backticks doubled.

View source

#quote_string_literal(str : String) : String#

Returns str quoted as a string literal, with any embedded single quotes doubled.

MySQL and MariaDB also require backslashes to be escaped.

View source

#small_float_declaration_sql(column : Schema::Column) : String#

Returns the SQL declaring column as a single precision floating point column.

View source

#small_int_type_declaration_sql(column : Schema::Column) : String#

Returns the SQL declaring column as a small (2 byte) integer column.

View source