Conversation
- *Fixed:* The PostgreSQL `*_partition_order` index now correctly excludes the `event` column. - *Fixed:* The PostegrSQL `NOW()` function has removed incorrexct `AT TIME ZONE 'UTC'` as this is not required when the database timezone is set to UTC (which is the recommended configuration). - *Fixed:* The JSON/YAML data correctly supports `^xxx` and the legacy `(^xxx)` replacement formats.
There was a problem hiding this comment.
Pull request overview
Patch release v3.0.1 containing three small bug fixes: a PostgreSQL outbox index that was incorrectly including the event column, removal of redundant AT TIME ZONE 'UTC' clauses on NOW() in the Postgres outbox functions, and support for the bare ^xxx runtime/parameter replacement format (in addition to the legacy ^(xxx) form) in the JSON/YAML data parser. Also includes assorted comment/spelling tidy-ups ("leasee" → "lessee", outbox tenancy comments) and metadata/changelog updates.
Changes:
- Drop the
eventcolumn from the Postgres/SQL Server outbox*_partition_orderindex include list. - Replace
NOW() AT TIME ZONE 'UTC'with plainNOW()across the Postgres outbox function templates. - Add
^xxxparameter/runtime substitution support inDataParser.GetRuntimeParameterValue, plus matching test fixtures and a version/changelog bump.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Common.targets | Bump version to 3.0.1. |
| CHANGELOG.md | Add v3.0.1 release notes (contains typos). |
| schema/dbex.json | Update outbox schema/name titles to reference "related objects". |
| src/DbEx/CodeGen/Config/CodeGenConfig.cs | Mirror updated outbox titles/descriptions on the config properties. |
| src/DbEx/Migration/Data/DataParser.cs | Add new ^xxx runtime/parameter substitution path. |
| src/DbEx.Postgres/Resources/ScriptOutbox_pgsql.hbs | Drop event from partition-order index; reword tenancy/lease comments. |
| src/DbEx.Postgres/Templates/FnOutboxBatchCancel_pgsql.hbs | Use NOW() without AT TIME ZONE 'UTC'. |
| src/DbEx.Postgres/Templates/FnOutboxBatchClaim_pgsql.hbs | Same NOW() simplification. |
| src/DbEx.Postgres/Templates/FnOutboxBatchComplete_pgsql.hbs | Same NOW() simplification. |
| src/DbEx.Postgres/Templates/FnOutboxEnqueue_pgsql.hbs | Same NOW() simplification. |
| src/DbEx.Postgres/Templates/FnOutboxLeaseAcquire_pgsql.hbs | NOW() simplification and minor comment edit. |
| src/DbEx.Postgres/Templates/FnOutboxLeaseRelease_pgsql.hbs | Comment edits ("lessee", error-note trim). |
| src/DbEx.SqlServer/Resources/ScriptOutbox_sql.hbs | Drop Event from partition-order include list; comment tweaks. |
| src/DbEx.SqlServer/Templates/SpOutboxLeaseRelease_sql.hbs | "leasee" → "lessee" comment fix. |
| tests/DbEx.Test.Console/Data/Data.yaml | Use new ^jane_name parameter reference. |
| tests/DbEx.Test.Console/Migrations/008-create-test-outbox-tables.sql | "leasee" → "lessee" comment fix. |
| tests/DbEx.Test.Console/Program.cs | Register jane_name data-parser parameter. |
| tests/DbEx.Test.Console/Schema/Stored Procedures/spOutboxLeaseRelease.g.sql | Regenerated SQL with "lessee" wording. |
| tests/DbEx.Test/SqlServerMigrationTest.cs | Register jane_name parameter for SQL Server migration test. |
Comments suppressed due to low confidence (2)
src/DbEx/Migration/Data/DataParser.cs:326
- The new alternate runtime-parameter format introduced here (e.g.
^jane_name,^user_name,^now,^guid) is a new public-facing data-parsing feature, but there does not appear to be a dedicated unit test asserting that^xxx(without parentheses) resolves to a parameter value, runtime user name, current date-time, or new Guid. The only added test coverage uses it indirectly viam.Args.DataParserArgs.Parameters.Add("jane_name", "Jane")plus end-to-end assertions on the generated row. Consider adding a focused test inDataParserTest(or equivalent) for each of^user_name,^now,^guid, and^<parameter>to lock in the contract.
// Add alternate runtime format.
if (value.Length > 1 && value.StartsWith('^'))
{
var key = value[1..];
// Check against known values and runtime parameters.
switch (key)
{
case "user_name": return ParserArgs.UserName;
case "now": return ParserArgs.DateTimeNow;
case "guid": return Guid.NewGuid();
default:
if (ParserArgs.Parameters.TryGetValue(key, out object? dval))
return dval;
break;
}
}
src/DbEx/Migration/Data/DataParser.cs:325
- The known-key list for the new
^xxxformat (user_name,now,guid) duplicates the equivalent list for the^(xxx)format above (UserName,DateTimeNow,GuidNew) but with different identifiers. This means^nowworks but^DateTimeNowdoes not, and^(now)does not work either — the two formats use disjoint reserved-key vocabularies, which is likely to surprise users. Consider unifying the recognised keys (e.g. accept both spellings in each branch) or factoring the lookup into a single helper.
// Check against known values and runtime parameters.
switch (key)
{
case "user_name": return ParserArgs.UserName;
case "now": return ParserArgs.DateTimeNow;
case "guid": return Guid.NewGuid();
default:
if (ParserArgs.Parameters.TryGetValue(key, out object? dval))
return dval;
break;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Eric Sibly [chullybun] <eric@thesiblys.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Eric Sibly [chullybun] <eric@thesiblys.com>
*_partition_orderindex now correctly excludes theeventcolumn.NOW()function has removed incorrexctAT TIME ZONE 'UTC'as this is not required when the database timezone is set to UTC (which is the recommended configuration).^xxxand the legacy(^xxx)replacement formats.