Skip to content

Releases

0.5.4

Choose a tag to compare

@github-actions github-actions released this 22 Oct 00:24
a4b4078

SmartTableSync now shows up by name in SQL Server, the quick start explains a reused suffix
instead of failing in Terraform, and there are clear ways to give feedback.

Added

  • SmartTableSync's connections show up in SQL Server as SmartTableSync, and the scaffold tool's
    as SmartTableSync.Scaffold (APP_NAME(), sys.dm_exec_sessions.program_name), so a DBA can
    see which sessions are the sync. An Application Name in the connection string still wins.
    See connection strings.
  • Issue forms for bugs and feature requests, links to Discussions for questions and for sharing a
    setup, a contributing guide, and a feedback section in the README and on the
    NuGet package page.

Changed

  • The quick start stops before Terraform, with a clear message, when the suffix's resource group
    already exists but another folder or machine created it. Before, Terraform failed at apply with
    "a resource with the ID ... already exists". The docs say that acme1 is only an example.
  • A connection string that can't be read now stops the sync at startup with a message naming the
    setting (for example "ChildDbConnectionString isn't a valid connection string"), instead of at
    the first connection.

Upgrading

Nothing to change. If you filter SQL Server sessions or audit logs by program name, they now show
SmartTableSync instead of SqlClient's default; set Application Name in the connection strings
to keep a name of your own.

Tested

  • Unit and integration tests (303 and 74) pass, including new ones that check APP_NAME() and
    sys.dm_exec_sessions.program_name on a real SQL Server, with and without an Application Name in the connection string.
  • The quick start's suffix check on Azure: it stops for a resource group that exists but isn't in
    the folder's Terraform state, and continues for a new suffix, a deleted one, and the folder's own
    deployment.

Install: dotnet add package SmartTableSync --version 0.5.4, the scaffold tool:
dotnet tool install --global SmartTableSync.Scaffold --version 0.5.4, and the Azure Function template
with the quick start: dotnet new install SmartTableSync.Templates::0.5.4

0.5.3

Choose a tag to compare

@github-actions github-actions released this 20 Oct 22:20
60aaba8

Packaging only: the packages can now be debugged into and verified. The sync works exactly as in
0.5.2.

Changed

  • The SmartTableSync and SmartTableSync.Scaffold packages can be debugged into: their DLLs carry
    the debug symbols, with Source Link to the exact commit on GitHub, so a debugger steps into the
    source of the version you use. Release builds are deterministic, marked as CI builds.

Upgrading

Nothing to change.

Tested

  • The packed DLLs of both packages have the deterministic-build marker, the embedded debug
    symbols, the Source Link to the commit and the compiler flags.
  • Unit tests (298) pass; the release workflow runs the unit and integration tests and the template
    test before publishing.
  • The sync itself, on the 0.5.2 code that 0.5.3 keeps unchanged: an Azure quick start on three
    tables (Change Tracking, RowVersion and Timestamp) matched the parent row for row after many
    inserts, updates and deletes, small edge cases, and changes made while a sync was running.

Install: dotnet add package SmartTableSync --version 0.5.3, the scaffold tool:
dotnet tool install --global SmartTableSync.Scaffold --version 0.5.3, and the Azure Function template
with the quick start: dotnet new install SmartTableSync.Templates::0.5.3

0.5.2

Choose a tag to compare

@github-actions github-actions released this 20 Oct 10:55
6f67d64

Fixes the quick start in projects created from the template: in 0.5.1 it stopped when publishing
the Function. The library and the scaffold tool are unchanged apart from the version.

Fixed

  • The quick start in a project created from the smarttablesync-azure template stopped at
    publishing the Function ("Can't determine project language from files"): func read the
    runtime from local.settings.json, which such a project, like a fresh clone, doesn't have.
    deploy.ps1 and the demo's run-demo.ps1 now pass --dotnet-isolated.

Changed

  • Turning on Change Tracking is now the first step of the quick start, in the README's Get
    started
    , the NuGet guide and the template's READMEs.

Upgrading

Nothing to change in the databases or settings. For a project created from the 0.5.1 template,
either add --dotnet-isolated to the func azure functionapp publish line in
quickstart/deploy.ps1, or run dotnet new update and create the project again.

Tested

  • Both ways in the README's Get started, from nuget.org in empty folders:
    • Own app: a worker with the SmartTableSync package and SQL Server in Docker, with Change
      Tracking turned on as the guide says. The first run created the child table and copied
      1,000 rows; after updates, an insert and a delete in the parent, the next run synced 11 rows
      and 1 delete.
    • Azure Function: the template, Change Tracking turned on as the guide says, and
      deploy.ps1 with connection strings on two Azure SQL databases. The dry run, the setup
      (Terraform, publishing the Function, the first sync: 500 and 300 rows), -SyncNow after
      updates, inserts and a delete in the parent, and -Destroy all completed, with the child
      matching the parent row for row.
  • Unit and integration tests (298 and 72) pass.

Install: dotnet add package SmartTableSync --version 0.5.2, the scaffold tool:
dotnet tool install --global SmartTableSync.Scaffold --version 0.5.2, and the Azure Function template
with the quick start: dotnet new install SmartTableSync.Templates::0.5.2

0.5.1

Choose a tag to compare

@github-actions github-actions released this 20 Oct 08:47
a15332d

The quick start now comes from NuGet: a new template package creates the Azure Function and the
deploy script as a project of your own, so there's no need to clone the repository. The library
and the scaffold tool are unchanged apart from the version.

Added

  • SmartTableSync.Templates, a dotnet new template package. dotnet new install SmartTableSync.Templates, then dotnet new smarttablesync-azure -n MySync, creates a project
    of your own with the Azure Function (using the SmartTableSync package), the quick start script
    and its Terraform, and the scaffold tool as a local tool, all in the template's version. The
    quick start no longer needs a clone of the repository.

Changed

  • quickstart/deploy.ps1 runs the scaffold tool from NuGet (the project's
    .config/dotnet-tools.json) when it runs in a project created from the template, and from
    source in the repository, as before.
  • The Manual mode guide and the setup guide install the scaffold tool from NuGet instead of running
    it from the repository.

Upgrading

Nothing to change: no new settings, rights or schema scripts. Update with
dotnet add package SmartTableSync and dotnet tool update --global SmartTableSync.Scaffold.

Tested

  • Unit and integration tests (298 and 72) pass.
  • A project created from the template builds against the release's SmartTableSync package with no
    warnings, and runs the release's scaffold tool through its tool manifest; the release workflow
    checks this before publishing.
  • The quick start script's scaffold step runs both in a project created from the template and in
    the repository.

Install: dotnet add package SmartTableSync --version 0.5.1, the scaffold tool:
dotnet tool install --global SmartTableSync.Scaffold --version 0.5.1, and the Azure Function template
with the quick start: dotnet new install SmartTableSync.Templates::0.5.1

0.5.0

Choose a tag to compare

@github-actions github-actions released this 20 Oct 01:05
4f497ed

The first release on NuGet, as SmartTableSync
and SmartTableSync.Scaffold. It syncs
tables in any schema and tables without a primary key, copies decimal values exactly, runs in a
Linux container as well as in Azure Functions, and connects to Azure SQL with a managed identity
using the one package. A quick start sets up the sync between two existing Azure SQL databases with
one script.

Added

  • Publishing to NuGet (.github/workflows/publish.yml). Pushing a tag such as v0.5.0
    builds, tests and publishes SmartTableSync and SmartTableSync.Scaffold with that version,
    through nuget.org trusted publishing (no API key), after a maintainer approves the run. The
    version comes from the tag only; the project files hold a local default, 0.0.0-dev. See
    releasing.

  • Container host for Linux (SmartTableSync.Worker and its Dockerfile). It keeps running
    and syncs every SmartTableSync:Worker:IntervalMinutes (default 5), or syncs once and exits
    with --once, for a Kubernetes CronJob or an Azure Container Apps job. Settings come from
    environment variables, logs go to standard output, and metrics go over OTLP when
    OTEL_EXPORTER_OTLP_ENDPOINT is set. CI builds the image. See
    run it in a container.

  • Tables in schemas other than dbo. Name them schema.Table in SmartTableSync:TableList,
    the per-table settings and the scaffold tool (a plain Table still means dbo.Table). The
    child keeps the parent's schema; the table's procedures and table type are created in that
    schema, so tables with the same name in two schemas don't collide. The tracking tables stay in
    dbo. See ADR-0020.

  • Tables without a primary key. Such a table is keyed by its best unique index (all key
    columns NOT NULL, not filtered, not disabled; fewest columns, then lowest index_id), or by
    the columns in the new SmartTableSync:KeyColumns:<Table> setting ("ColA,ColB"), which are
    checked for duplicate values whenever the table is set up. The child table gets that key as its
    primary key. Change Tracking still requires a real primary key. Tables with a primary key are
    unaffected (same key, same schema fingerprint). See
    ADR-0021.

  • Quick start for existing databases (quickstart/). One script takes a parent and a child
    Azure SQL database you already have and a table list. It shows which strategy each table will
    get, creates the Function App with its managed identities (Terraform, nothing on the databases),
    creates the database users by SID with only the rights each needs, in Auto or Manual mode, and
    runs and checks the first sync. It also has -DryRun, -SyncNow and -Destroy. See
    quickstart/README.md.

Changed

  • The SmartTableSync package includes Microsoft Entra sign-in. It now depends on
    Microsoft.Data.SqlClient.Extensions.Azure, so managed identities and every other
    Authentication=Active Directory ... connection string work with this one package; a host no
    longer adds that package itself (one that already did can remove it). Hosts that only use SQL
    logins or Windows authentication get the Azure sign-in libraries too, unused.
  • The scaffold tool prefixes the files of a non-dbo table with the schema
    (sales.sp_SyncOrderBatch.sql); file names for dbo tables are unchanged.
  • A table name with more than one dot, or longer than 100 characters, is rejected at startup with
    a clear message. Names that contain a dot were never meant to work and are now read as
    schema.Table.
  • A table with no usable key at all now stops when it is set up, with a message naming
    SmartTableSync:KeyColumns:<Table>, instead of failing later in its first page query.
  • Documentation by task. The README starts with a guide for each way to run SmartTableSync:
    the demo, the quick start, Manual mode and
    Auto mode step by step (every scaffold command and SQL statement),
    and your own app (background service, Hangfire, Quartz.NET, with
    complete Program.cs files). Known limitations moved to their own page;
    the README keeps a summary and links to it and to the roadmap.

Fixed

  • decimal and numeric values were rounded in the child. Precision and scale weren't read
    from the parent, so the scaffold tool and Auto mode created decimal(10,2) as decimal,
    which SQL Server makes decimal(18,0): 99.95 arrived as 100, with no error. Tables, table types
    and procedures now get the parent's exact type, for datetime2(n), time(n) and
    datetimeoffset(n) too. A decimal or numeric column whose precision or scale differs from
    the parent is now detected, and the scaffold tool writes <Table>_AlterColumns.sql for it
    (see Upgrading below). This also closes the former limitation that such a change in the
    parent wasn't detected.
  • Measuring the largest value of (max) columns while profiling a table queried it without a
    schema, so it depended on the identity's default schema.
  • Running the demo a second time failed with "There is already an object named 'Product'":
    the script applied a CREATE TABLE script left from the first run. It now empties its
    generated-scripts folders first, applies *_AddColumns.sql and *_AlterColumns.sql, and has a
    table fixed by *_AlterColumns.sql copied again on the next sync.
  • The example Function sent only warnings and errors to Application Insights, and no
    smarttablesync.* metrics at all: the Application Insights SDK keeps only warnings from the
    worker by default, and no exporter was registered for the SmartTableSync meter. Its logs now
    go through the Functions host, so they arrive with their level and appear in the portal's Log
    stream like any Function's, and the metrics go through OpenTelemetry with the Azure Monitor
    exporter. See logs and metrics.

Upgrading

  • Tables with decimal or numeric columns are planned again on the first run after the
    upgrade (their schema fingerprint now includes precision and scale; other tables keep theirs).
    A child created by an earlier version has those columns as decimal(18,0) and rounded values:
    • The table stops with "column ... is decimal(18,0) in the child but decimal(10,2) in the
      parent"
      . Run the scaffold tool for it and apply <Table>_AlterColumns.sql to the child.
    • Auto mode then copies the table again by itself on the next run, so every value is exact.
    • Manual mode: also run the two DELETE statements at the end of that script, so the next
      run copies the table again; then apply the regenerated table type and procedure scripts.
  • Hosts that added Microsoft.Data.SqlClient.Extensions.Azure themselves can remove it; the
    package now brings it.

Tested

  • Automated, on every change: 298 unit tests and 72 integration tests against a real SQL
    Server 2022 (Testcontainers), including syncs that run as the three identities with exactly the
    documented grants, Auto mode creating and evolving the child's tables, tables in other schemas
    and without a primary key, and exact decimal values. CI also builds the container image and
    checks the Terraform, the NuGet packages for known vulnerabilities, and the code with Semgrep
    and CodeQL.
  • On Azure, with the demo (Azure SQL Database, Azure Functions Flex Consumption, managed
    identity): about 20,000 inserted, updated and deleted rows per table on Change Tracking,
    RowVersion and Timestamp tables, plus key changes, deleted and re-inserted rows, rows inserted
    and deleted between two runs, the same row updated 50 times, NULL and empty values, Unicode,
    decimal limits and rows over 1 MB. Parent and child matched row by row.
  • On Azure, with the quick start in Auto mode on two new databases: four tables on four
    strategies, then inserts, updates, deletes and a column added in the parent, which Auto mode
    added to the child. Parent and child matched row by row.
  • The container host, run once and running continuously, against SQL Server in Docker.
  • The NuGet packages: the release workflow published them, they install from nuget.org, the
    NuGet guide was followed step by step, and an app that references only
    SmartTableSync signs in to Azure SQL with Microsoft Entra.

Install: dotnet add package SmartTableSync --version 0.5.0, and the scaffold tool:
dotnet tool install --global SmartTableSync.Scaffold --version 0.5.0

v0.5.0-preview.1

v0.5.0-preview.1 Pre-release
Pre-release

Choose a tag to compare

@Sidorus Sidorus released this 20 Oct 00:24
ca4c85d

First preview published on NuGet.

New

  • Tables in schemas other than dbo: name them schema.Table; the child keeps the schema.
  • Tables without a primary key: keyed by a unique index or by SmartTableSync:KeyColumns:<Table>.
  • Container host for Linux (SmartTableSync.Worker + Dockerfile): runs continuously or once for a scheduler.
  • Quick start for existing Azure SQL databases, with managed identities or your own connection strings.
  • Published to NuGet from version tags with trusted publishing.

Fixed

  • decimal and numeric values were rounded in the child (decimal(10,2) was created as decimal(18,0)). Upgrading: see the changelog.
  • The example Function now sends Information logs and the smarttablesync.* metrics to Application Insights.

Full details: CHANGELOG.md

Install

dotnet add package SmartTableSync --version 0.5.0-preview.1
dotnet tool install --global SmartTableSync.Scaffold --version 0.5.0-preview.1