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.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    DBIx::TableHash 1.05

    Download button

    No screenshots available
    Downloads: 336  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Chris Thorman | More programs
    Perl Artistic License / FREE
    June 12th, 2006, 17:21 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    DBIx::TableHash description

    A Perl module that can tie a hash to a mysql table SQL utils.

    DBIx::TableHash is a Perl module that can tie a hash to a mysql table SQL utils.

    SYNOPSIS

    use DBIx::TableHash;
    my $DBHash = DBIx::TableHash->create_or_die
    (my $Params =
    {
    DBIDriver => 'mysql',
    Database => 'mydatabase',
    HostName => 'localhost',
    Port => undef,
    Login => '',
    Password => '',

    TableName => 'SalesPeople',
    KeyField => 'FullName',

    ## For multi-key lookup:
    FixedKeys => {AreaCode => 415,
    StatusCode => 'Active',
    RecordType => 'Primary'},

    ## To retrieve a single value:
    ValueField => 'PhoneNumber',

    ## ... or for "multi-value" retrieval...
    ValueField => undef,

    ## ... optionally specifying...
    RetrieveFields => [qw(Title Territory Quota)],

    ## For caching:
    CacheMode => 'CacheBeforeIterate'
    ## or...
    CacheMode => 'CacheOneTime'
    ## or...
    CacheMode => 'CacheNone'
    }
    );

    my �Hash; tie(�Hash, 'DBIx::TableHash', $Params);

    my $DBHash = DBIx::TableHash->create($Params) or die "Help!";
    my $DBHash = DBIx::TableHash->create_or_die($Params);

    my $DBHash = DBIx::TableHash->create_copy($Params) or die "Help!";
    my $DBHash = DBIx::TableHash->create_copy_or_die($Params);


    All parameters are passed via a single anonymous hash.

    All parameters are optional, but you'll almost always need to specify Database, TableName, and KeyField.

    Omitting ValueField puts the hash in "multi-value" mode, where you store/retrieve a hash of fields/values instead of a single value. In "multi-value" mode all fields in each record are retrieved on every fetch; RetrieveFields limits fields retrieved to a specified list.

    Specifying FixedKeys puts the hash in "multi-key" mode, in which only a subset of the database table, corresopnding to records that match the spec in FixedKeys, is operated on.

    Cache modes reduce querying, but lose synchronization and hog memory.
    The object is designed to be easy subclass. Try making a subclass that sets defaults for all or most of the parameters, so the caller doesn't have to supply any at instantiation time.

    "create_copy" methods efficiently create and return potentially huge untied hash "snapshot" of the same data that would have been retrieved by the corresponding tied hash.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Perl module | tie hash | mysql table | DBIx::TableHash | Perl | module

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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