NAME
Mojo::Pg::Role::PromiseClass - Choose the Promise class used by Mojo::Pg
VERSION
version 0.001
SYNOPSIS
$pg = Mojo::Pg->new(...)->with_roles('+PromiseClass')
# add promise features you want
$pg->promise_roles('+Repeat');
# and they will show up on every query promise
$pg->db->select_p(...)->repeat(sub{...});
DESCRIPTION
Mojo::Pg::Role::PromiseClass is a role that allows specifying the promise class to be used for the promise-returning methods like "select_p" in Mojo::Pg::Database and "insert_p" in Mojo::Pg::Database, if you want something different from Mojo::Promise.
Note that if you are also using a custom database_class, you will need to extend it using "synopsis" in Mojo::Pg::Database::Role::PgPromiseClass.
ATTRIBUTES
Mojo::Pg::Role::PromiseClass inherits the following attributes from Mojo::Base::Role::PromiseClass
promise_class
$pclass = $pg->promise_class;
$pg = $pg->promise_class('Mojo::Promise');
Get or set the preferred promise class. This will be referenced by any db when creating query promises (via select_p, insert_p, ...)
For altering the promise class, you will more likely want to use promise_roles.
METHODS
Mojo::Pg::Role::PromiseClass inherits all methods (promise_roles) from Mojo::Base::Role::PromiseClass and does not define any new ones.
SEE ALSO
Mojo::Pg, Mojo::Promise, Mojolicious, Mojolicious::Guides, https://mojolicious.org.