CRUD(3pm)

πŸ“¦
version 0.04 Β· 2 versions
  • 0.04 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.04 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Catalyst::Model::CDBI::CRUD β€” the CRUD CDBI Model Class, bestie!! It's from the User Contributed Perl Documentation corner of the manual-verse, and honestly? Iconic little relic energy. 🫢


✨ SYNOPSIS ✨

okay so here's the whole vibe, copy-paste ready, no cap:

# lib/MyApp/Model/CDBI.pm
package MyApp::Model::CDBI;

use base 'Catalyst::Model::CDBI::CRUD';

__PACKAGE__->config(
    dsn           => 'dbi:SQLite2:/tmp/myapp.db',
    relationships => 1
);

1;

# lib/MyApp.pm
package MyApp;

use Catalyst 'FormValidator';

__PACKAGE__->config(
    name => 'My Application',
    root => '/home/joeuser/myapp/root'
);

    sub table : Global {
        my ( $self, $c ) = @_;
        $c->form( optional => [ MyApp::Model::CDBI::Table->columns
                              ] ); #see Data::FormValidator
        $c->forward('MyApp::Model::CDBI::Table');
    }
    sub end : Private {
      $c->forward('MyApp::V::TT');
    }

1;

🌸 DESCRIPTION 🌸

So Catalyst::Model::CDBI::CRUD is a subclass of Catalyst::Model::CDBI that comes with extra CRUD methods bolted on top. πŸ’…

And like, don't forget to copy the base templates over to config->root!! That part is not optional, she will simply not render without them. πŸ™ˆ

NOTE: bestie. This module has been deprecated. πŸ’€ Go read the BUGS section down below, it's giving cautionary tale.

πŸŽ€ METHODS πŸŽ€

add

Literally does nothing by default. She's just standing there. πŸ’€

destroy

Deletes a Class::DBI object. Gone. Poof. ✨

do_add

Creates a brand new Class::DBI object, sourced from $c->form.

do_edit

Updates a Class::DBI object, sourced from $c->form.

edit

Does nothing by default. Main character energy: present, but not participating. πŸ’…

list

Does nothing by default.

process

Dispatches CRUD requests to the methods. This is the one actually doing the work fr fr. πŸ”₯

view

Does nothing by default.


πŸ’€ BUGS πŸ’€

Not me having to tell you this, but: this module is no longer supported by the Catalyst developers. 😭 They keep it indexed purely for the sake of existing users, but they highly recommend that new users go look at Catalyst::Helper::Controller::Scaffold instead. Periodt.


πŸ¦‹ SEE ALSO πŸ¦‹

  • Catalyst
  • Catalyst::Model::CDBI

πŸ‘‘ AUTHOR πŸ‘‘

Sebastian Riedel, sri@cpan.org 🌈


This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. πŸ“


okay that's the whole page bestie, tysm for reading, mwah!! πŸ’– This lil time capsule is perl v5.34.0, dated 2022-06-09, filed under CRUD(3pm) β€” stay slay, hydrate, and go use the Scaffold controller instead. βœ¨πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from