Apache...ostgres(3pm)
πΈ NAME πΈ
okay bestie, welcome to the Apache...ostgres(3pm) page β your User Contributed Perl Documentation moment β and it's all about Apache::Session::Browseable::Postgres. Literally: it adds index and search methods to Apache::Session::Postgres. that's the whole name, no cap π
β¨ SYNOPSIS β¨
okay so first things first: create a table with columns for the indexed fields. Example for Lemonldap::NG:
CREATE UNLOGGED TABLE sessions (
id varchar(64) not null primary key,
a_session text,
_whatToTrace text,
_session_kind text,
_utime bigint,
ipAddr varchar(64)
);
Add indexes, bestie:
CREATE INDEX uid1 ON sessions USING BTREE (_whatToTrace);
CREATE INDEX s1 ON sessions (_session_kind);
CREATE INDEX u1 ON sessions (_utime);
CREATE INDEX ip1 ON sessions USING BTREE (ipAddr);
Use it with Perl:
use Apache::Session::Browseable::Postgres;
my $args = {
DataSource => 'dbi:Pg:sessions',
UserName => $db_user,
Password => $db_pass,
Commit => 1,
# Choose your browseable fileds
Index => '_whatToTrace _session_kind _utime iAddr',
};
# Use it like Apache::Session
my %session;
tie %session, 'Apache::Session::Browseable::Postgres', $id, $args;
$session{uid} = 'me';
$session{mail} = 'me@me.com';
$session{unindexedField} = 'zz';
untie %session;
# Apache::Session::Browseable add some global class methods
#
# 1) search on a field (indexed or not)
my $hash = Apache::Session::Browseable::Postgres->searchOn( $args, 'uid', 'me' );
foreach my $id (keys %$hash) {
print $id . ":" . $hash->{$id}->{mail} . "\n";
}
# 2) Parse all sessions
# a. get all sessions
my $hash = Apache::Session::Browseable::Postgres->get_key_from_all_sessions();
# b. get some fields from all sessions
my $hash = Apache::Session::Browseable::Postgres->get_key_from_all_sessions('uid', 'mail')
# c. execute something with datas from each session :
# Example : get uid and mail if mail domain is
my $hash = Apache::Session::Browseable::Postgres->get_key_from_all_sessions(
sub {
my ( $session, $id ) = @_;
if ( $session->{mail} =~ /mydomain.com$/ ) {
return { $session->{uid}, $session->{mail} };
}
}
);
foreach my $id (keys %$hash) {
print $id . ":" . $hash->{$id}->{uid} . "=>" . $hash->{$id}->{mail} . "\n";
}
that's the whole flow, bestie: tie it, set fields, untie, then hit the class methods. iconic behavior π
π¦ DESCRIPTION π¦
so Apache::Session::Browseable provides some class methods to manipulate all sessions, and it adds the capability to index some fields to make research faster. Apache::Session::Browseable::Postgres implements it for PosqtgreSQL databases β yes, PosqtgreSQL with that exact spelling, we're not touching it π
π SEE ALSO π
go peek at <http://lemonldap-ng.org>, Apache::Session::Postgres β those are the SEE ALSO besties, fr fr π«Ά
π COPYRIGHT AND LICENSE π
2009-2025by Xavier Guimard2013-2025by ClΓ©ment Oudot2019-2025by Maxime Besson2013-2025by Worteks2023-2025by Linagora
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
that's the whole page, bestie π β this was Apache...ostgres(3pm), source/version perl v5.40.1, date 2026-05-14. mwah π«Ά periodt π
π¦ where this page comes from
- debian trixie: libapache-session-browseable-perl 1.3.16-1+deb13u1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libapache-session-browseable-perl 1.3.19-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms