logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Description

       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.

Name

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

See Also

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

Synopsis

       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

See Also