Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    DBIx::Connect 1.13

    Download button

    No screenshots available
    Downloads: 388  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.6/5)
    14 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    T. M. Brannon and Martin Jackson | More programs
    Perl Artistic License / FREE
    April 16th, 2008, 15:09 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    DBIx::Connect description

    A Perl module that allows DBI, DBIx::AnyDBD, and Alzabo database connection (info) via AppConfig

    DBIx::Connect is a Perl module that allows DBI, DBIx::AnyDBD, and Alzabo database connection (info) via AppConfig.

    SYNOPSIS

    # .cshrc
    setenv APPCONFIG /Users/metaperl/.appconfig
    setenv DBIX_CONN "${APPCONFIG}-dbi"

    # Note that the DBIX_CONN environment variable is now optional -
    # a file can be specified using the command line parameter
    # -dbix_conn_file, e.g.:
    perl dbi_script.pl -dbix_conn_file /Users/metaperl/.appconfig-dbi

    # Any number of blocks may be specified in the config file - one block
    # per connection handle. Any of the options specified in the file
    # can be overridden # by using the command line syntax shown below.

    # .appconfig-dbi
    [basic]
    user= postgres
    pass =
    dsn= dbi:Pg:dbname=mydb
    attr RaiseError = 0
    attr PrintError = 0
    attr Taint = 1

    [dev_db]
    user = root
    pass = w00t!
    dsn = dbi:mysql:database=mysqldb;host=localhost
    attr RaiseError = 1
    attr PrintError = 1

    # DBIx::AnyDBD usage:
    my @connect_data = DBIx::Connect->data_array('dev_db');
    my $dbh = DBIx::AnyDBD->connect(@connect_data, "MyClass");

    # Alzabo usage
    my %connect_data = DBIx::Connect->data_hash('dev_db');

    # pure DBI usage
    use DBIx::Connect;

    my $dbh = DBIx::Connect->to('dev_db');

    # over-ride .appconfig-dbi from the command line
    # not recommended for passwords as C will reveal the password
    perl dbi-script.pl basic -dbix_conn_file .appconfig-dbi
    -basic_user tim_bunce -basic_pass dbi_rocks
    perl dbi-script.pl basic -basic_attr "RaiseError=1"
    -basic_attr "Taint=0"

    # Note that all parameters can be specified on the command line,
    # so the file is not strictly necessary. As a practical matter,
    # this is not a likely scenario, but it is supported.
    perl dbi-script.pl -basic_user basic -basic_pass ""
    -basic_dsn "dbi:Pg:dbname=basic" -basic_attr "AutoCommit=0"


    DBIx::Connect will croak wth the DBI error if it cannot create a valid database handle.

    This module facilitates DBI -style, DBIx::AnyDBD -style, or Alzabo -style database connections for sites and applications which make use of AppConfig and related modules to configure their applications via files and/or command-line arguments.

    It provides three methods, to, data_array, and data_hash which return a DBI database handle and an array of DBI connection info, respectively.

    Each of the 4 DBI connection parameters (username, password, dsn, attr) can be defined via any of the methods supported by AppConfig, meaning via a configuration file, or simple-style command-line arguments. AppConfig also provides support for both simple and Getopt::Long style, but Getopt::Long is overkill for a module this simple.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    DBI connection | DBIx::AnyDBD connection | Perl module | DBI | DBIx::AnyDBD | Alzabo

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM