[libdbd-pg-perl] 18/35: Clarify placeholder documentation

Christoph Berg myon at debian.org
Wed Sep 27 17:41:04 UTC 2017


This is an automated email from the git hooks/post-receive script.

myon pushed a commit to branch master
in repository libdbd-pg-perl.

commit 136f4006f6ae16f1ad2f67dde0a92af7f82f6686
Author: David Christensen <david at endpoint.com>
Date:   Wed Sep 20 16:01:03 2017 -0500

    Clarify placeholder documentation
---
 Pg.pm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Pg.pm b/Pg.pm
index 02f044e..66686a1 100644
--- a/Pg.pm
+++ b/Pg.pm
@@ -2531,6 +2531,15 @@ Again, you may set it param time as well:
     {pg_placeholder_nocolons => 1});
   $sth->execute(1);
 
+It should be noted that placeholders only work when used outside of a literal string context; i.e.,
+the following examples will B<not> define/use any placeholders due to appearing inside strings
+within the SQL:
+
+  $sth = $dbh->prepare(q{SELECT id FROM mytable WHERE text LIKE '%?'});
+  $dbh->do(q{DO LANGUAGE plpgsql $$ BEGIN RAISE NOTICE ?; END $$}, undef, $message);
+
+See the DBI placeholder documentation for more details.
+
 =head3 B<prepare_cached>
 
   $sth = $dbh->prepare_cached($statement, \%attr);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdbd-pg-perl.git



More information about the Pkg-perl-cvs-commits mailing list