.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Class::DBI::Query 3pm" .TH Class::DBI::Query 3pm "2022-03-28" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Class::DBI::Query \- Deprecated SQL manager for Class::DBI .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 8 \& my $sth = Class::DBI::Query \& \->new({ \& owner => $class, \& sqlname => $type, \& essential => \e@columns, \& where_columns => \e@where_cols, \& }) \& \->run($val); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This abstracts away many of the details of the Class::DBI underlying \s-1SQL\s0 mechanism. For the most part you probably don't want to be interfacing directly with this. .PP The underlying mechanisms are not yet stable, and are subject to change at any time. .SH "OPTIONS" .IX Header "OPTIONS" A Query can have many options set before executing. Most can either be passed as an option to \fBnew()\fR, or set later if you are building the query up dynamically: .SS "owner" .IX Subsection "owner" The Class::DBI subclass that 'owns' this query. In the vast majority of cases a query will return objects \- the owner is the class of which instances will be returned. .SS "sqlname" .IX Subsection "sqlname" This should be the name of a query set up using set_sql. .SS "where_clause" .IX Subsection "where_clause" This is the raw \s-1SQL\s0 that will substituted into the '\s-1WHERE\s0 \f(CW%s\fR' in your query. If you have multiple \f(CW%s\fR's in your query then you should supply a listref of where_clauses. This \s-1SQL\s0 can include placeholders, which will be used when you call \fBrun()\fR. .SS "essential" .IX Subsection "essential" When retrieving rows from the database that match the \s-1WHERE\s0 clause of the query, these are the columns that we fetch back and pre-load the resulting objects with. By default this is the Essential column group of the owner class. .SH "METHODS" .IX Header "METHODS" .SS "\fBwhere()\fP" .IX Subsection "where()" .Vb 1 \& $query\->where($match, @columns); .Ve .PP This will extend your '\s-1WHERE\s0' clause by adding a '\s-1AND\s0 \f(CW$column\fR = ?' (or whatever \f(CW$match\fR is, isntead of \*(L"=\*(R") for each column passed. If you have multiple \s-1WHERE\s0 clauses this will extend the last one.