Mojolicious::Plugin::PgURLHelper - Mojolicious Plugin
# Mojolicious $self->plugin('PgURLHelper'); # Mojolicious::Lite plugin 'PgURLHelper'; # Use the helper my $pg_url = $self->pg_url({host => 'localhost', database => 'foo', user => 'bar', pwd => 'baz'}); my $pg = Mojo::Pg->new($pg_url); $self->plugin('Minion', {Pg => $pg_url});
Mojolicious::Plugin::PgURLHelper is a Mojolicious plugin to easily create PostgreSQL URLs suitable for Mojo::Pg or Minion::Backend::Pg.
my $pg_url = $self->pg_url({host => 'localhost', database => 'foo', user => 'bar', pwd => 'baz'});
Arguments:
Returns a connection string suitable for Mojo::Pg or Minion::Backend::Pg on success.
Returns undef on failure. The reason of the failure is printed in Mojolicious log, severity: error.
Note that if you specify a user, you must specify a password, and vice versa.
Mojolicious::Plugin::PgURLHelper inherits all methods from Mojolicious::Plugin and implements the following new ones.
$plugin->register(Mojolicious->new);
Register plugin in Mojolicious application.
The latest source code can be browsed and fetched at:
https://framagit.org/luc/mojolicious-plugin-pgurlhelper git clone https://framagit.org/luc/mojolicious-plugin-pgurlhelper.git
Bugs and feature requests will be tracked at:
https://framagit.org/luc/mojolicious-plugin-pgurlhelper/issues
Luc DIDRY CPAN ID: LDIDRY ldidry@cpan.org https://fiat-tux.fr/
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
Mojolicious, Mojolicious::Guides, http://mojolicious.org.
To install Mojolicious::Plugin::PgURLHelper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::PgURLHelper
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::PgURLHelper
For more information on module installation, please visit the detailed CPAN module installation guide.