TT#18776 add support to use a custom schema config file

* to use a custom schema config file:
        NGCP::Schema->new->connect({ config_file => 'filepath' });

    * it requires to look as:
        <config opt1="op1" opt2="opt2">
          <ngcp_connect_info>
            dsn...
          </ngcp_connect_info>

        </config>

Change-Id: I704ac7adfd9b1ecd431b4f51e76dc662711b69ae
changes/47/14747/1
Kirill Solomko 8 years ago
parent 36bfc880f6
commit 8c8c3fe9c3

@ -20,6 +20,9 @@ class_has('config', is => 'rw', isa => 'NGCP::Schema::Config', lazy => 1, defaul
sub connection { sub connection {
my ($self, $cfg) = @_; my ($self, $cfg) = @_;
if ($cfg->{config_file}) {
$self->config->config_file($cfg->{config_file});
}
unless(defined $cfg->{dsn}) { unless(defined $cfg->{dsn}) {
$cfg = $self->config->as_hash->{ngcp_connect_info}; $cfg = $self->config->as_hash->{ngcp_connect_info};
} }

Loading…
Cancel
Save