NAME

Beam::Make::DBI - A Beam::Make recipe for executing SQL queries

VERSION

version 0.003

SYNOPSIS

### container.yml
# A Beam::Wire container to configure a database connection to use
sqlite:
    $class: DBI
    $method: connect
    $args:
        - dbi:SQLite:conversion.db

### Beamfile
convert:
    $class: Beam::Wire::DBI
    dbh: { $ref: 'container.yml:sqlite' }
    query:
        - |
            INSERT INTO accounts ( account_id, address )
            SELECT
                acct_no,
                CONCAT( street, "\n", city, " ", state, " ", zip )
            FROM OLD_ACCTS

DESCRIPTION

This Beam::Make recipe class executes one or more SQL queries against the given DBI database handle.

ATTRIBUTES

dbh

Required. The DBI database handle to use. Can be a reference to a service in a Beam::Wire container using { $ref: "<container>:<service>" }.

query

An array of SQL queries to execute.

SEE ALSO

Beam::Make, Beam::Wire, DBI

AUTHOR

Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2020 by Doug Bell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.