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. π
π COPYRIGHT AND LICENSE π
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
- opensuse-leap 16.0: perl-DBIx-Class 0.082844-bp160.1.10 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms