MSSQL implementation of -dt_get
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / SQLMaker / MSSQL.pm
CommitLineData
84ddb3da 1package # Hide from PAUSE
d5dedbd6 2 DBIx::Class::SQLMaker::MSSQL;
84ddb3da 3
d5dedbd6 4use base qw( DBIx::Class::SQLMaker );
84ddb3da 5
6#
7# MSSQL does not support ... OVER() ... RNO limits
8#
9sub _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 251;