NAME
DBIx::QuickORM::Schema::Autofill - Autofill configuration for schema introspection.
DESCRIPTION
Holds the type maps, affinity callbacks, and hooks used while autofilling a schema from a live database. It maps introspected SQL types to DBIx::QuickORM::Type classes, runs user-supplied hooks at well-known points, and generates field and link accessors on autovivified row classes.
SYNOPSIS
my $autofill = DBIx::QuickORM::Schema::Autofill->new(
types => {...},
affinities => {...},
hooks => {...},
);
$autofill->define_autorow($row_class, $table);
ATTRIBUTES
- types
-
Hashref mapping SQL type names to type objects/classes.
- affinities
-
Hashref mapping affinity names to arrayrefs of callbacks.
- hooks
-
Hashref mapping hook names to arrayrefs of callbacks.
- autorow
-
The autovivified row class configuration.
- skip
-
Nested hashref describing what to skip during autofill.
PUBLIC METHODS
- $bool = $autofill->is_valid_hook($name)
-
True if
$nameis a recognized hook name. - $out = $autofill->hook($name, \%args, $seed)
-
Run every callback registered for the named hook, threading the result through each call starting from
$seed, and return the final value. - $val = $autofill->skip(@path)
-
Walk the nested
skiphashref along@path, returning the value found or false (0) as soon as any step is missing. - $autofill->process_column(\%col)
-
Resolve the column's scalar-ref type into a real type object, using the type map first and then affinity callbacks. Updates the column's
typeandaffinityin place when a match is found. - $autofill->define_autorow($row_class, $table)
-
Load (or autovivify) the row class, then install field accessors for each column and link accessors for each link, honoring the
field_accessorandlink_accessorhooks and never clobbering accessors that already exist.
SOURCE
The source code repository for DBIx::QuickORM can be found at https://github.com/exodist/DBIx-QuickORM.
MAINTAINERS
AUTHORS
COPYRIGHT
Copyright Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.