Fey/Role/SQL/HasBindParams.pm

filter: Statementstmt 100% 22 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 100% 30 / 30 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Fey/Role/Orderable.pm ↑ Summary Fey/Role/SQL/ReturnsData.pm »
1 package Fey::Role::SQL::HasBindParams;
2  
3 26 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 26 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 26 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 26 our $VERSION = '0.43';
8  
9 26 ▶use Fey::Types qw( ArrayRef Bool );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 26 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 has '_bind_params' => (
14 traits => ['Array'],
15 is => 'ro',
16 isa => ArrayRef,
17 220 ▶ default => sub { [] },
Subroutine __ANON__: called CC=1 SCAR=0.0
18 26 handles => { _add_bind_param => 'push' },
19 init_arg => undef,
20 );
21  
22 26 has 'auto_placeholders' => (
23 is => 'ro',
24 isa => Bool,
25 default => 1,
26 );
27  
28 # This needs to be a method and not a delegated method so it can be excluded
29 # by classes which need to exclude it.
30 sub bind_params {
31 11 ▶ return @{ $_[0]->_bind_params() };
Subroutine bind_params: called CC=1 SCAR=0.0
Pod documented
32 }
33  
34 26 1;
35  
36 # ABSTRACT: A role for queries which can have bind parameters
37  
38 __END__
39  
40 =pod
41  
42 =head1 NAME
43  
44 Fey::Role::SQL::HasBindParams - A role for queries which can have bind parameters
45  
46 =head1 VERSION
47  
48 version 0.43
49  
50 =head1 SYNOPSIS
51  
52 use Moose 2.1200;
53  
54 with 'Fey::Role::SQL::HasBindParams';
55  
56 =head1 DESCRIPTION
57  
58 Classes which do this role represent a query which can have bind
59 parameters.
60  
61 =head1 METHODS
62  
63 This role provides the following methods:
64  
65 =head2 $query->bind_params()
66  
67 Returns the bind params associated with the query.
68  
69 =head2 $query->auto_placeholders()
70  
71 This attribute determines whether values are automatically turned into
72 placeholders and stored as bind parameters.
73  
74 =head1 BUGS
75  
76 See L<Fey> for details on how to report bugs.
77  
78 =head1 AUTHOR
79  
80 Dave Rolsky <autarch@urth.org>
81  
82 =head1 COPYRIGHT AND LICENSE
83  
84 This software is Copyright (c) 2011 - 2015 by Dave Rolsky.
85  
86 This is free software, licensed under:
87  
88 The Artistic License 2.0 (GPL Compatible)
89  
90 =cut
« Fey/Role/Orderable.pm ↑ Summary Fey/Role/SQL/ReturnsData.pm »