Rose::DB::Registry(3pm) | User Contributed Perl Documentation | Rose::DB::Registry(3pm) |
Rose::DB::Registry - Data source registry.
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'); ...
Rose::DB::Registry objects manage information about Rose::DB data sources. Each data source has a corresponding Rose::DB::Registry::Entry object that contains its information. The registry entries are organized in a two-level namespace based on a "domain" and a "type." See the Rose::DB documentation for more information on data source domains and types.
Rose::DB::Registry inherits from, and follows the conventions of, Rose::Object. See the Rose::Object documentation for more information.
Each ENTRY must have a defined domain and type, either in the Rose::DB::Registry::Entry-derived object or in the name/value pairs. A fatal error will occur if these values are not defined.
If a registry entry for the specified domain and type already exists, then the new entry will overwrite it. If you want to know beforehand whether or not an entry exists under a specific domain and type, use the entry_exists method.
Returns a list (in list context) or reference to an array (in scalar context) of Rose::DB::Registry::Entry objects added.
The ENTRY must have a defined domain and type, either in the Rose::DB::Registry::Entry-derived object or in the name/value pairs. A fatal error will occur if these values are not defined.
If a registry entry for the specified domain and type already exists, then the new entry will overwrite it. If you want to know beforehand whether or not an entry exists under a specific domain and type, use the entry_exists method.
Returns the Rose::DB::Registry::Entry object added.
{ domain1 => { type1 => { # Rose::DB::Registry::Entry attributes # generated by its dump() method driver => ..., database => ..., host => ..., ... }, type2 => { ... }, ... }, domain2 => { ... }, ... }
All the registry entry attribute values are copies, not the actual values.
If the specified entry does not exist, undef is returned. Otherwise, the deleted entry is returned.
John C. Siracusa (siracusa@gmail.com)
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.
2023-03-04 | perl v5.36.0 |