The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

MPMinus::Store::MultiStore - Multistoring

VERSION

Version 1.02

SYNOPSIS

    use MPMinus::Store::MultiStore;

    # Multistoring
    my $mso = new MPMinus::Store::MultiStore (
            -m   => $m, # OPTIONAL
            -mso => {
                
                foo => {
                    -dsn    => 'DBI:mysql:database=TEST;host=192.168.1.1',
                    -user   => 'login',
                    -pass   => 'password',
                    -attr   => {
                        mysql_enable_utf8 => 1,
                        RaiseError => 0,
                        PrintError => 0,
                    },
                },
                
                bar => {
                    -dsn    => 'DBI:Oracle:SID',
                    -user   => 'login',
                    -pass   => 'password',
                    -attr   => {
                        RaiseError => 0,
                        PrintError => 0,
                    },
                }, 
            },
        );

    my @stores = $mso->stores; # foo, bar
    
    $mso->set(baz => new MPMinus::Store::DBI( {
                -dsn    => 'DBI:Oracle:BAZSID',
                -user   => 'login',
                -pass   => 'password',
                -attr   => {
                    RaiseError => 0,
                    PrintError => 0,
                },
            })
        );
        
    my @stores = $mso->stores; # foo, bar, baz
    
    my $foo = $mso->get('foo');
    my $foo = $mso->store('foo');
    my $foo = $mso->foo;

DESCRIPTION

Multistoring Database independent interface for MPMinus on MPMinus::Store::DBI based.

See MPMinus::Store::DBI

METHODS

get, store
    my $foo = $mso->get('foo');
    my $foo = $mso->store('foo');
    my $foo = $mso->foo;

Getting specified connection by name

set
    $mso->set(baz => new MPMinus::Store::DBI( {
                -dsn    => 'DBI:Oracle:BAZSID',
                -user   => 'login',
                -pass   => 'password',
                -attr   => {
                    RaiseError => 0,
                    PrintError => 0,
                },
            })
        );

Setting specified connection by name and returns state of operation

stores
    my @stores = $mso->stores; # foo, bar, baz

Returns current connections as list (array)

HISTORY

1.00 / 13.11.2010

Init version

1.01 / 22.12.2010

Äîáàâëåí ìåòîä ïîëó÷åíèÿ ñïèñêà ñòîðåñîâ

1.02 / Wed Apr 24 14:53:38 2013 MSK

General refactoring

SEE ALSO

MPMinus::Store::DBI, CTK::DBI, Apache::DBI, DBI

AUTHOR

Serz Minus (Lepenkov Sergey) http://serzik.ru <minus@mail333.com>

COPYRIGHT

Copyright (C) 1998-2013 D&D Corporation. All Rights Reserved

LICENSE

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See LICENSE file

1 POD Error

The following errors were encountered while parsing the POD:

Around line 114:

Non-ASCII character seen before =encoding in 'Äîáàâëåí'. Assuming CP1252