Rose::...aryKey(3pm)
πΈ NAME πΈ
Rose::DB::Object::Metadata::PrimaryKey β primary key metadata.
Okay bestie, this is literally the Rose::...aryKey(3pm) page from the User Contributed Perl Documentation, and it's here to explain the metadata glow-up for primary keys. Hiiii π
β¨ SYNOPSIS β¨
use Rose::DB::Object::Metadata::PrimaryKey;
$pk = Rose::DB::Object::Metadata::PrimaryKey->new(
columns => [ 'id', 'type' ]);
MyClass->meta->primary_key($pk);
...
π DESCRIPTION π
Okay so objects of this class store and manipulate metadata for primary keys in a database table. And a primary key? It's made up of one or more columns. That's the whole vibe. Periodt. π
π OBJECT METHODS π
Here's the method menu, bestie β every single one, no skips, no cap. π«Ά
add_column [COLUMNS]β this is literally an alias for theadd_columnsmethod. Same energy, different name.add_columns [COLUMNS]β addsCOLUMNSto the list of columns that make up the primary key.COLUMNSmust be a list or reference to an array of column names orRose::DB::Object::Metadata::Column-derived objects. Slay.columns [COLUMNS]β get or set the list of columns that make up the primary key.COLUMNSmust be a list or reference to an array of column names orRose::DB::Object::Metadata::Column-derived objects.
This method returns all of the columns that make up the primary key. Each column is a Rose::DB::Object::Metadata::Column-derived column object if the primary key's parent has a column object with the same name, or just the column name otherwise. In scalar context, a reference to an array of columns is returned. In list context, a list is returned. Iconic behavior, honestly. β¨
column_namesβ returns a list (in list context) or reference to an array (in scalar context) of the names of the columns that make up the primary key.delete_columnsβ deletes the entire list of columns that make up the primary key. Like, all of them. Poof. πname [NAME]β get or set the name of the primary key. Traditionally, this is the name of the index that the database uses to maintain the primary key, but databases vary. If left undefined, the default value is"primary_key".parent [META]β get or set theRose::DB::Object::Metadata-derived object that this primary key belongs to.sequence_names [NAMES]β get or set the list of database sequence names (if any) used to generate values for the primary key columns. The sequence names must be in the same order as the columns.NAMESmay be a list or reference to an array of sequence names. Returns a list (in list context) or reference to the array (in scalar context) of sequence names. Bestie, the order matters β don't mess with it. π¦
π AUTHOR π
This iconic human is John C. Siracusa (siracusa@gmail.com). Respect. π
π LICENSE π
Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Mwah π β signed off by perl v5.40.1, dated 2025-08-21, and it's the Rose::...aryKey(3pm) page. Byeee bestie π¦β¨
π¦ where this page comes from
- ubuntu resolute: librose-db-object-perl 1:0.822-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: librose-db-object-perl 1:0.822-1 Β· Artistic-1.0-Perl 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