@@ -30,7 +30,15 @@ public override bool SupportsLimitOffset
30
30
{
31
31
get { return true ; }
32
32
}
33
-
33
+
34
+ /// <summary>
35
+ /// Does this dialect support sequences?
36
+ /// </summary>
37
+ public override bool SupportsSequences
38
+ {
39
+ get { return true ; }
40
+ }
41
+
34
42
/// <summary>
35
43
/// Attempts to add a <c>LIMIT</c> clause to the given SQL <c>SELECT</c>.
36
44
/// Expects any database-specific offset and limit adjustments to have already been performed (ex. UseMaxForLimit, OffsetStartsAtOne).
@@ -64,5 +72,32 @@ public override SqlString GetLimitString(SqlString queryString, SqlString offset
64
72
65
73
return pagingBuilder . ToSqlString ( ) ;
66
74
}
75
+
76
+ /// <summary>
77
+ /// Generate the appropriate select statement to retrieve the next value
78
+ /// of a sequence.
79
+ /// </summary>
80
+ /// <param name="sequenceName">the name of the sequence </param>
81
+ /// <returns> String The "nextval" select string. </returns>
82
+ /// <remarks>This should be a "stand alone" select statement.</remarks>
83
+ public override string GetSequenceNextValString ( string sequenceName )
84
+ {
85
+ return "select " + GetSelectSequenceNextValString ( sequenceName ) + " as seq" ;
86
+ }
87
+
88
+ /// <summary>
89
+ /// Generate the select expression fragment that will retrieve the next
90
+ /// value of a sequence as part of another (typically DML) statement.
91
+ /// </summary>
92
+ /// <param name="sequenceName">the name of the sequence </param>
93
+ /// <returns> The "nextval" fragment. </returns>
94
+ /// <remarks>
95
+ /// This differs from <see cref="GetSequenceNextValString"/> in that this
96
+ /// should return an expression usable within another statement.
97
+ /// </remarks>
98
+ public override string GetSelectSequenceNextValString ( string sequenceName )
99
+ {
100
+ return "next value for " + sequenceName ;
101
+ }
67
102
}
68
- }
103
+ }
0 commit comments