DBIx::...eSource(3pm)
π DBIx::Class::Helper::Schema::GenerateSource π
okay bestie, so this is a page from the User Contributed Perl Documentation, filed under DBIx::...eSource(3pm) β don't ask about the truncated filename, the terminal did that, not me π
NAME
DBIx::Class::Helper::Schema::GenerateSource β Generate sources directly from your Schema β¨
πΈ SYNOPSIS πΈ
package MyApp::Schema;
__PACKAGE__->load_components('Helper::Schema::GenerateSource');
__PACKAGE__->generate_source(User => 'MyCompany::BaseResult::User');
π¦ DESCRIPTION π¦
okay so the whole vibe of this helper is: it lets you handily and correctly add new result sources to your schema, based on existing result sources. no cap. π«Ά
Typically you'd do that by hand, with something like this:
package MyApp::Schema::Result::MessegeQueue;
use parent 'MyCo::Schema::Result::MessageQueue';
__PACKAGE__->table(__PACKAGE__->table);
1;
which, as you can see, is literally in its own file. and that's still the move when you need to add columns or actually do anything other than just the basic addition of the result source to your schema. like, don't skip the file for real work, iykyk.
Note: this component correctly generates an "anonymous" subclass of the given base class. Do not depend on the name of the subclass β it's currently considered unstable. so don't be out here hardcoding it, bestie, it will betray you π
π METHODS π
β generate_source β
$schema->generate_source(User => 'MyCompany::BaseResult::User')
The first argument to generate_source is the "moniker" β that's the name you're registering the class as. The second argument is the base class for the new result source. two args, that's it, we love a simple API π
π AUTHOR π
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, mwah π β this was perl v5.40.0, dated 2024-11-16, served fresh from DBIx::...eSource(3pm). slay, go generate some sources, periodt π«Άβ¨
π¦ where this page comes from
- debian trixie: libdbix-class-helpers-perl 2.037000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdbix-class-helpers-perl 2.037000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdbix-class-helpers-perl 2.037000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms