FP::DBI - DBI with results as lazy lists


    use FP::DBI;

    $dbh = FP::DBI->connect($data_source, $username, $auth, \%attr);

    # same as `DBI`:
    $sth = $dbh->prepare($statement);
    $rv = $sth->execute;

    # then:
    my $s = $sth->row_stream;    # purearrays blessed to FP::DBI::Row
    # or
    #my $s = $sth->array_stream; # arrays
    # or
    #my $s = $sth->hash_stream;  # hashes

    use PXML::XHTML;
      (TH($s->first->map (\&TD)),
       $s->rest->take (10)->map (sub {TR($_[0]->map (\&TD))}))


Get rows as items in a lazy linked list (functional stream).

NOTE: `DBI` is designed so that when running another `execute` on the same statement handle, fetching returns rows for the new execute; this means, a new execute makes it impossible to retrieve further results from the previous one. Thus if a result stream isn't fully used before a new `execute` or a different result request is being made, then the original stream can't be further evaluated anymore; to prevent this from happening, an interlock mechanism is built in that throws an error in this case.


DBI, FP::Stream


This is alpha software! Read the status section in the package README or on the website.