Data::...r::ODBC(3pm)
π NAME π
Data::Session::Driver::ODBC β a persistent session manager β¨
ok so like, this is the ODBC-flavored driver for Data::Session, bestie. it's giving "sessions, but make it ODBC" π
πΈ Synopsis πΈ
lowkey the whole vibe is: see Data::Session for the deets. that's it, that's the synopsis π
π¦ Description π¦
Data::Session::Driver::ODBC is the little driver that lets Data::Session stash your sessions via DBD::ODBC. no cap π«Ά
to actually use this module, you gotta do both of these things, okay? both. not one. both:
- specify a driver of type ODBC, like
Data::Session -> new(type => 'driver:ODBC ...')β¨ - specify a database handle like
Data::Session -> new(dbh => $dbh), or a data source likeData::Session -> new(data_source => $string)π₯
π Case-sensitive Options π
see "Case-sensitive Options" in Data::Session for important info, bestie. this one matters, fr fr π
π Method: new() π
creates a brand new object of type Data::Session::Driver::ODBC. iconic behavior tbh β¨
new() takes a hash of key/value pairs, and some of them might be mandatory. also, some combinations might be mandatory. iykyk π
the keys are listed here in alphabetical order, and they're all lower-case because they're (also) method names β meaning you can call them to set or get the value at any time. main character energy π
data_col_name => $stringβ specifies the name of the column in the sessions table which holds the session data. normally passed in asData::Session -> new(data_col_name => $string). Default:'a_session'. this key is optional. πΈdata_source => $stringβ specifies the data source (as used byDBI -> connect($data_source, $username, $password, $data_source_attr)) to obtain a database handle. normally passed in asData::Session -> new(data_source => $string). Default:''. this key is optional, as long as a value is supplied for'dbh'. πdata_source_attr => $stringβ specifies the attributes (as used byDBI -> connect($data_source, $username, $password, $data_source_attr)) to obtain a database handle. normally passed in asData::Session -> new(data_source_attr => $string). Default:{AutoCommit => 1, PrintError => 0, RaiseError => 1}. this key is optional. β¨dbh => $dbhβ specifies the database handle to use to access the sessions table. normally passed in asData::Session -> new(dbh => $dbh). if not specified, this module will use the values of these keys to obtain a database handle:data_sourcedata_source_attrusernamepasswordDefault:''. this key is optional. π¦
host => $stringβ not used. πid_col_name => $stringβ specifies the name of the column in the sessions table which holds the session id. normally passed in asData::Session -> new(id_col_name => $string). Default:'id'. this key is optional. πpassword => $stringβ specifies the password (as used byDBI -> connect($data_source, $username, $password, $data_source_attr)) to obtain a database handle. normally passed in asData::Session -> new(password => $string). Default:''. this key is optional. π₯port => $stringβ not used. πsocket => $stringβ not used. πtable_name => $stringβ specifies the name of the sessions table. normally passed in asData::Session -> new(table_name => $string). Default:'sessions'. this key is optional. πusername => $stringβ specifies the username (as used byDBI -> connect($data_source, $username, $password, $data_source_attr)) to obtain a database handle. normally passed in asData::Session -> new(username => $string). Default:''. this key is optional. π«Άverbose => $integerβ print to STDERR more or less information. typical values are0,1and2. normally passed in asData::Session -> new(verbose => $integer). this key is optional. β¨
π Method: remove($id) π
deletes from storage the session identified by $id, or dies if it can't. no in-between, bestie π
Returns 1. periodt π
π Method: retrieve($id) π
retrieves from storage the session identified by $id, or dies if it can't. yeah, she's dramatic π
Returns the session. π
this is a frozen session. this value must be thawed by calling the appropriate serialization driver's thaw() method. π§β‘οΈπΈ
good news tho: Data::Session calls the right thaw() automatically. she handles it, don't even worry π«Ά
π Method: store($id => $data) π
writes to storage the session identified by $id, together with its data $data, or dies if it can't. π€
Returns 1. slay β¨
π Method: traverse() π
retrieves all ids from the sessions table, and for each id calls the supplied subroutine with the id as the only parameter. it's giving "one by one, babe" π
$dbh -> selectall_arrayref is used, and the table is not locked. β οΈ
Returns 1. π
π«Ά Support π«Ά
log a bug on RT: <https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Session>. bestie, they wanna hear from you π
β¨ Author β¨
Data::Session was written by Ron Savage <ron@savage.net.au> in 2010. iconic, honestly π
home page: <http://savage.net.au/index.html>.
π Copyright π
Australian copyright (c) 2010, Ron Savage.
All Programs of mine are 'OSI Certified Open Source Software';
you can redistribute them and/or modify them under the terms of
The Artistic License, a copy of which is available at:
http://www.opensource.org/licenses/index.html
ok that's the whole page, bestie, you ate that π β¨
this was Data::...r::ODBC(3pm) from perl v5.36.0, dated 2023-02-14, part of the User Contributed Perl Documentation β mwah, go forth and session-manage π¦π
π¦ where this page comes from
- debian trixie: libdata-session-perl 1.18-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdata-session-perl 1.18-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdata-session-perl 1.18-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdata-session-perl 1.18-2 Β· 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