DOKK / manpages / debian 12 / libapache-session-browseable-perl / Apache::Session::Browseable::MySQLJSON.3pm.en
Apache::Session::Browseable::MySQLJSON(3pm) User Contributed Perl Documentation Apache::Session::Browseable::MySQLJSON(3pm)

Apache::Session::Browseable::MySQL - Add index and search methods to Apache::Session::MySQL

Create table with columns for indexed fields. Example for Lemonldap::NG with optional virtual tables and indexes:

  CREATE TABLE sessions (
      id varchar(64) not null primary key,
      a_session json,
      as_wt varchar(32) AS (a_session->"$._whatToTrace") VIRTUAL,
      as_sk varchar(12) AS (a_session->"$._session_kind") VIRTUAL,
      as_ut bigint AS (a_session->"$._utime") VIRTUAL,
      as_ip varchar(40) AS (a_session->"$.ipAddr") VIRTUAL,
      KEY as_wt (as_wt),
      KEY as_sk (as_sk),
      KEY as_ut (as_ut),
      KEY as_ip (as_ip)
  ) ENGINE=InnoDB;

Use it with Perl:

  use Apache::Session::Browseable::MySQLJSON;
  my $args = {
       DataSource => 'dbi:mysql:sessions',
       UserName   => $db_user,
       Password   => $db_pass,
       LockDataSource => 'dbi:mysql:sessions',
       LockUserName   => $db_user,
       LockPassword   => $db_pass,
       # Choose your browseable fileds
       Index          => 'uid mail',
  };

Use it like Apache::Session::Browseable::MySQL

Apache::Session::browseable provides some class methods to manipulate all sessions and add the capability to index some fields to make research faster.

Apache::Session::Browseable::MySQLJSON implements it for MySQL databases using "json" type to be able to browse sessions.

THIS MODULE ISN'T USABLE WITH MARIADB FOR NOW.

Apache::Session, Apache::Session::Browseable::MySQL, <http://lemonldap-ng.org>

Xavier Guimard, <x.guimard@free.fr>

Copyright (C) 2009-2017 by Xavier Guimard
2013-2017 by Clement Oudot

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.

2022-12-07 perl v5.36.0