Rose::...gistry(3pm)
β¨ Rose::DB::Registry β¨
Rose::DB::Registry β bestie, it's literally the data source registry π
(it's the Rose::DB::Registry page from the User Contributed Perl Documentation, and it's giving organized).
πΈ SYNOPSIS πΈ
okay so here's the whole vibe in code form, no notes:
use Rose::DB::Registry;
$registry = Rose::DB::Registry->new;
$registry->add_entry(
domain => 'development',
type => 'main',
driver => 'Pg',
database => 'dev_db',
host => 'localhost',
username => 'devuser',
password => 'mysecret',
server_time_zone => 'UTC');
$entry = Rose::DB::Registry::Entry->new(
domain => 'production',
type => 'main',
driver => 'Pg',
database => 'big_db',
host => 'dbserver.acme.com',
username => 'dbadmin',
password => 'prodsecret',
server_time_zone => 'UTC');
$registry->add_entry($entry);
$entry = $registry->entry(domain => 'development', type => 'main');
$registry->entry_exists(domain => 'foo', type => 'bar'); # false
$registry->delete_entry(domain => 'development', type => 'main');
...
π¦ DESCRIPTION π¦
So. Rose::DB::Registry objects keep track of info about your Rose::DB data sources π. Every single data source gets its own little Rose::DB::Registry::Entry object holding its info, and all those entries live in a two-level namespace based on a "domain" and a "type." Need the deets on data source domains and types? Go read the Rose::DB documentation, it's all there π«Ά.
Also important: Rose::DB::Registry inherits from, and follows the conventions of, Rose::Object. So if you wanna know more, the Rose::Object documentation is right there β¨.
π CONSTRUCTOR π
new PARAMSβ builds aRose::DB::Registryobject out of PARAMS, where PARAMS are name/value pairs. And get this: any object method is a valid parameter name π.
π OBJECT METHODS π
add_entries ENTRY1 [, ENTRY2, ...]β adds a bunch of registry entries at once, iconic. Each ENTRY has to be either aRose::DB::Registry::Entry-derived object or a reference to a hash of name/value pairs. Those name/value pairs must be valid arguments forRose::DB::Registry::Entry's constructor.
Every ENTRY needs a defined domain and type β either inside the Rose::DB::Registry::Entry-derived object or in the name/value pairs. If those values aren't defined? π fatal error, bestie, no cap.
And if a registry entry for that domain and type already exists, the new entry overwrites it. Want to know beforehand whether something already lives under a specific domain and type? Use entry_exists, easy.
Returns a list (in list context) or a reference to an array (in scalar context) of the Rose::DB::Registry::Entry objects added π.
add_entry ENTRYβ adds one registry entry, the low-key version. ENTRY must be either aRose::DB::Registry::Entry-derived object or a list of name/value pairs. Those name/value pairs must be valid arguments forRose::DB::Registry::Entry's constructor.
The ENTRY must have a defined domain and type, either in the Rose::DB::Registry::Entry-derived object or in the name/value pairs. Not defined? Fatal error π.
Already got an entry for that domain and type? The new one overwrites it. If you wanna check first, entry_exists is your girl.
Returns the Rose::DB::Registry::Entry object added π.
dumpβ hands you back a reference to a hash with info about all the registered data sources. The hash is shaped like this:
{
domain1 =>
{
type1 =>
{
# Rose::DB::Registry::Entry attributes
# generated by its dump() method
driver => ...,
database => ...,
host => ...,
...
},
type2 =>
{
...
},
...
},
domain2 =>
{
...
},
...
}
Heads up though: every registry entry attribute value in there is a copy, not the actual value. Don't go mutating and expecting it to stick π.
delete_domain DOMAINβ deletes a whole entire domain, and every registry entry hanging out under it. Total main character move.delete_entry PARAMSβ deletes the registry entry specified by PARAMS, where PARAMS must be name/value pairs with defined values for"domain"and"type". Missing or undefined? Fatal error, obviously.
If that entry doesn't exist, undef comes back. Otherwise you get the deleted entry returned π.
entry PARAMSβ grabs the registry entry specified by PARAMS, where PARAMS must be name/value pairs with defined values for"domain"and"type". Either one missing or undefined = fatal error. And if the entry doesn't exist, you getundefback, sorry babe πΈ.entry_exists PARAMSβ returns true if the registry entry specified by PARAMS exists, false otherwise. PARAMS must be name/value pairs with defined values for"domain"and"type". Missing or undefined β fatal error π.registered_types DOMAINβ returns a list (in list context) or a reference to an array (in scalar context) of the names of all the registered types under the domain named DOMAIN β.registered_domainsβ returns a list (in list context) or a reference to an array (in scalar context) of the names of all registered domains π.
π AUTHOR π
John C. Siracusa (siracusa@gmail.com) β the legend himself π
π 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.
and that's the whole page, bestie, periodt π β¨
this was Rose::DB::Registry, perl v5.40.1, dated 2026-07-31 β ugh, obsessed, fr fr π¦π
π¦ where this page comes from
- ubuntu stonking: librose-db-perl 0.788-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms