Skip to content

v3.0.1#66

Merged
chullybun merged 5 commits into
mainfrom
v3.0.1
May 14, 2026
Merged

v3.0.1#66
chullybun merged 5 commits into
mainfrom
v3.0.1

Conversation

@chullybun
Copy link
Copy Markdown
Collaborator

  • 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.

- *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.
Copilot AI review requested due to automatic review settings May 14, 2026 18:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 event column from the Postgres/SQL Server outbox *_partition_order index include list.
  • Replace NOW() AT TIME ZONE 'UTC' with plain NOW() across the Postgres outbox function templates.
  • Add ^xxx parameter/runtime substitution support in DataParser.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 via m.Args.DataParserArgs.Parameters.Add("jane_name", "Jane") plus end-to-end assertions on the generated row. Consider adding a focused test in DataParserTest (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 ^xxx format (user_name, now, guid) duplicates the equivalent list for the ^(xxx) format above (UserName, DateTimeNow, GuidNew) but with different identifiers. This means ^now works but ^DateTimeNow does 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.

Comment thread CHANGELOG.md Outdated
Comment thread src/DbEx/CodeGen/Config/CodeGenConfig.cs Outdated
Comment thread src/DbEx/Migration/Data/DataParser.cs Outdated
chullybun and others added 3 commits May 14, 2026 11:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Eric Sibly [chullybun] <eric@thesiblys.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.

Comment thread CHANGELOG.md Outdated
Comment thread src/DbEx/Migration/Data/DataParser.cs
Comment thread src/DbEx/Migration/Data/DataParser.cs
Comment thread src/DbEx.Postgres/Templates/FnOutboxLeaseRelease_pgsql.hbs
Comment thread src/DbEx.Postgres/Templates/FnOutboxLeaseAcquire_pgsql.hbs
Comment thread src/DbEx.Postgres/Templates/FnOutboxLeaseAcquire_pgsql.hbs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Eric Sibly [chullybun] <eric@thesiblys.com>
@chullybun chullybun merged commit 52eadb9 into main May 14, 2026
3 of 4 checks passed
@chullybun chullybun deleted the v3.0.1 branch May 14, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants