NAME

DBIO::ResultSourceProxy - Proxy result source methods onto a result class

VERSION

version 0.900004

METHODS

set_inherited_ro_instance

add_columns

add_relationship

table

__PACKAGE__->table('tbl_name');

Gets or sets the table name. Initialises the result-source instance on first call.

indices

__PACKAGE__->indices(
  name_idx       => 'name',
  name_city_idx => ['name', 'city'],
);

Declares one or more secondary indexes on the table. Field lists may be a single column name or an arrayref of column names. A hashref argument is also accepted:

__PACKAGE__->indices({ name_idx => 'name' });

Each index is stored on the result source as a canonical declaration, { name, columns, unique, ... }, which a driver reads with index_declarations (see "add_index_declaration" in DBIO::ResultSource). Declaring the same name again replaces the earlier declaration. Equivalent to the DBICx::Indexing component on DBIx::Class. The richer "idx" in DBIO::Cake DSL fills the same declaration list.

indices declares plain indexes and carries no driver block; the entry is valid for every driver. Use "idx" in DBIO::Cake for a pg, sqlite or mysql block.

The class itself gets no index method from the declaration; a driver reads the declarations from the source.

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.