NAME

IO::Async::Pg - Async PostgreSQL client for IO::Async

SYNOPSIS

use IO::Async::Loop;
use IO::Async::Pg;

my $loop = IO::Async::Loop->new;
my $pg = IO::Async::Pg->new(
    dsn             => 'postgresql://user:pass@host/db',
    min_connections => 2,
    max_connections => 10,
);
$loop->add($pg);

my $conn = await $pg->connection;
my $result = await $conn->query('SELECT * FROM users WHERE id = $1', $id);
print $result->first->{name};

DESCRIPTION

WARNING: This is extremely beta software. The API is subject to change without notice. The author reserves the right to redesign, rename, or remove any part of the interface as the module matures. Use in production at your own peril.

IO::Async::Pg provides an async PostgreSQL client built on IO::Async and DBD::Pg's async query support. Features include:

  • Connection pooling with automatic management

  • Named and positional placeholders

  • Transaction support with savepoints

  • Cursor-based streaming for large result sets

  • LISTEN/NOTIFY pub/sub

AUTHOR

John Napiorkowski <jjn1056@yahoo.com>

LICENSE

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