public SequenceQuery(string insertQuery, string selectQuery, SequenceQueryCompartment compartment) { ArgumentValidator.EnsureArgumentNotNullOrEmpty(insertQuery, "insertQuery"); ArgumentValidator.EnsureArgumentNotNullOrEmpty(selectQuery, "selectQuery"); InsertQuery = insertQuery; SelectQuery = selectQuery; Compartment = compartment; }
public SequenceQueryBuilder(StorageDriver driver) { ArgumentValidator.EnsureArgumentNotNull(driver, "driver"); this.driver = driver; var providerInfo = driver.ProviderInfo; hasSequences = providerInfo.Supports(ProviderFeatures.Sequences); hasBatches = providerInfo.Supports(ProviderFeatures.DmlBatches); hasInsertDefaultValues = providerInfo.Supports(ProviderFeatures.InsertDefaultValues); storesAutoIncrementSettingsInMemory = providerInfo.Supports(ProviderFeatures.AutoIncrementSettingsInMemory); compartment = hasSequences || providerInfo.Supports(ProviderFeatures.TransactionalKeyGenerators) ? SequenceQueryCompartment.SameSession : SequenceQueryCompartment.SeparateSession; }