Commit | Line | Data |
84ddb3da |
1 | package # Hide from PAUSE |
d5dedbd6 |
2 | DBIx::Class::SQLMaker::MSSQL; |
84ddb3da |
3 | |
d5dedbd6 |
4 | use base qw( DBIx::Class::SQLMaker ); |
84ddb3da |
5 | |
6 | # |
7 | # MSSQL does not support ... OVER() ... RNO limits |
8 | # |
9 | sub _rno_default_order { |
10 | return \ '(SELECT(1))'; |
11 | } |
12 | |
d42d4906 |
13 | { |
14 | my %part_map = ( |
15 | month => 'mm', |
16 | day_of_month => 'dd', |
17 | year => 'yyyy', |
18 | ); |
19 | |
20 | sub _datetime_sql { "DATEPART('$part_map{$_[1]}', $_[2])" } |
21 | sub _datetime_diff_sql { "DATEDIFF('$part_map{$_[1]}', $_[2], $_[3])" } |
22 | } |
23 | |
24 | |
84ddb3da |
25 | 1; |