Rose::...formix(3pm)
π NAME π
Rose::DB::Informix β bestie, it's the Informix driver class for Rose::DB. That's the whole vibe. β¨
(Also, for the record, this is the Rose::...formix(3pm) page from User Contributed Perl Documentation, in case you were looking for the receipts. π§Ύ)
π SYNOPSIS π
use Rose::DB;
Rose::DB->register_db(
domain => 'development',
type => 'main',
driver => 'Informix',
database => 'dev_db',
host => 'localhost',
username => 'devuser',
password => 'mysecret',
server_time_zone => 'UTC',
);
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::Informix->max_array_characters(128);
$db = Rose::DB->new; # $db is really a Rose::DB::Informix-derived object
$dt = $db->parse_datetime_year_to_minute(...);
$val = $db->format_datetime_year_to_minute($dt);
$dt = $db->parse_datetime_year_to_second(...);
$val = $db->format_datetime_year_to_second($dt);
...
π¦ DESCRIPTION π¦
Okay so here's the tea β: Rose::DB blesses objects into a class derived from Rose::DB::Informix whenever the driver is "informix". This mapping of driver names β class names is configurable, so if you wanna remix it, go off. Check the docs for Rose::DB's new() and driver_class() methods for the full rundown. π
Heads up bestie: you cannot use this class directly. No cap. You gotta go throughRose::DBand let itsnew()method hand you back an object blessed into the right class for you, based on itsdriver_class()mappings. That's the whole point. π«Ά
Only the methods that are new or that behave differently from the ones in Rose::DB get documented here β the rest are living their best life in the Rose::DB docs. So go peep that for the full list of methods if you need it. β¨
π CLASS METHODS π
default_supports_limit_with_offset [BOOL]β get or set a boolean that says whether every Informix database you're planning to connect to supports theSELECT SKIP N FIRST M ...syntax. If it's left undefined, this feature gets looked up on a per-connection basis as needed. The default isundefined. πmax_array_characters [INT]β get or set the max length of the varchar columns used to emulate the array data type. The default value is255.
So here's the thing: Informix doesn't have a native ARRAY data type. Rude, I know. π But you can emulate it with a VARCHAR column and a specially formatted string. The formatting and parsing of that string is handled by the format_array() and parse_array() object methods. The maximum length limit is honored by the format_array() object method β so don't try to sneak past it. π
Now the good news: Informix does have a native SET data type, serviced by the parse_set() and format_set() object methods. If you don't care about the order of the stored values, that's a better choice than the emulated array data type. Slay. π₯
πΈ OBJECT METHODS πΈ
β¨ Value Parsing and Formatting β¨
format_array ARRAYREF | LISTβ hand it a reference to an array or just a list of values, and it returns a specially formatted string. It returnsundefifARRAYREFpoints to an empty array, or ifLISTisn't passed at all. Lowkey important: the array or list must not contain undefined values.
If the resulting string ends up longer than max_array_characters(), that's a fatal error. π So keep it in check.
format_date DATETIMEβ converts the DateTime objectDATETIMEinto the appropriate format for theDATEdata type. πformat_datetime DATETIMEβ converts the DateTime objectDATETIMEinto the appropriate format for theDATETIME YEAR TO SECONDdata type.format_datetime_year_to_fraction DATETIMEβ converts the DateTime objectDATETIMEinto the appropriate format for theDATETIME YEAR TO FRACTIONdata type.format_datetime_year_to_fraction_[1-5] DATETIMEβ converts the DateTime objectDATETIMEinto the appropriate format for theDATETIME YEAR TO FRACTION(N)data type, where N is an integer from 1 to 5. She's got range, literally. πformat_datetime_year_to_minute DATETIMEβ converts the DateTime objectDATETIMEinto the appropriate format for theDATETIME YEAR TO MINUTEdata type.format_datetime_year_to_month DATETIMEβ converts the DateTime objectDATETIMEinto the appropriate format for theDATETIME YEAR TO MONTHdata type.format_datetime_year_to_second DATETIMEβ converts the DateTime objectDATETIMEinto the appropriate format for theDATETIME YEAR TO SECONDdata type.format_set ARRAYREF | LISTβ give it an arrayref or a list of values and it returns a string formatted according to the rules of Informix'sSETdata type. ReturnsundefifARRAYREFpoints to an empty array or ifLISTwasn't passed. But watch out: if the array or list contains undefined values, that's a fatal error. πformat_timestamp DATETIMEβ converts the DateTime objectDATETIMEinto the appropriate format for theDATETIME YEAR TO FRACTION(5)data type. βparse_array STRING | LIST | ARRAYREFβ parsesSTRINGand hands you back a reference to an array.STRINGshould be formatted according to the Informix array data type emulation format returned byformat_array(). ReturnsundefifSTRINGis undefined.
If a LIST of more than one item is passed, you get a reference to an array containing the values in LIST. π«Ά
If an ARRAYREF is passed, it's returned as-is. No touchy. π
parse_boolean STRINGβ parsesSTRINGand returns a boolean value of1or0.STRINGshould be formatted according to Informix's nativebooleandata type. Acceptable values are't','T', or'1'for true, and'f','F', or'0'for false.
If STRING is a valid boolean keyword (per validate_boolean_keyword) or if it looks like a function call (matches /^\w+\(.*\)$/) and keyword_function_calls is true, then it gets returned unmodified β untouched, iconic. Returns undef if STRING couldn't be parsed as a valid boolean value. π
parse_date STRINGβ parsesSTRINGand returns a DateTime object.STRINGshould be formatted according to the InformixDATEdata type.
If STRING is a valid date keyword (per validate_date_keyword), it's returned unmodified. Returns undef if STRING couldn't be parsed as a valid DATE value.
parse_datetime STRINGβ parsesSTRINGand returns a DateTime object.STRINGshould be formatted according to the InformixDATETIME YEAR TO SECONDdata type.
If STRING is a valid datetime year to second keyword (per validate_datetime_year_to_second_keyword), it's returned unmodified. Returns undef if STRING couldn't be parsed as a valid DATETIME YEAR TO SECOND value. π
parse_datetime_year_to_fraction STRINGβ parsesSTRINGand returns a DateTime object.STRINGshould be formatted according to the InformixDATETIME YEAR TO FRACTIONdata type.
If STRING is a valid datetime year to fraction keyword (per validate_datetime_year_to_fraction_keyword), it's returned unmodified. Returns undef if STRING couldn't be parsed as a valid DATETIME YEAR TO FRACTION value.
parse_datetime_year_to_fraction_[1-5] STRINGβ these five methods parseSTRINGand return a DateTime object.STRINGshould be formatted according to the InformixDATETIME YEAR TO FRACTION(N)data type, where N is an integer from 1 to 5.
If STRING is a valid datetime year to fraction keyword (per validate_datetime_year_to_fraction_keyword), it's returned unmodified. Returns undef if STRING couldn't be parsed as a valid DATETIME YEAR TO FRACTION(N) value. β¨
parse_datetime_year_to_minute STRINGβ parsesSTRINGand returns a DateTime object.STRINGshould be formatted according to the InformixDATETIME YEAR TO MINUTEdata type.
If STRING is a valid datetime year to minute keyword (per validate_datetime_year_to_minute_keyword), it's returned unmodified. Returns undef if STRING couldn't be parsed as a valid DATETIME YEAR TO MINUTE value.
parse_datetime_year_to_month STRINGβ parsesSTRINGand returns a DateTime object.STRINGshould be formatted according to the InformixDATETIME YEAR TO MINUTEdata type.
If STRING is a valid datetime year to month keyword (per validate_datetime_year_to_month_keyword), it's returned unmodified. Returns undef if STRING couldn't be parsed as a valid DATETIME YEAR TO MONTH value.
parse_datetime_year_to_second STRINGβ parsesSTRINGand returns a DateTime object.STRINGshould be formatted according to the InformixDATETIME YEAR TO SECONDdata type.
If STRING is a valid datetime year to second keyword (per validate_datetime_year_to_second_keyword), it's returned unmodified. Returns undef if STRING couldn't be parsed as a valid DATETIME YEAR TO SECOND value. π₯
parse_set STRING | LIST | ARRAYREFβ parsesSTRINGand returns a reference to an array.STRINGshould be formatted according to Informix'sSETdata type. ReturnsundefifSTRINGis undefined.
If a LIST of more than one item is passed, you get a reference to an array containing the values in LIST. π
If an ARRAYREF is passed, it's returned as-is. Periodt. π
parse_timestamp STRINGβ parsesSTRINGand returns a DateTime object.STRINGshould be formatted according to the InformixDATETIME YEAR TO FRACTION(5)data type.
If STRING is a valid timestamp keyword (per validate_timestamp_keyword), it's returned unmodified. Returns undef if STRING couldn't be parsed as a valid DATETIME YEAR TO FRACTION(5) value. β
validate_boolean_keyword STRINGβ returns true ifSTRINGis a valid keyword for thebooleandata type of the current data source, false otherwise. The valid (case-insensitive) boolean keywords are:
TRUE
FALSE
validate_date_keyword STRINGβ returns true ifSTRINGis a valid keyword for the Informixdate, false otherwise. The valid (case-insensitive) date keywords are:
current
today
The keywords are not case sensitive. 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 ifSTRINGis a valid keyword for the Informixdatetime year to seconddata type, false otherwise. The valid (case-insensitive) datetime keywords are:
current
current year to second
current year to minute
current year to hour
current year to day
current year to month
today
The keywords are not case sensitive. Any string that looks like a function call (matches /^\w+\(.*\)$/) is also considered a valid datetime keyword if keyword_function_calls is true. β¨
okay bestie we're not done yet, there's more coming in part 2 π don't go anywhere π«Ά
validate_datetime_year_to_fraction_keyword STRING
okay bestie, this one does a vibe check on one specific thing: does STRING count as a valid keyword for the Informix "datetime year to fraction(n)" data type, where n is an integer from 1 to 5? Yes β true. No β false. Simple as that π
The valid "datetime year to fraction" keywords (case-insensitive, so don't stress about caps) are giving:
current
current year to fraction
current year to fraction(1)
current year to fraction(2)
current year to fraction(3)
current year to fraction(4)
current year to fraction(5)
current year to second
current year to minute
current year to hour
current year to day
current year to month
today
β¨ these keywords are not case sensitive, periodt.
and also β anything that looks like a function call (matches /^\w+\(.*\)$/) counts as a valid "datetime year to fraction" keyword too, but only if keyword_function_calls is true. no cap.
validate_datetime_year_to_minute_keyword STRING
same energy, different data type π Returns true if STRING is a valid keyword for the Informix "datetime year to minute" data type, false otherwise. The valid (case-insensitive) "datetime year to minute" keywords are:
current
current year to second
current year to minute
current year to hour
current year to day
current year to month
today
not case sensitive, bestie. and again: any string that looks like a function call (matches /^\w+\(.*\)$/) is also a valid "datetime year to minute" keyword when keyword_function_calls is true π¦
validate_datetime_year_to_month_keyword STRING
you guessed it, we're still validating πΈ Returns true if STRING is a valid keyword for the Informix "datetime year to month" data type, false otherwise. Valid (case-insensitive) "datetime year to month" keywords:
current
current year to second
current year to minute
current year to hour
current year to day
current year to month
today
keyword squad is not case sensitive. Any string that looks like a function call (matches /^\w+\(.*\)$/) is also considered a valid "datetime year to month" keyword if keyword_function_calls is true π
validate_datetime_year_to_second_keyword STRING
this one's the main character of datetime keywords ngl π Returns true if STRING is a valid keyword for the Informix "datetime year to second" data type, false otherwise. The valid (case-insensitive) datetime keywords are:
current
current year to second
current year to minute
current year to hour
current year to day
current year to month
today
keywords: not case sensitive, fr fr. Any string that looks like a function call (matches /^\w+\(.*\)$/) is also a valid "datetime year to second" keyword if keyword_function_calls is true π«
validate_timestamp_keyword STRING
last one, and it's the biggest list so obviously it ate π₯ Returns true if STRING is a valid keyword for the Informix "timestamp" data type, false otherwise. Valid (case-insensitive) timestamp keywords:
current
current year to fraction
current year to fraction(1)
current year to fraction(2)
current year to fraction(3)
current year to fraction(4)
current year to fraction(5)
current year to second
current year to minute
current year to hour
current year to day
current year to month
today
the keywords are not case sensitive π and yep β 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, the legend, the moment β¨
π 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 π«Ά this was Rose::...formix(3pm) from the User Contributed Perl Documentation, running perl v5.40.1, dated 2026-07-31. go forth and validate those keywords, you're literally gonna slay πβ¨π¦
π¦ 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