NAME

DBIO::MySQL::Result - MySQL/MariaDB-specific Result component for DBIO

VERSION

version 0.900000

DESCRIPTION

DBIO::MySQL::Result is a DBIO Result component that adds MySQL/MariaDB-native metadata to a result class: the table engine, character set, collation, and custom indexes. It is the counterpart to DBIO::PostgreSQL::Result / DBIO::SQLite::Result and is read by DBIO::MySQL::DDL when generating install DDL.

Load it with:

package MyApp::DB::Result::User;
use base 'DBIO::Core';
__PACKAGE__->load_components('MySQL::Result');

__PACKAGE__->table('users');
__PACKAGE__->mysql_engine('InnoDB');
__PACKAGE__->mysql_charset('utf8mb4');
__PACKAGE__->mysql_collate('utf8mb4_unicode_ci');

__PACKAGE__->mysql_index('idx_users_name' => {
    columns => ['name'],
});

__PACKAGE__->mysql_index('idx_users_fulltext' => {
    using   => 'FULLTEXT',
    columns => ['bio'],
});

METHODS

mysql_engine

__PACKAGE__->mysql_engine('InnoDB');
my $e = $class->mysql_engine;

Get or set the MySQL storage engine for this result class's table. Defaults to InnoDB in the generated DDL when unset.

mysql_charset

__PACKAGE__->mysql_charset('utf8mb4');
my $c = $class->mysql_charset;

Get or set the default character set for this table. Defaults to utf8mb4 in generated DDL when unset.

mysql_collate

__PACKAGE__->mysql_collate('utf8mb4_unicode_ci');
my $c = $class->mysql_collate;

Get or set the default collation for this table. Defaults to utf8mb4_unicode_ci in generated DDL when unset.

mysql_index

__PACKAGE__->mysql_index('idx_users_name' => {
    columns => ['name'],
});
__PACKAGE__->mysql_index('idx_users_fulltext' => {
    using   => 'FULLTEXT',
    columns => ['bio'],
});

Get or set the definition for a named MySQL index. The definition hashref accepts:

columns - ArrayRef of column names
unique - set to true for a UNIQUE index
using - BTREE, HASH, FULLTEXT, or SPATIAL

mysql_indexes

my $all = $class->mysql_indexes;

Returns a copy of all index definitions registered on this result class.

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 153:

Unknown directive: =seealso