| ... | ... |
@@ -330,11 +330,14 @@ sub execute {
|
| 330 | 330 |
|
| 331 | 331 |
# Tables |
| 332 | 332 |
unshift @$tables, @{$query->{tables} || []};
|
| 333 |
- my $main_table = pop @$tables; |
|
| 334 |
- $tables = $self->_remove_duplicate_table($tables, $main_table); |
|
| 335 |
- if (my $q = $self->_quote) {
|
|
| 336 |
- $q = quotemeta($q); |
|
| 337 |
- $_ =~ s/[$q]//g for @$tables; |
|
| 333 |
+ my $main_table = @{$tables}[-1];
|
|
| 334 |
+ if (@$tables > 1) {
|
|
| 335 |
+ # DEPRECATED logic |
|
| 336 |
+ $tables = $self->_remove_duplicate_table($tables, $main_table); |
|
| 337 |
+ if (my $q = $self->_quote) {
|
|
| 338 |
+ $q = quotemeta($q); |
|
| 339 |
+ $_ =~ s/[$q]//g for @$tables; |
|
| 340 |
+ } |
|
| 338 | 341 |
} |
| 339 | 342 |
|
| 340 | 343 |
# Type rule |
| ... | ... |
@@ -1840,6 +1843,10 @@ Create C<where> clause flexibly |
| 1840 | 1843 |
|
| 1841 | 1844 |
=item * |
| 1842 | 1845 |
|
| 1846 |
+Named place holder support |
|
| 1847 |
+ |
|
| 1848 |
+=item * |
|
| 1849 |
+ |
|
| 1843 | 1850 |
Model support |
| 1844 | 1851 |
|
| 1845 | 1852 |
=item * |
| ... | ... |
@@ -1869,7 +1876,7 @@ L<DBIx::Custom::Guide> - How to use L<DBIx::Custom> |
| 1869 | 1876 |
L<DBIx::Custom Wiki|https://github.com/yuki-kimoto/DBIx-Custom/wiki> |
| 1870 | 1877 |
- Theare are various examples. |
| 1871 | 1878 |
|
| 1872 |
-Mosdule documentations - |
|
| 1879 |
+Module documentations - |
|
| 1873 | 1880 |
L<DBIx::Custom::Result>, |
| 1874 | 1881 |
L<DBIx::Custom::Query>, |
| 1875 | 1882 |
L<DBIx::Custom::Where>, |
| ... | ... |
@@ -1881,10 +1888,10 @@ L<DBIx::Custom::Order> |
| 1881 | 1888 |
=head2 C<connector> |
| 1882 | 1889 |
|
| 1883 | 1890 |
my $connector = $dbi->connector; |
| 1884 |
- $dbi = $dbi->connector(DBIx::Connector->new(...)); |
|
| 1891 |
+ $dbi = $dbi->connector($connector); |
|
| 1885 | 1892 |
|
| 1886 |
-Connection manager object. if connector is set, you can get C<dbh> |
|
| 1887 |
-through connection manager. conection manager object must have C<dbh> mehtod. |
|
| 1893 |
+Connection manager object. if C<connector> is set, you can get C<dbh> |
|
| 1894 |
+through connection manager. Conection manager object must have C<dbh> mehtod. |
|
| 1888 | 1895 |
|
| 1889 | 1896 |
This is L<DBIx::Connector> example. Please pass |
| 1890 | 1897 |
C<default_dbi_option> to L<DBIx::Connector> C<new> method. |
| ... | ... |
@@ -2149,19 +2156,19 @@ or the count of affected rows when insert, update, delete statement is executed. |
| 2149 | 2156 |
|
| 2150 | 2157 |
Named placeholder such as C<:title> is replaced by placeholder C<?>. |
| 2151 | 2158 |
|
| 2152 |
- # Before |
|
| 2159 |
+ # Original |
|
| 2153 | 2160 |
select * from book where title = :title and author like :author |
| 2154 | 2161 |
|
| 2155 |
- # After |
|
| 2162 |
+ # Replaced |
|
| 2156 | 2163 |
select * from where title = ? and author like ?; |
| 2157 | 2164 |
|
| 2158 | 2165 |
You can specify operator with named placeholder |
| 2159 | 2166 |
by C<name{operator}> syntax.
|
| 2160 | 2167 |
|
| 2161 |
- # Before |
|
| 2168 |
+ # Original |
|
| 2162 | 2169 |
select * from book where :title{=} and :author{like}
|
| 2163 | 2170 |
|
| 2164 |
- # After |
|
| 2171 |
+ # Replaced |
|
| 2165 | 2172 |
select * from where title = ? and author like ?; |
| 2166 | 2173 |
|
| 2167 | 2174 |
The following opitons are available. |