NAME

IO::Async::Pg::Connection - Async PostgreSQL connection

SYNOPSIS

my $conn = await $pg->connection;

# Positional placeholders
my $r = await $conn->query('SELECT * FROM users WHERE id = $1', $id);

# Named placeholders
my $r = await $conn->query(
    'SELECT * FROM users WHERE name = :name',
    { name => 'Alice' }
);

# With timeout
my $r = await $conn->query(
    'SELECT * FROM slow_view',
    { timeout => 30 }
);

# Release back to pool
$conn->release;

METHODS

query($sql, @args)

Execute a query asynchronously. Returns a Future that resolves to an IO::Async::Pg::Results object.

cancel

Cancel the current query.

release

Release the connection back to the pool.

AUTHOR

John Napiorkowski <jjn1056@yahoo.com>