Datacenter build and management service
Conch::DB::ResultsExist
A component for Conch::DB::ResultSet classes that provides the exists
method.
See also DBIx::Class::Helper::ResultSet::Shortcut::ResultsExist, which is not usable in its present form due to https://github.com/frioux/DBIx-Class-Helpers/issues/54.
This code is postgres-specific.
__PACKAGE__->load_components('+Conch::DB::ResultsExist');
Efficiently efficiently determines if a result exists, without needing to do a ->count
.
Essentially does:
select exists (select 1 from ... rest of your query ...);
Returns a value that you can treat as a boolean.
Copyright Joyent, Inc.
This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.