Skip to content

9.48.0

Latest

Choose a tag to compare

@jeremydmiller jeremydmiller released this 02 Nov 14:36
3f5ece7

The parameter-type release. Full upgrade guide: https://weasel.jasperfx.net/release-9-48

Two behaviour changes

Both are narrow, and both are a one-line fix at the call site.

1. An unmapped type now defers instead of being guessed at (#758, #759 → #760).

A private helper in five providers ended in ?? <catch-all>, which can never return null — so determineParameterType always reported success and every branch after its first was dead code. On SQL Server the catch-all went out as sql_variant, which outranks every ordinary type in data type precedence, so comparing one against a column converted the column, once per row:

parameter column plan
DbType.Object uniqueidentifier Clustered Index Scan, CONVERT_IMPLICIT(sql_variant,[id],0)
DbType.Guid uniqueidentifier Clustered Index Seek

So a missing store<T>() was a performance bug, not a gap — on SQL Server that covered Guid, short, byte, float, char, DateOnly and TimeOnly. If you have ever measured a Weasel query scanning where it should seek, re-measure.

ToParameterType now throws for an unmapped type rather than answering with a character type; use TryGetDbType where you want the null. A DateTime parameter is now DateTime2, so the time of day survives — a bound 2026-10-30T13:45:12Z used to come back 2026-10-30T00:00:00. The generated column type stays datetime, so nobody gets a schema diff.

2. An enum binds as an integer unless told its EnumStorage (#761 → #774).

Measured against the column each provider's own GetDatabaseType generates — three of the six did not merely convert, they threw:

Provider old parameter type vs its AsInteger column vs its AsString column
SQL Server Variant throws throws
MySQL VarChar throws works
Oracle Varchar2 throws works
SQLite Text works (type affinity) stores the integer, not the name
PostgreSQL / Firebird Integer works wrong

ToParameterType, TryGetDbType and TryGetDbTypeForValue each gain an EnumStorage overload, defaulted on the interface.

If you store enums as strings on MySQL or Oracle, pass EnumStorage.AsString at the call site. That same code was already broken on the other four providers.

Fixes

  • DateOnly/TimeOnly on MySQL and Oracle (#763 → #772) — MySQL maps both. Oracle cannot bind either, against any OracleDbType, so it refuses with a message naming the conversion to make. EF Core is unaffected; Oracle.EntityFrameworkCore applies its own value converter.
  • SQL Server partition boundaries render invariantly (#764 → #770) — under th-TH a date boundary picked up the Buddhist calendar and rendered 543 years out; under fi-FI the : in HH:mm:ss rendered as .; sv-SE and friends write U+2212 for a negative sign, which applies to a plain int. PostgreSQL's numeric arm had the same defect and is fixed too.
  • SQL Server partition DDL is re-runnable (#765 → #771) — the generated script dropped a partition scheme still bound to the table it had just created, so a second run failed on any partitioned shape.
  • An sp_getapplock wait outlasts the command timeout (#766 → #768) — a requested wait of 30s or more silently had no effect, and a busy lock threw a raw SqlException instead of returning a failed AttainLockResult, which ResourceMigrationFailureMode.ContinueOnFailures can never rule on.

Documented, not changed

Strings on SQL Server are bound as non-Unicode on purpose (#762 → #773). nvarchar outranks varchar, so an NVarChar parameter against a varchar column converts the column and scans, while VarChar seeks against either shape. Both defaults are kept — AnsiString on the generic provider would truncate non-Latin1 text, and an nvarchar column type would be a schema diff for every existing column.

Dependencies

  • MySqlConnector 2.6.1, from 2.4.0 (#767), closing GHSA-473q-m89c-ghf8. Anyone on Weasel.MySql should take this release for that reason alone.
  • JasperFx / JasperFx.Events 2.98.0, from 2.90.2 (#769).

Also

The NuGet publish workflow now uses NuGet.org trusted publishing (OIDC) instead of a long-lived API key secret. No change to the packages.