DBIO

 view release on metacpan or  search on metacpan

lib/DBIO/Manual/Component.pod  view on Meta::CPAN

  1;

When loaded, the component is injected into the result class' inheritance
chain via L<Class::C3>. A component can provide new methods, override
methods provided by other components, or hook into lifecycle methods on
L<DBIO::Row>:

  sub insert {
    my $self = shift;
    # Do stuff with $self before insert.
    return $self->next::method(@_);
  }

  sub delete {
    my $self = shift;
    # Do stuff with $self before delete.
    return $self->next::method(@_);
  }

Components loaded earlier sit closer to the front of the C<@ISA> chain.
If you override C<insert()> but L<DBIO::Row> appears in the chain before
your component, your override is shadowed. To inspect the actual
resolution order:

  print join ', ', mro::get_linear_isa('YourClass::Name');

=head1 CORE INFRASTRUCTURE

These classes are the substrate for every result class. They are loaded
implicitly by L<DBIO::Core> and you do not list them in
C<load_components>.

L<DBIO::Core> -- The standard component bundle that user-facing result
classes inherit from. Loads the rest of the core infrastructure.

L<DBIO::Row> -- Per-row state, accessors, C<insert>/C<update>/C<delete>,
the lifecycle hook surface every other component cooperates with.

L<DBIO::PK> -- Primary key handling.

L<DBIO::ResultSourceProxy> -- Provides C<__PACKAGE__-E<gt>table(...)>
and proxies result-source methods onto the result class.

L<DBIO::Relationship> -- Inter-table relationships
(C<belongs_to>, C<has_many>, C<might_have>, C<many_to_many>).

L<DBIO::InflateColumn> -- Per-column inflate/deflate hook used by both
core and optional components.

=head1 BUILT-IN OPTIONAL COMPONENTS

These ship in the DBIO core distribution and are loaded explicitly via
C<load_components>.

L<DBIO::InflateColumn::DateTime> -- Inflate date/time columns to
L<DateTime> objects.

L<DBIO::InflateColumn::Serializer> -- Serialise complex Perl structures
into a single column (JSON, Storable, YAML).

L<DBIO::FilterColumn> -- Bidirectional filter callbacks between in-memory
and storage representations.

L<DBIO::Timestamp> -- C<set_on_create> / C<set_on_update> column flags
for automatic timestamp maintenance.

L<DBIO::EncodedColumn> -- One-way encode columns such as passwords.

L<DBIO::UUIDColumns> -- C<uuid_on_create> column flag for automatic
UUID generation on insert.

L<DBIO::Ordered> -- C<position> / C<grouping> column flags to maintain
a position column over an ordered list of rows.

L<DBIO::HashAccessor> -- Generate get/set/exists/delete/push helpers for
serialised hash columns.

L<DBIO::ChangeLog> -- Record per-column change history into companion
ChangeLog tables. Per-column C<< changelog => 0 >> flag to exclude
sensitive fields.

=head1 SEE ALSO

L<DBIO::Manual::Cookbook>

=head1 AUTHOR

DBIO & DBIx::Class Authors

=head1 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.

=cut



( run in 0.519 second using v1.01-cache-2.11-cpan-6aa56a78535 )