22 namespace Deveel.Data.Sql.Sequences {
42 var sequence = context.GetSequence(sequenceName);
44 throw new InvalidOperationException(String.Format(
"Sequence {0} was not found.", sequenceName));
46 return sequence.NextValue();
63 var sequence = context.GetSequence(sequenceName);
65 throw new InvalidOperationException(String.Format(
"Sequence {0} was not found.", sequenceName));
67 return sequence.GetCurrentValue();
81 var sequence = context.GetSequence(sequenceName);
83 throw new InvalidOperationException(String.Format(
"Sequence {0} was not found.", sequenceName));
85 sequence.SetValue(value);
static ISequence GetSequence(this IQuery context, ObjectName sequenceName)
Describes the name of an object within a database.
static SqlNumber GetCurrentValue(this IQuery context, ObjectName sequenceName)
Gets the current value of the sequence.
static SqlNumber GetNextValue(this IQuery context, ObjectName sequenceName)
Increments the sequence and returns the computed value.
static void SetCurrentValue(this IQuery context, ObjectName sequenceName, SqlNumber value)
Sets the current value of the sequence, overriding the increment mechanism in place.
DbObjectType
The kind of objects that can be handled by a database system and its managers
Represents a numberic sequence in a transaction.