Skip to content

v3.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 08 Oct 19:57
· 7 commits to main since this release
2a3ce78

The library is async only, every method takes a cancellation token, and there is a merge operation, a bulk copy that merges, and a transaction object on which the data methods run together. AGENT_PRIMER.md describes the whole library and every breaking change since 1.x.

Breaking changes

  • Every synchronous method is removed. Each server-facing method exists only as ...Async, and the methods that had no async form, the schema lookups, GetLastBackupDateTime, IndexCreate and IndexDrop, are ...Async now. To upgrade, append Async to the name and await the call. QueryBuilder and SQLServerConnectionString are unchanged.
  • Every method takes an optional CancellationToken as its last parameter. Existing calls compile unchanged, but assemblies built against 1.x or 2.x must be recompiled: the parameter changes the methods' signatures, so a DLL swapped under built code fails with MissingMethodException.
  • GetTableIndexs is renamed GetTableIndexesAsync.

Additions

  • MergeDataAsync merges one table into another with a MERGE statement: a target row whose key columns match a source row is updated, a source row with no match is inserted, and with deleteUnmatched a target row with no match is deleted. Every name is quoted as an identifier, and the method returns the number of rows affected.
  • BulkMergeAsync bulk copies a DataTable into a temporary table and merges it into the destination in one transaction, matching columns by name. It takes the same deleteUnmatched, a timeout for the copy and the merge, and batchSize.
  • Both take useTransaction, true by default, as BulkCopyAsync does.
  • BeginTransactionAsync returns a SQLServerTransaction: one connection and one transaction on which the queries, commands, inserts, updates, deletes, merges and bulk copies run together, with the same signatures as on SQLServerInstance. CommitAsync commits; disposing without a commit rolls back. It takes an optional IsolationLevel.
  • ExecuteTransactionAsync now runs through that object. Its behavior is unchanged.
  • SQLServerTransaction also carries IndexCreateAsync and IndexDropAsync, and savepoints: SaveAsync(name) marks one and RollbackToAsync(name) undoes the work since it while the transaction stays open.
  • The repository has a compatibility catalogue: scenarios that run on the 1.1.1 package and on the current library in CI, recording what each does, so every behavior change listed for 2.0.0 and 3.0.0 is observed on both.