Rose::...MariaDB(3pm)
π Rose::DB::MariaDB π
okay so bestie, this right here is the MariaDB driver class for Rose::DB β and yes, it's straight from the User Contributed Perl Documentation (that's the 3pm part, iykyk πβ¨).
β¨ SYNOPSIS β¨
use Rose::DB;
Rose::DB->register_db(
domain => 'development',
type => 'main',
driver => 'mariadb',
database => 'dev_db',
host => 'localhost',
username => 'devuser',
password => 'mysecret',
);
Rose::DB->default_domain('development');
Rose::DB->default_type('main');
...
# Set max length of varchar columns used to emulate the array data type
Rose::DB::MariaDB->max_array_characters(128);
$db = Rose::DB->new; # $db is really a Rose::DB::MariaDB-derived object
...
π¦ DESCRIPTION π¦
so like, here's the vibe: when the driver is "mariadb", Rose::DB blesses objects into a class derived from Rose::DB::MariaDB. that whole driver-name-to-class-name mapping? fully configurable π
. go read Rose::DB's new() and driver_class() methods if you want the deets.
β οΈ bestie listen: this class cannot be used directly. fr fr. you gotta useRose::DBand let itsnew()method hand you back an object that's already blessed into the right class, based on itsdriver_class()mappings. that's the whole thing.
only the methods that are new or that behave differently than the ones in Rose::DB get written up here, okay? for the full list of methods, go check the Rose::DB documentation. periodt. π
πΈ CLASS METHODS πΈ
π« coerce_autoincrement_to_serial [BOOL]
get or set a boolean that says whether or not "auto-increment" columns get treated as having the column type "serial". if it's true, then "integer" columns get coerced into the "serial" column type, and "bigint" columns use the "bigserial" column type instead. default value? true β
.
this setting lowkey comes into play when Rose::DB::Object::Loader is used to auto-create column metadata based on an existing database schema.
π« max_array_characters [INT]
get or set the maximum length of varchar columns used to emulate the array data type. default value is 255.
here's the tea: MariaDB does not have a native "ARRAY" data type, so this data type gets emulated using a "VARCHAR" column plus a specially formatted string. the formatting and parsing of that string is handled by the format_array and parse_array object methods. and that maximum length limit? honored by the format_array object method. no cap. π
π« max_array_characters's bestie β max_interval_characters [INT]
get or set the maximum length of varchar columns used to emulate the interval data type. default value is 255.
same situation as above: MariaDB doesn't have a native "interval" data type, so it gets emulated using a "VARCHAR" column and a specially formatted string. formatting and parsing of this string is handled by the format_interval and parse_interval object methods, and the maximum length limit is honored by the format_interval object method. π
π«Ά OBJECT METHODS π«Ά
quick housekeeping bestie: for basically all of these, the pattern is the same β they're database handle (dbh) attributes. they get set directly on thedbhif one already exists. if not, they'll be set whenever thedbhgets created. if no value is defined for the attribute (that's the default), then it just won't be set when thedbhis created, deferring instead to whatever default valueDBD::MariaDBpicks. and the getter returns the value of the attribute in thedbhif one exists, or the value that will be set when thedbhis next created. and yes, all of them say "see theDBD::MariaDBdocumentation to learn more about this attribute." iykyk π
β mariadb_auto_reconnect [BOOL]
get or set the mariadb_auto_reconnect database handle attribute. set directly on the dbh if one exists; otherwise it gets set when the dbh is created. if no value is defined (that's the default), it won't be set when the dbh is created β it defers to whatever default DBD::MariaDB chooses instead.
returns the value of this attribute in the dbh, if one exists, or the value that will be set when the dbh is next created.
see the DBD::MariaDB documentation to learn more about this attribute.
β mariadb_bind_type_guessing [BOOL]
get or set the mariadb_bind_type_guessing database handle attribute. set directly on the dbh if one exists; otherwise it'll be set when the dbh is created. if no value for this attribute is defined (the default) then it will not be set when the dbh is created, deferring instead to whatever default value DBD::MariaDB chooses.
returns the value of this attribute in the dbh, if one exists, or the value that will be set when the dbh is next created.
see the DBD::MariaDB documentation to learn more about this attribute.
β mariadb_client_found_rows [BOOL]
get or set the mariadb_client_found_rows database handle attribute. it goes straight onto the dbh if one exists; otherwise it lands when the dbh is created. no value defined (the default)? then it's not set at creation time, and whatever DBD::MariaDB defaults to wins.
returns the value of this attribute in the dbh, if one exists, or the value that will be set when the dbh is next created.
see the DBD::MariaDB documentation to learn more about this attribute.
β mariadb_compression [BOOL]
get or set the mariadb_compression database handle attribute. set directly on the dbh if one exists; otherwise it will be set when the dbh is created. if no value for this attribute is defined (the default) then it will not be set when the dbh is created, deferring instead to whatever default value DBD::MariaDB chooses.
returns the value of this attribute in the dbh, if one exists, or the value that will be set when the dbh is next created.
see the DBD::MariaDB documentation to learn more about this attribute.
β mariadb_connect_timeout [BOOL]
get or set the mariadb_connect_timeout database handle attribute. set directly on the dbh if one exists; otherwise it'll be set when the dbh is created. if no value for this attribute is defined (the default) then it will not be set when the dbh is created, deferring instead to whatever default value DBD::MariaDB chooses.
returns the value of this attribute in the dbh, if one exists, or the value that will be set when the dbh is next created.
see the DBD::MariaDB documentation to learn more about this attribute.
β mariadb_embedded_groups [STRING]
get or set the mariadb_embedded_groups database handle attribute. set directly on the dbh if one exists; otherwise it will be set when the dbh is created. if no value for this attribute is defined (the default) then it will not be set when the dbh is created, deferring instead to whatever default value DBD::MariaDB chooses.
returns the value of this attribute in the dbh, if one exists, or the value that will be set when the dbh is next created.
see the DBD::MariaDB documentation to learn more about this attribute.
β mariadb_embedded_options [STRING]
get or set the mariadb_embedded_options database handle attribute. set directly on the dbh if one exists; otherwise it will be set when the dbh is created. if no value for this attribute is defined (the default) then it will not be set when the dbh is created, deferring instead to whatever default value DBD::MariaDB chooses.
returns the value of this attribute in the dbh, if one exists, or the value that will be set when the dbh is next created.
see the DBD::MariaDB documentation to learn more about this attribute.
β mariadb_enable_utf8 [BOOL]
get or set the mariadb_enable_utf8 database handle attribute. β οΈ heads up, this one's a lil different: if a dbh already exists, it's set directly on the dbh by executing the SQL SET NAMES utf8. otherwise, it will be set when the dbh is created. if no value for this attribute is defined (the default) then it will not be set when the dbh is created, deferring instead to whatever default value DBD::MariaDB chooses.
returns the value of this attribute in the dbh, if one exists, or the value that will be set when the dbh is next created.
see the DBD::MariaDB documentation to learn more about this attribute.
β mariadb_enable_utf8mb4 [BOOL]
get or set the mariadb_enable_utf8mb4 database handle attribute. β οΈ another special one: if a dbh exists, it's set directly on the dbh by executing the SQL SET NAMES utf8mb4. otherwise it will be set when the dbh is created. if no value for this attribute is defined (the default) then it will not be set when the dbh is created, deferring instead to whatever default value DBD::MariaDB chooses.
returns the value of this attribute in the dbh, if one exists, or the value that will be set when the dbh is next created.
see the DBD::MariaDB documentation to learn more about this attribute.
β mariadb_local_infile [STRING]
get or set the mariadb_local_infile database handle attribute. set directly on the dbh if one exists; otherwise it will be set when the dbh is created. if no value for this attribute is defined (the default) then it will not be set when the dbh is created, deferring instead to whatever default value DBD::MariaDB chooses.
returns the value of this attribute in the dbh, if one exists, or the value that will be set when the dbh is next created.
see the DBD::MariaDB documentation to learn more about this attribute.
β mariadb_multi_statements [BOOL]
get or set the mariadb_multi_statements database handle attribute. set directly on the dbh if one exists; otherwise it will be set when the dbh is created. if no value for this attribute is defined (the default) then it will not be set when the dbh is created, deferring instead to whatever default value DBD::MariaDB chooses.
returns the value of this attribute in the dbh, if one exists, or the value that will be set when the dbh is next created.
see the DBD::MariaDB documentation to learn more about this attribute.
β mariadb_read_default_file [STRING]
get or set the mariadb_read_default_file database handle attribute. set directly on the dbh if one exists; otherwise it will be set when the dbh is created. if no value for this attribute is defined (the default) then it will not be set when the dbh is created, deferring instead to whatever default value DBD::MariaDB chooses.
returns the value of this attribute in the dbh, if one exists, or the value that will be set when the dbh is next created.
see the DBD::MariaDB documentation to learn more about this attribute.
β mariadb_read_default_group [STRING]
get or set the mariadb_read_default_group database handle attribute. set directly on the dbh if one exists; otherwise it will be set when the dbh is created. if no value for this attribute is defined (the default) then it will not be set when the dbh is created, deferring instead to whatever default value DBD::MariaDB chooses.
Returns the value of this attribute in the dbh, if one exists β or, if there's no dbh yet, the value that's gonna get set when the dbh is next created. π«
See the DBD::MariaDB documentation to learn more about this attribute. β¨
mariadb_socket [STRING]β get or set themariadb_socketdatabase handle attribute. π- Got a
dbhalready? Then it's set directly on thatdbh. Nodbhyet? It gets set the moment thedbhis created. - If no value is defined for this attribute β and that's the default, btw, no cap β then it will not be set when the
dbhis created, and we just defer to whatever default valueDBD::MariaDBchooses. π - Returns the value of this attribute in the
dbh, if one exists, or the value that will be set when thedbhis next created. - See the
DBD::MariaDBdocumentation to learn more about this attribute.
- Got a
mariadb_ssl [BOOL]β get or set themariadb_ssldatabase handle attribute. π- If a
dbhexists, it goes straight onto it. Otherwise it will be set when thedbhis created. - No value defined for this attribute (the default β¨) means it won't be set when the
dbhis created at all β we defer instead to whatever default valueDBD::MariaDBchooses. - Returns the value of this attribute in the
dbh, if one exists, or the value that will be set when thedbhis next created. - See the
DBD::MariaDBdocumentation to learn more about this attribute.
- If a
mariadb_ssl_ca_file [STRING]β get or set themariadb_ssl_ca_filedatabase handle attribute. π- It's set directly on the
dbhif one exists; if not, it gets set when thedbhis created. - If no value is defined for this attribute (that's the default, bestie π
), then it will not be set when the
dbhis created β we defer to whatever default valueDBD::MariaDBchooses. - Returns the value of this attribute in the
dbh, if one exists, or the value that will be set when thedbhis next created. - See the
DBD::MariaDBdocumentation to learn more about this attribute.
- It's set directly on the
mariadb_ssl_ca_path [STRING]β get or set themariadb_ssl_ca_pathdatabase handle attribute. ποΈ- When there's a
dbh, it gets set right on it. When there isn't, it'll be set once thedbhis created. - If no value for this attribute is defined (yes, that's the default π), it won't get set when the
dbhis created β instead we defer to whatever default valueDBD::MariaDBchooses. - Returns the value of this attribute in the
dbh, if one exists, or the value that will be set when thedbhis next created. - See the
DBD::MariaDBdocumentation to learn more about this attribute.
- When there's a
mariadb_ssl_cipher [STRING]β get or set themariadb_ssl_cipherdatabase handle attribute. π- Existing
dbh? Set directly on it. Nodbh? It'll be set when thedbhis created. - If there's no value defined for this attribute (the default, periodt), it will not be set when the
dbhis created, deferring instead to whatever default valueDBD::MariaDBchooses. - Returns the value of this attribute in the
dbh, if one exists, or the value that will be set when thedbhis next created. - See the
DBD::MariaDBdocumentation to learn more about this attribute.
- Existing
mariadb_ssl_client_cert [STRING]β get or set themariadb_ssl_client_certdatabase handle attribute. π- This one's set directly on the
dbhwhen one exists. Otherwise, it gets set when thedbhis created. - If no value for this attribute is defined (which is the default π«Ά), then it won't be set when the
dbhis created β we just defer to whatever default valueDBD::MariaDBchooses. - Returns the value of this attribute in the
dbh, if one exists, or the value that will be set when thedbhis next created. - See the
DBD::MariaDBdocumentation to learn more about this attribute.
- This one's set directly on the
mariadb_ssl_client_key [STRING]β get or set themariadb_ssl_client_keydatabase handle attribute. ποΈ- It gets set directly on the
dbhif one exists; otherwise it'll be set when thedbhis created. - No value defined for this attribute? That's the default π and it means nothing gets set when the
dbhis created β we defer to whatever default valueDBD::MariaDBchooses. - Returns the value of this attribute in the
dbh, if one exists, or the value that will be set when thedbhis next created. - See the
DBD::MariaDBdocumentation to learn more about this attribute.
- It gets set directly on the
mariadb_use_result [BOOL]β get or set themariadb_use_resultdatabase handle attribute. π- With a
dbhpresent it's set right on thedbh; without one, it gets set when thedbhis created. - If there's no value defined for this attribute (the default, as always), it will not be set when the
dbhis created, deferring instead to whatever default valueDBD::MariaDBchooses. - Returns the value of this attribute in the
dbh, if one exists, or the value that will be set when thedbhis next created. - See the
DBD::MariaDBdocumentation to learn more about this attribute.
- With a
π¦ Value Parsing and Formatting π¦
format_array ARRAYREF | LISTβ hand it a reference to an array or a list of values, and it hands back a specially formatted string. πundefcomes back if ARRAYREF points to an empty array, or if LIST wasn't passed at all.- The array or list must not contain undefined values. π
- If the resulting string ends up longer than
max_array_characters, it's a fatal error, no cap. π
format_interval DURATIONβ give it aDateTime::Durationobject and it returns a string formatted according to the rules of PostgreSQL's"INTERVAL"column type. β³- If DURATION is undefined, a
DateTime::Durationobject, a valid interval keyword (pervalidate_interval_keyword), or if it looks like a function call (matches"/^\w+\(.*\)$/") andkeyword_function_callsis true, then it's returned unmodified. - If the resulting string is longer than
max_interval_characters, that's a fatal error. π
- If DURATION is undefined, a
format_set ARRAYREF | LISTβ give it a reference to an array or a list of values, and it returns a string formatted according to the rules of MariaDB's"SET"data type. πundefis returned if ARRAYREF points to an empty array, or if LIST isn't passed.- If the array or list contains undefined values, that's a fatal error. π
parse_array STRING | LIST | ARRAYREFβ parses STRING and returns a reference to an array. πΈ- STRING should be formatted according to the MariaDB array data type emulation format returned by
format_array(). Undef is returned if STRING is undefined. - If a LIST of more than one item is passed, you get back a reference to an array containing the values in LIST.
- If an ARRAYREF is passed, it's returned as-is. π
- STRING should be formatted according to the MariaDB array data type emulation format returned by
parse_interval STRINGβ parses STRING and returns aDateTime::Durationobject. π°οΈ- STRING should be formatted according to the PostgreSQL native
"interval"(years, months, days, hours, minutes, seconds) data type. - If STRING is a
DateTime::Durationobject, a valid interval keyword (pervalidate_interval_keyword), or if it looks like a function call (matches"/^\w+\(.*\)$/") andkeyword_function_callsis true, then it's returned unmodified. - Otherwise,
undefis returned if STRING could not be parsed as a valid"interval"value.
- STRING should be formatted according to the PostgreSQL native
parse_set STRING | LIST | ARRAYREFβ parses STRING and returns a reference to an array. β¨- STRING should be formatted according to MariaDB's
"SET"data type. Undef is returned if STRING is undefined. - If a LIST of more than one item is passed, a reference to an array containing the values in LIST is returned.
- If an ARRAYREF is passed, it's returned as-is. π«Ά
- STRING should be formatted according to MariaDB's
validate_date_keyword STRINGβ returns true if STRING is a valid keyword for the MariaDB"date"data type. π Valid (case-insensitive) date keywords are:
curdate()
current_date
current_date()
now()
sysdate()
00000-00-00
Any string that looks like a function call (matches /^\w+\(.*\)$/) is also considered a valid date keyword if keyword_function_calls is true.
validate_datetime_keyword STRINGβ returns true if STRING is a valid keyword for the MariaDB"datetime"data type, false otherwise. ποΈ Valid (case-insensitive) datetime keywords are:
curdate()
current_date
current_date()
current_time
current_time()
current_timestamp
current_timestamp()
curtime()
now()
sysdate()
0000-00-00 00:00:00
Any string that looks like a function call (matches /^\w+\(.*\)$/) is also considered a valid datetime keyword if keyword_function_calls is true. π«
validate_timestamp_keyword STRINGβ returns true if STRING is a valid keyword for the MariaDB"timestamp"data type, false otherwise. β±οΈ Valid (case-insensitive) timestamp keywords are:
curdate()
current_date
current_date()
current_time
current_time()
current_timestamp
current_timestamp()
curtime()
now()
sysdate()
0000-00-00 00:00:00
00000000000000
Any string that looks like a function call (matches /^\w+\(.*\)$/) is also considered a valid timestamp keyword if keyword_function_calls is true. π₯
π AUTHOR π
John C. Siracusa (siracusa@gmail.com) β the icon who wrote all this, we love to see it. π
π LICENSE π
Copyright (c) 2020 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. That's the whole vibe, bestie. π
And that's a wrap on this page! π It came from perl v5.40.1, dated 2026-07-31, and its home is Rose::...MariaDB(3pm). Go forth and query slayfully. π
π
π¦ 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