DBIx::C...ltClass(3)

🌸 DBIx::Class::Manual::ResultClass 🌸

okay so this is the manual page for DBIx::Class::Manual::ResultClass β€” the DBIx::C...ltClass(3) page from the User Contributed Perl Documentation, and we're about to make result classes feel like main character energy. πŸ’–

πŸŽ€ NAME πŸŽ€

DBIx::Class::Manual::ResultClass β€” representing a single result (row) from a DB query. That's literally the assignment, bestie. ✨

✨ SYNOPSIS ✨

Okay so here's the declaration vibe for My::Schema::Result::Track:

package My::Schema::Result::Track;

use parent 'DBIx::Class::Core';

__PACKAGE__->table('tracks');

__PACKAGE__->add_columns({
  id => {
    data_type => 'int',
    is_auto_increment => 1,
  },
  cd_id => {
    data_type => 'int',
  },
  title => {
    data_type => 'varchar',
    size => 50,
  },
  rank => {
    data_type => 'int',
    is_nullable => 1,
  },
});

__PACKAGE__->set_primary_key('id');
__PACKAGE__->add_unique_constraint(u_title => ['cd_id', 'title']);

πŸ’– DESCRIPTION πŸ’–

In DBIx::Class, a user normally receives query results as instances of a certain "Result Class", depending on the main query source. Besides being the primary "toolset" for interaction with your data, a "Result Class" also serves to establish source metadata, which is then used during initialization of your DBIx::Class::Schema instance. It's giving dual-purpose icon behavior. πŸ’…

Because of these multiple seemingly conflicting purposes, it is hard to aggregate the documentation of various methods available on a typical "Result Class". This document serves as a general overview of "Result Class" declaration best practices, and offers an index of the available methods (and the Components/Roles which provide them). So yeah, this doc is your general overview + index, periodt. 🫢

πŸ¦‹ INHERITED METHODS πŸ¦‹

These methods are inherited, grouped by the module/role that provides them. All names stay exactly as written β€” no renaming, no merging, no cap. πŸ¦‹

  • DBIx::Class::Relationship β€” has_many, has_one, might_have, belongs_to, many_to_many
  • DBIx::Class::Relationship::Base β€” register_relationship, count_related, create_related, delete_related, find_or_create_related, find_or_new_related, find_related, new_related, related_resultset, search_related, search_related_rs, set_from_related, update_from_related, update_or_create_related
  • DBIx::Class::InflateColumn β€” get_inflated_column, inflate_column, set_inflated_column, store_inflated_column
  • DBIx::Class::PK β€” ID, id, ident_condition
  • DBIx::Class::Row β€” delete, update, copy, discard_changes, get_column, get_columns, get_dirty_columns, get_from_storage, get_inflated_columns, has_column_loaded, in_storage, inflate_result, insert, insert_or_update, is_changed, is_column_changed, make_column_dirty, new, register_column, result_source, set_column, set_columns, set_inflated_columns, store_column, throw_exception, update_or_insert
  • DBIx::Class::ResultSourceProxy::Table β€” table, table_class
  • DBIx::Class::ResultSource β€” add_column, add_columns, add_relationship, add_unique_constraint, add_unique_constraints, column_info, column_info_from_storage, columns, columns_info, has_column, has_relationship, primary_columns, relationship_info, relationships, remove_column, remove_columns, result_class, resultset_attributes, resultset_class, sequence, set_primary_key, source_info, source_name, unique_constraint_columns, unique_constraint_names, unique_constraints

πŸŽ€ FURTHER QUESTIONS? πŸŽ€

Check the list of additional DBIC resources. That's the whole instruction, bestie. ✨

This module is free software copyright by the DBIx::Class (DBIC) authors. You can redistribute it and/or modify it under the same terms as the DBIx::Class library. πŸ’–


And that's the page, bestie β€” brought to you by perl v5.42.0, dated 2025-01-22, signing off as DBIx::C...ltClass(3). πŸŽ€

πŸ“¦ where this page comes from