Giter VIP home page Giter VIP logo

dbix-config's People

Contributors

symkat avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

dbix-config's Issues

Expose ->config_info

For cases like DBIx::Connector, and people who really don't want to DBIx::Config->connect() provide a method to get the configuration details, such that the following code does what you want.

#!/usr/bin/perl
use warnings;
use strict;
use DBIx::Connector;
use DBIx::Config;

my $conn = DBIx::Connector->new( DBIx::Config->connect_info( "MY_DATABASE" ) );

And, mst beat me to the patch:

diff --git a/lib/DBIx/Config.pm b/lib/DBIx/Config.pm
index 47ca6ae..d0bb9a7 100644
--- a/lib/DBIx/Config.pm
+++ b/lib/DBIx/Config.pm
@@ -28,7 +28,7 @@ sub new {
     return $self;
 }

-sub connect {
+sub connect_info {
     my ( $self, @info ) = @_;

     if ( ! ref $self eq __PACKAGE__ ) {
@@ -42,7 +42,12 @@ sub connect {
     $config = $self->default_load_credentials($config)
         unless $config->{dsn} =~ /dbi:/i;

-    return DBI->connect( $self->_dbi_credentials($config) );
+    return $self->_dbi_credentials( $config );
+}
+
+sub connect {
+    my ( $self, @info ) = @_;
+    return DBI->connect( $self->connect_info( @info ) );
 }

 # Normalize arguments into a single hash.  If we get a single hashref,

ENV Var for config_files

Allow a directory to be added to config_files through an environment variable so quicksilver likes it.

Config::Any - Add Docs

The documentation doesn't point out that Config::Any is being used and that config files will be tried for all the given extentions that are tried by Config::Any.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.