1Rose::DB::Registry::EntUrsye(r3)Contributed Perl DocumenRtoastei:o:nDB::Registry::Entry(3)
2
3
4
6 Rose::DB::Registry::Entry - Data source registry entry.
7
9 use Rose::DB::Registry::Entry;
10
11 $entry = Rose::DB::Registry::Entry->new(
12 domain => 'production',
13 type => 'main',
14 driver => 'Pg',
15 database => 'big_db',
16 host => 'dbserver.acme.com',
17 username => 'dbadmin',
18 password => 'prodsecret',
19 server_time_zone => 'UTC');
20
21 Rose::DB->register_db($entry);
22
23 # ...or...
24
25 Rose::DB->registry->add_entry($entry);
26
27 ...
28
30 "Rose::DB::Registry::Entry" objects store information about a single
31 Rose::DB data source. See the Rose::DB documentation for more
32 information on data sources, and the Rose::DB::Registry documentation
33 to learn how "Rose::DB::Registry::Entry" objects are managed.
34
35 "Rose::DB::Registry::Entry" inherits from, and follows the conventions
36 of, Rose::Object. See the Rose::Object documentation for more
37 information.
38
40 new PARAMS
41 Constructs a "Rose::DB::Registry::Entry" object based on PARAMS,
42 where PARAMS are name/value pairs. Any object method is a valid
43 parameter name.
44
46 GENERAL
47 autocommit [VALUE]
48 Get or set the value of the "AutoCommit" connect option.
49
50 catalog [CATALOG]
51 Get or set the database catalog name. This setting is only
52 relevant to databases that support the concept of catalogs.
53
54 clone
55 Returns a clone (i.e., deep copy) of the current object.
56
57 connect_option NAME [, VALUE]
58 Get or set the connect option named NAME. Returns the current
59 value of the connect option.
60
61 connect_options [HASHREF | PAIRS]
62 Get or set the options passed in a hash reference as the fourth
63 argument to the call to "DBI->connect()". See the "DBI"
64 documentation for descriptions of the various options.
65
66 If a reference to a hash is passed, it replaces the connect options
67 hash. If a series of name/value pairs are passed, they are added
68 to the connect options hash.
69
70 Returns a reference to the hash of options in scalar context, or a
71 list of name/value pairs in list context.
72
73 database [NAME]
74 Get or set the database name.
75
76 description [TEXT]
77 A description of the data source.
78
79 domain [DOMAIN]
80 Get or set the data source domain. Note that changing the "domain"
81 after a registry entry has been added to the registry has no affect
82 on where the entry appears in the registry.
83
84 driver [DRIVER]
85 Get or set the driver name. The DRIVER argument is converted to
86 lowercase before being set.
87
88 dsn [DSN]
89 Get or set the "DBI" DSN (Data Source Name). Note that an
90 explicitly set DSN may render some other attributes inaccurate.
91 For example, the DSN may contain a host name that is different than
92 the object's current "host()" value. I recommend not setting the
93 DSN value explicitly unless you are also willing to manually
94 synchronize (or ignore) the corresponding object attributes.
95
96 dump
97 Returns a reference to a hash of the entry's attributes. Only
98 those attributes with defined values are included in the hash keys.
99 All values are deep copies.
100
101 handle_error [VALUE]
102 Get or set the value of the "HandleError" connect option.
103
104 host [NAME]
105 Get or set the database server host name.
106
107 password [PASS]
108 Get or set the database password.
109
110 port [NUM]
111 Get or set the database server port number.
112
113 pre_disconnect_sql [STATEMENTS]
114 Get or set the SQL statements that will be run immediately before
115 disconnecting from the database. STATEMENTS should be a list or
116 reference to an array of SQL statements. Returns a reference to
117 the array of SQL statements in scalar context, or a list of SQL
118 statements in list context.
119
120 post_connect_sql [STATEMENTS]
121 Get or set the SQL statements that will be run immediately after
122 connecting to the database. STATEMENTS should be a list or
123 reference to an array of SQL statements. Returns a reference to
124 the array of SQL statements in scalar context, or a list of SQL
125 statements in list context.
126
127 print_error [VALUE]
128 Get or set the value of the "PrintError" connect option.
129
130 raise_error [VALUE]
131 Get or set the value of the "RaiseError" connect option.
132
133 schema [SCHEMA]
134 Get or set the database schema name. This setting is only useful
135 to databases that support the concept of schemas (e.g.,
136 PostgreSQL).
137
138 server_time_zone [TZ]
139 Get or set the time zone used by the database server software. TZ
140 should be a time zone name that is understood by
141 "DateTime::TimeZone". See the "DateTime::TimeZone" documentation
142 for acceptable values of TZ.
143
144 type [TYPE]
145 Get or set the data source type. Note that changing the "type"
146 after a registry entry has been added to the registry has no affect
147 on where the entry appears in the registry.
148
149 username [NAME]
150 Get or set the database username.
151
152 DRIVER-SPECIFIC ATTRIBUTES
153 MySQL
154
155 These attributes should only be used with registry entries where the
156 driver is "mysql".
157
158 mysql_auto_reconnect [BOOL]
159 Get or set the mysql_auto_reconnect database handle attribute.
160 This is set directly on the dbh, if one exists. Otherwise, it will
161 be set when the dbh is created. If no value for this attribute is
162 defined (the default) then it will not be set when the dbh is
163 created, deferring instead to whatever default value DBD::mysql
164 chooses.
165
166 Returns the value of this attribute in the dbh, if one exists, or
167 the value that will be set when the dbh is next created.
168
169 See the DBD::mysql documentation to learn more about this
170 attribute.
171
172 mysql_client_found_rows [BOOL]
173 Get or set the mysql_client_found_rows database handle attribute.
174 This is set directly on the dbh, if one exists. Otherwise, it will
175 be set when the dbh is created. If no value for this attribute is
176 defined (the default) then it will not be set when the dbh is
177 created, deferring instead to whatever default value DBD::mysql
178 chooses.
179
180 Returns the value of this attribute in the dbh, if one exists, or
181 the value that will be set when the dbh is next created.
182
183 See the DBD::mysql documentation to learn more about this
184 attribute.
185
186 mysql_compression [BOOL]
187 Get or set the mysql_compression database handle attribute. This
188 is set directly on the dbh, if one exists. Otherwise, it will be
189 set when the dbh is created. If no value for this attribute is
190 defined (the default) then it will not be set when the dbh is
191 created, deferring instead to whatever default value DBD::mysql
192 chooses.
193
194 Returns the value of this attribute in the dbh, if one exists, or
195 the value that will be set when the dbh is next created.
196
197 See the DBD::mysql documentation to learn more about this
198 attribute.
199
200 mysql_connect_timeout [BOOL]
201 Get or set the mysql_connect_timeout database handle attribute.
202 This is set directly on the dbh, if one exists. Otherwise, it will
203 be set when the dbh is created. If no value for this attribute is
204 defined (the default) then it will not be set when the dbh is
205 created, deferring instead to whatever default value DBD::mysql
206 chooses.
207
208 Returns the value of this attribute in the dbh, if one exists, or
209 the value that will be set when the dbh is next created.
210
211 See the DBD::mysql documentation to learn more about this
212 attribute.
213
214 mysql_embedded_groups [STRING]
215 Get or set the mysql_embedded_groups database handle attribute.
216 This is set directly on the dbh, if one exists. Otherwise, it will
217 be set when the dbh is created. If no value for this attribute is
218 defined (the default) then it will not be set when the dbh is
219 created, deferring instead to whatever default value DBD::mysql
220 chooses.
221
222 Returns the value of this attribute in the dbh, if one exists, or
223 the value that will be set when the dbh is next created.
224
225 See the DBD::mysql documentation to learn more about this
226 attribute.
227
228 mysql_embedded_options [STRING]
229 Get or set the mysql_embedded_options database handle attribute.
230 This is set directly on the dbh, if one exists. Otherwise, it will
231 be set when the dbh is created. If no value for this attribute is
232 defined (the default) then it will not be set when the dbh is
233 created, deferring instead to whatever default value DBD::mysql
234 chooses.
235
236 Returns the value of this attribute in the dbh, if one exists, or
237 the value that will be set when the dbh is next created.
238
239 See the DBD::mysql documentation to learn more about this
240 attribute.
241
242 mysql_enable_utf8 [BOOL]
243 Get or set the mysql_enable_utf8 database handle attribute. This
244 is set directly on the dbh, if one exists. Otherwise, it will be
245 set when the dbh is created. If no value for this attribute is
246 defined (the default) then it will not be set when the dbh is
247 created, deferring instead to whatever default value DBD::mysql
248 chooses.
249
250 Returns the value of this attribute in the dbh, if one exists, or
251 the value that will be set when the dbh is next created.
252
253 See the DBD::mysql documentation to learn more about this
254 attribute.
255
256 mysql_enable_utf8mb4 [BOOL]
257 Get or set the mysql_enable_utf8mb4 database handle attribute.
258 This is set directly on the dbh, if one exists. Otherwise, it will
259 be set when the dbh is created. If no value for this attribute is
260 defined (the default) then it will not be set when the dbh is
261 created, deferring instead to whatever default value DBD::mysql
262 chooses.
263
264 Returns the value of this attribute in the dbh, if one exists, or
265 the value that will be set when the dbh is next created.
266
267 See the DBD::mysql documentation to learn more about this
268 attribute.
269
270 mysql_local_infile [STRING]
271 Get or set the mysql_local_infile database handle attribute. This
272 is set directly on the dbh, if one exists. Otherwise, it will be
273 set when the dbh is created. If no value for this attribute is
274 defined (the default) then it will not be set when the dbh is
275 created, deferring instead to whatever default value DBD::mysql
276 chooses.
277
278 Returns the value of this attribute in the dbh, if one exists, or
279 the value that will be set when the dbh is next created.
280
281 See the DBD::mysql documentation to learn more about this
282 attribute.
283
284 mysql_multi_statements [BOOL]
285 Get or set the mysql_multi_statements database handle attribute.
286 This is set directly on the dbh, if one exists. Otherwise, it will
287 be set when the dbh is created. If no value for this attribute is
288 defined (the default) then it will not be set when the dbh is
289 created, deferring instead to whatever default value DBD::mysql
290 chooses.
291
292 Returns the value of this attribute in the dbh, if one exists, or
293 the value that will be set when the dbh is next created.
294
295 See the DBD::mysql documentation to learn more about this
296 attribute.
297
298 mysql_read_default_file [STRING]
299 Get or set the mysql_read_default_file database handle attribute.
300 This is set directly on the dbh, if one exists. Otherwise, it will
301 be set when the dbh is created. If no value for this attribute is
302 defined (the default) then it will not be set when the dbh is
303 created, deferring instead to whatever default value DBD::mysql
304 chooses.
305
306 Returns the value of this attribute in the dbh, if one exists, or
307 the value that will be set when the dbh is next created.
308
309 See the DBD::mysql documentation to learn more about this
310 attribute.
311
312 mysql_read_default_group [STRING]
313 Get or set the mysql_read_default_group database handle attribute.
314 This is set directly on the dbh, if one exists. Otherwise, it will
315 be set when the dbh is created. If no value for this attribute is
316 defined (the default) then it will not be set when the dbh is
317 created, deferring instead to whatever default value DBD::mysql
318 chooses.
319
320 Returns the value of this attribute in the dbh, if one exists, or
321 the value that will be set when the dbh is next created.
322
323 See the DBD::mysql documentation to learn more about this
324 attribute.
325
326 mysql_socket [STRING]
327 Get or set the mysql_socket database handle attribute. This is set
328 directly on the dbh, if one exists. Otherwise, it will be set when
329 the dbh is created. If no value for this attribute is defined (the
330 default) then it will not be set when the dbh is created, deferring
331 instead to whatever default value DBD::mysql chooses.
332
333 Returns the value of this attribute in the dbh, if one exists, or
334 the value that will be set when the dbh is next created.
335
336 See the DBD::mysql documentation to learn more about this
337 attribute.
338
339 mysql_ssl [BOOL]
340 Get or set the mysql_ssl database handle attribute. This is set
341 directly on the dbh, if one exists. Otherwise, it will be set when
342 the dbh is created. If no value for this attribute is defined (the
343 default) then it will not be set when the dbh is created, deferring
344 instead to whatever default value DBD::mysql chooses.
345
346 Returns the value of this attribute in the dbh, if one exists, or
347 the value that will be set when the dbh is next created.
348
349 See the DBD::mysql documentation to learn more about this
350 attribute.
351
352 mysql_ssl_ca_file [STRING]
353 Get or set the mysql_ssl_ca_file database handle attribute. This
354 is set directly on the dbh, if one exists. Otherwise, it will be
355 set when the dbh is created. If no value for this attribute is
356 defined (the default) then it will not be set when the dbh is
357 created, deferring instead to whatever default value DBD::mysql
358 chooses.
359
360 Returns the value of this attribute in the dbh, if one exists, or
361 the value that will be set when the dbh is next created.
362
363 See the DBD::mysql documentation to learn more about this
364 attribute.
365
366 mysql_ssl_ca_path [STRING]
367 Get or set the mysql_ssl_ca_path database handle attribute. This
368 is set directly on the dbh, if one exists. Otherwise, it will be
369 set when the dbh is created. If no value for this attribute is
370 defined (the default) then it will not be set when the dbh is
371 created, deferring instead to whatever default value DBD::mysql
372 chooses.
373
374 Returns the value of this attribute in the dbh, if one exists, or
375 the value that will be set when the dbh is next created.
376
377 See the DBD::mysql documentation to learn more about this
378 attribute.
379
380 mysql_ssl_cipher [STRING]
381 Get or set the mysql_ssl_cipher database handle attribute. This is
382 set directly on the dbh, if one exists. Otherwise, it will be set
383 when the dbh is created. If no value for this attribute is defined
384 (the default) then it will not be set when the dbh is created,
385 deferring instead to whatever default value DBD::mysql chooses.
386
387 Returns the value of this attribute in the dbh, if one exists, or
388 the value that will be set when the dbh is next created.
389
390 See the DBD::mysql documentation to learn more about this
391 attribute.
392
393 mysql_ssl_client_cert [STRING]
394 Get or set the mysql_ssl_client_cert database handle attribute.
395 This is set directly on the dbh, if one exists. Otherwise, it will
396 be set when the dbh is created. If no value for this attribute is
397 defined (the default) then it will not be set when the dbh is
398 created, deferring instead to whatever default value DBD::mysql
399 chooses.
400
401 Returns the value of this attribute in the dbh, if one exists, or
402 the value that will be set when the dbh is next created.
403
404 See the DBD::mysql documentation to learn more about this
405 attribute.
406
407 mysql_ssl_client_key [STRING]
408 Get or set the mysql_ssl_client_key database handle attribute.
409 This is set directly on the dbh, if one exists. Otherwise, it will
410 be set when the dbh is created. If no value for this attribute is
411 defined (the default) then it will not be set when the dbh is
412 created, deferring instead to whatever default value DBD::mysql
413 chooses.
414
415 Returns the value of this attribute in the dbh, if one exists, or
416 the value that will be set when the dbh is next created.
417
418 See the DBD::mysql documentation to learn more about this
419 attribute.
420
421 mysql_use_result [BOOL]
422 Get or set the mysql_use_result database handle attribute. This is
423 set directly on the dbh, if one exists. Otherwise, it will be set
424 when the dbh is created. If no value for this attribute is defined
425 (the default) then it will not be set when the dbh is created,
426 deferring instead to whatever default value DBD::mysql chooses.
427
428 Returns the value of this attribute in the dbh, if one exists, or
429 the value that will be set when the dbh is next created.
430
431 See the DBD::mysql documentation to learn more about this
432 attribute.
433
434 PostgreSQL
435
436 These attributes should only be used with registry entries where the
437 driver is "pg".
438
439 european_dates [BOOL]
440 Get or set the boolean value that determines whether or not dates
441 are assumed to be in european dd/mm/yyyy format. The default is to
442 assume US mm/dd/yyyy format (because this is the default for
443 PostgreSQL).
444
445 This value will be passed to DateTime::Format::Pg as the value of
446 the "european" parameter in the call to the constructor "new()".
447 This DateTime::Format::Pg object is used by Rose::DB::Pg to parse
448 and format date-related column values in methods like parse_date,
449 format_date, etc.
450
451 pg_enable_utf8 [BOOL]
452 Get or set the pg_enable_utf8 database handle attribute. This is
453 set directly on the dbh, if one exists. Otherwise, it will be set
454 when the dbh is created. If no value for this attribute is defined
455 (the default) then it will not be set when the dbh is created,
456 deferring instead to whatever default value DBD::Pg chooses.
457
458 Returns the value of this attribute in the dbh, if one exists, or
459 the value that will be set when the dbh is next created.
460
461 See the DBD::Pg documentation to learn more about this attribute.
462
463 sslmode [MODE]
464 Get or set the SSL mode of the connection. Valid values for MODE
465 are "disable", "allow", "prefer", and "require". See the DBD::Pg
466 documentation to learn more about this attribute.
467
468 SQLite
469
470 These attributes should only be used with registry entries where the
471 driver is "sqlite".
472
473 auto_create [BOOL]
474 Get or set a boolean value indicating whether or not a new SQLite
475 database should be created if it does not already exist. Defaults
476 to true.
477
478 If false, and if the specified database does not exist, then a
479 fatal error will occur when an attempt is made to connect to the
480 database.
481
483 John C. Siracusa (siracusa@gmail.com)
484
486 Copyright (c) 2010 by John C. Siracusa. All rights reserved. This
487 program is free software; you can redistribute it and/or modify it
488 under the same terms as Perl itself.
489
490
491
492perl v5.30.2 2020-04-06 Rose::DB::Registry::Entry(3)