NAME

Plack::App::ServiceStatus::DBIxConnector - Check DBIx::Connector connection

VERSION

version 0.908

SYNOPSIS

my $conn       = DBIx::Connector->new( ... );
my $status_app = Plack::App::ServiceStatus->new(
    app  => 'your app',
    DBIxConnector => $conn
);

CHECK

Uses DBIx::Connector->run to execute a query, per default select 1;. This query has to return 1 to indicate that everything is ok.

You can pass another query when loading Plack::App::ServiceStatus:

my $status_app = Plack::App::ServiceStatus->new(
    app           => 'your app',
    DBIxConnector => [ $conn, '
      SELECT CASE
          WHEN count(*) > 0 THEN 1
          ELSE 0
      END
      FROM some_table'
    ],
);

AUTHOR

Thomas Klausner <domm@plix.at>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 - 2022 by Thomas Klausner.

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