The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bif::DBW - read-write helper methods for a bif database

VERSION

0.1.0_28 (2014-09-23)

SYNOPSIS

    use strict;
    use warnings;
    use Bif::DBW;

    # Bif::DBW inherits Bif::DB -> DBIx::ThinSQL -> DBI.
    my $dbw = Bif::DBW->connect( $dsn );

    # Read and write operations on a bif database:

    $dbw->txn(sub {
        my ($old,$new) = $dbw->deploy;

        $dbw->xdo(
            insert_into => 'changes',
            values      => $hashref,
        );
    });

DESCRIPTION

Bif::DBW is a DBI derivative that provides various read-write methods for retrieving information from a bif repository. For a read-only equivalent see Bif::DB. The read-only and read-write parts are separated for security and performance reasons.

DBH METHODS

nextval( $name ) -> Int

Advance the sequence $name to its next value and return that value.

currval( $name ) -> Int

Return the current value of the sequence <$name>.

deploy -> (Int, Int)

Deploys the current Bif distribution schema to the database, returning the previous (possibly 0) and newly deployed versions.

SQLITE FUNCTIONS

The following SQL functions created using the user-defined-function feature of SQLite.

create_sequence()

TODO

nextval( $name ) -> Int

Advance the sequence $name to its next value and return that value.

currval( $name ) -> Int

Return the current value of the sequence <$name>.

debug()

TODO

sha1_hex()

TODO

agg_sha1_hex()

TODO

SEE ALSO

Bif::DB, DBIx::ThinSQL::Deploy

AUTHOR

Mark Lawrence <nomad@null.net>

COPYRIGHT AND LICENSE

Copyright 2013-2014 Mark Lawrence <nomad@null.net>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.