Rose::...etadata(3pm)
πΈ NAME πΈ
Okay bestie, this is the Rose::...etadata(3pm) page from the User Contributed Perl Documentation, and the module itself is Rose::DB::Object::Std::Metadata β standardized database object metadata. Slay. β¨
π¦ SYNOPSIS π¦
Here's the whole mood in code, no cap:
use Rose::DB::Object::Std::Metadata;
$meta = Rose::DB::Object::Std::Metadata->new(class => 'Product');
# ...or...
# $meta = Rose::DB::Object::Std::Metadata->for_class('Product');
$meta->table('products');
$meta->columns
(
id => { type => 'int', primary_key => 1 },
name => { type => 'varchar', length => 255 },
description => { type => 'text' },
category_id => { type => 'int' },
status =>
{
type => 'varchar',
check_in => [ 'active', 'inactive' ],
default => 'inactive',
},
start_date => { type => 'datetime' },
end_date => { type => 'datetime' },
date_created => { type => 'timestamp', default => 'now' },
last_modified => { type => 'timestamp', default => 'now' },
);
$meta->add_unique_key('name');
$meta->foreign_keys
(
category =>
{
class => 'Category',
key_columns =>
{
category_id => 'id',
}
},
);
...
That trailing ... is literally part of the example, bestie β it's giving "there's more where that came from." π«Ά
π DESCRIPTION π
So Rose::DB::Object::Std::Metadata is a subclass of Rose::DB::Object::Metadata, and it's specifically built to serve the needs of Rose::DB::Object::Std objects. That's the whole point. β¨
If you wanna know what makes it different from Rose::DB::Object, go read the Rose::DB::Object::Std documentation. It's all explained there, iykyk. π
Also important: only the methods that are overridden are documented here. For everything else, the Rose::DB::Object::Metadata documentation is your bestie. π
π OBJECT METHODS π
add_primary_key_column COLUMN
This one is an alias for the add_primary_key_columns() method. Short and sweet. π
add_primary_key_columns COLUMNS
Rose::DB::Object::Std objects must have a single primary key column named id. So if you call this method with a COLUMNS argument that's anything other than the column name id, or a reference to an array containing the column name id, it will cause a fatal error. π¨ Like, actual fatal error, not a vibe check.
In general, you do not need to use this method at all, because theprimary_key_columns()method is hard-coded to always returnid. So maybe justβ¦ don't? π
initialize [ARGS]
This method does the same thing as the Rose::DB::Object::Metadata method of the same name, with one exception: if there's no column named id in the list of columns, a scalar primary key column named id is added to the column list. Then initialization proceeds as usual. Iconic behavior, honestly. π
primary_key_columns
Always returns the column name id in list context, or a reference to an array containing the column name id in scalar context. Periodt. π
π AUTHOR π
John C. Siracusa (siracusa@gmail.com). Shoutout to the author, bestie! π«Ά
π 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. π
Okay that's the whole page, bestie! This cutie came from perl v5.40.1, dated 2025-08-21. Mwah! πβ¨π
π¦ 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