public void CreateNormalSequence() { var sequenceManager = new SequenceManager(transaction); var sequenceName = ObjectName.Parse("APP.test_sequence"); var seqInfo = new SequenceInfo(sequenceName, new SqlNumber(0), new SqlNumber(1), new SqlNumber(0), new SqlNumber(Int64.MaxValue), 126); ISequence sequence =null; Assert.DoesNotThrow(() => sequence = sequenceManager.CreateSequence(seqInfo)); Assert.IsNotNull(sequence); }
public void CreateNativeSequence() { var sequenceManager = new SequenceManager(transaction); var tableName = ObjectName.Parse("APP.test_table"); var seqInfo = SequenceInfo.Native(tableName); ISequence sequence = null; Assert.DoesNotThrow(() => sequence = sequenceManager.CreateSequence(seqInfo)); Assert.IsNotNull(sequence); }
public void IncremementSequenceValue() { var sequenceManager = new SequenceManager(transaction); ISequence sequence = null; Assert.DoesNotThrow(() => sequence = sequenceManager.GetSequence(testSequenceName)); Assert.IsNotNull(sequence); SqlNumber currentValue = SqlNumber.Null; Assert.DoesNotThrow(() => currentValue = sequence.NextValue()); Assert.IsNotNull(currentValue); Assert.AreEqual(new SqlNumber(1), currentValue); }
private void InitManagers() { schemaManager = new SchemaManager(this); tableManager = new TableManager(this, TableComposite); sequenceManager = new SequenceManager(this); viewManager = new ViewManager(this); variableManager = new VariableManager(this); triggerManager = new TriggerManager(this); Managers = new ObjectManagersResolver(this); }
public SequenceTableContainer(SequenceManager manager) { transaction = manager.Transaction; this.manager = manager; }
public Sequence(SequenceManager manager, SqlNumber id, SqlNumber lastValue, SequenceInfo sequenceInfo) { this.manager = manager; Id = id; FullName = sequenceInfo.SequenceName; SequenceInfo = sequenceInfo; LastValue = lastValue; CurrentValue = lastValue; }
public Sequence(SequenceManager manager, SqlNumber id, SequenceInfo sequenceInfo) : this(manager, id, SqlNumber.Null, sequenceInfo) { }