... | ... |
@@ -1,4 +1,5 @@ |
1 | 1 |
0.1691 |
2 |
+ - added EXPERIMENTAL separater method |
|
2 | 3 |
- added EXPERIMENTAL select prefix option. |
3 | 4 |
- fixed bug that data_source DEPRECATED warnings pirnt STDERR |
4 | 5 |
- fixed bug that type_rule from option can't receive filter name |
... | ... |
@@ -997,6 +997,22 @@ sub select { |
997 | 997 |
return $result; |
998 | 998 |
} |
999 | 999 |
|
1000 |
+sub separator { |
|
1001 |
+ my $self = shift; |
|
1002 |
+ |
|
1003 |
+ if (@_) { |
|
1004 |
+ my $separator = $_[0] || ''; |
|
1005 |
+ croak qq{Separator must be "." or "__" or "-" } . _subname |
|
1006 |
+ unless $separator eq '.' || $separator eq '__' |
|
1007 |
+ || $separator eq '-'; |
|
1008 |
+ |
|
1009 |
+ $self->{separator} = $separator; |
|
1010 |
+ |
|
1011 |
+ return $self; |
|
1012 |
+ } |
|
1013 |
+ return $self->{separator} ||= '.'; |
|
1014 |
+} |
|
1015 |
+ |
|
1000 | 1016 |
sub setup_model { |
1001 | 1017 |
my $self = shift; |
1002 | 1018 |
|
... | ... |
@@ -2817,4 +2817,15 @@ $dbi->insert(table => 'table1', param => {key1 => 1, key2 => 2}); |
2817 | 2817 |
$rows = $dbi->select(prefix => 'key1,', column => 'key2', table => 'table1')->all; |
2818 | 2818 |
is_deeply($rows, [{key1 => 1, key2 => 2}], "table"); |
2819 | 2819 |
|
2820 |
+ |
|
2821 |
+test 'separator'; |
|
2822 |
+$dbi = DBIx::Custom->connect($NEW_ARGS->{0}); |
|
2823 |
+is($dbi->separator, '.'); |
|
2824 |
+$dbi->separator('-'); |
|
2825 |
+is($dbi->separator, '-'); |
|
2826 |
+$dbi->separator('__'); |
|
2827 |
+is($dbi->separator, '__'); |
|
2828 |
+eval { $dbi->separator('?') }; |
|
2829 |
+like($@, qr/Separator/); |
|
2830 |
+ |
|
2820 | 2831 |
=cut |