NAME

Plack::App::ServiceStatus::DBIC - Check DBIC connection

VERSION

version 0.912

SYNOPSIS

my $schema     = YourApp::Schema->connect( ... );
my $status_app = Plack::App::ServiceStatus->new(
    app  => 'your app',
    DBIC => $schema,
);

CHECK

Gets dbh from the schema object and executes 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',
    DBIC          => [ $schema, '
      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.