DBIx::C...PK::Auto(3)

🌸 NAME 🌸

Okay bestie, this page is all about DBIx::Class::PK::Auto β€” the Automatic primary key class. πŸ’– It’s filed under the manual name DBIx::C...PK::Auto(3) in the User Contributed Perl Documentation, and now we’re gonna get into it.

✨ SYNOPSIS ✨

use base 'DBIx::Class::Core'; __PACKAGE__->set_primary_key('id');

πŸ¦‹ DESCRIPTION πŸ¦‹

This class overrides the insert method so you can get automatically incremented primary keys. Iconic behavior, honestly.

PK::Auto is now part of Core. Slay.

For the details on component interactions, see DBIx::Class::Manual::Component. It’s giving β€œrequired reading,” iykyk. πŸ“š

πŸ”₯ LOGIC πŸ”₯

"PK::Auto" pulls this off by letting the database assign the primary key field, then fetching the assigned value afterwards. The DB is the main character; we’re just living in its world. πŸ‘‘

πŸŽ€ METHODS πŸŽ€

πŸ’… insert

The code that was handled here is now in Row for efficiency. So that’s where the insert logic hangs out now, periodt.

🌈 sequence

The code that was handled here is now in ResultSource, and it’s being proxied to Row as well. Cute little proxy chain, no cap. πŸ”—

🫢 FURTHER QUESTIONS? 🫢

Check the list of additional DBIC resources. That’s the vibe check for more info. πŸ’œ

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.

Legal tea, served. β˜•πŸ’…


Mwah πŸ’‹ β€” this page came from perl v5.42.0, dated 2025-01-22. Bye bestie! 🫢

πŸ“¦ where this page comes from