Softpedia
 


LINUX CATEGORIES:



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

    DBIx::Composer 1.00

    Download button

    No screenshots available
    Downloads: 458  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.0/5)
    7 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Igor Plisco | More programs
    Perl Artistic License / FREE
    August 6th, 2008, 11:26 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    DBIx::Composer description

    A Perl module that composes and runs a SQL statement

    DBIx::Composer is a Perl module that composes and runs a SQL statement.

    SYNOPSIS

    use DBIx::Composer
    $cmd = new DBIx::Composer();
    $cmd->{table} = 'table1';
    $cmd->{fields} = 'name, email';
    $cmd->{where} = "where login = 'peter'";
    print $cmd->compose_select;
    # Prints "select name, surname from table1 where login = 'peter'"

    $dbh = open_database(); # Open database yourself
    use DBIx::Composer
    $cmd = new DBIx::Composer(dbh=>$dbh, debug=> 1);
    $cmd->{table} = 'table1';
    $cmd->{fields} = 'login, name, email';
    $cmd->{values} = "'john', 'John Smith', 'john@smith.com'";
    $cmd->insert();
    # Executes command "insert into table1 (login, name, email) values
    # ('john', 'John Smith', 'john@smith.com')"
    # Prints this command on STDERR before execution.

    This module helps you to compose and run SQL statements. First you create new object and fill its hash for common parts of SQL statements. Then you may either compose SQL statement from these parts or both compose and execute it.

    USAGE

    You connect to database using your favorite method of connection and supply DBIx::Composer object with standard database handler $dbh. If you don't plan to execute statements, you may omit connection to database.

    So, after creating new object you set its parameters, or SQL command parts. Modifiers for command, such as "where ...", "order ...", "limit ..." must be full modifiers like "where a=b", not only "a=b".

    You don't need to prepare() SQL fetch statements - they are prepared internally. You cant execute statements right after setting their parts - the module checks whether command has been composed, prepared and executed. Because of such behaviour don't try to reset command parts after executing, but better create new DBIx::Composer object.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    SQL statement | DBIx composer | Perl module | DBIx | SQL | statement

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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