Skip to content

Conversation

@thomhurst
Copy link
Owner

This PR contains the following updates:

Package Type Update Change
Npgsql nuget major 9.0.410.0.1

Release Notes

npgsql/npgsql (Npgsql)

v10.0.1

v9.0.4 contains several minor bug fixes.

Milestone issues

Full Changelog: npgsql/npgsql@v10.0.0...v10.0.1

v10.0.0

See the release notes.

The full list of changes is available here.

What's Changed

New Contributors

Full Changelog: npgsql/npgsql@v9.0.0...v10.0.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@thomhurst thomhurst added dependencies Pull requests that update a dependency file MAJOR renovate-bot labels Dec 21, 2025
Copilot AI review requested due to automatic review settings December 21, 2025 05:09
@thomhurst thomhurst enabled auto-merge (squash) December 21, 2025 05:09
Copy link

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

This PR updates the Npgsql dependency from version 9.0.4 to 10.0.1, representing a major version upgrade that includes significant breaking changes.

Key Changes

  • Upgrades Npgsql from 9.0.4 to 10.0.1 (major version bump)
  • Breaking changes include new default type mappings for date/time types (now maps to DateOnly/TimeOnly instead of DateTime)
  • Removes support for .NET 6.0
  • Adds new features including GSSAPI session encryption, SHA3 hash algorithms for SASL authentication, and improved OpenTelemetry support

<PackageVersion Include="MSTest.TestAdapter" Version="4.0.2" />
<PackageVersion Include="MSTest.TestFramework" Version="4.0.2" />
<PackageVersion Include="Npgsql" Version="9.0.4" />
<PackageVersion Include="Npgsql" Version="10.0.1" />
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

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

This major version update from Npgsql 9.0.4 to 10.0.1 includes breaking changes related to date/time type mappings. According to the release notes, version 10 now "Map[s] date/time to DateOnly/TimeOnly by default."

The codebase uses reader.GetDateTime() to read TIMESTAMP columns (e.g., in TodoRepository.cs lines 42, 69, 104, 137 and TodoTestBase.cs). With the new default type mappings in Npgsql 10, TIMESTAMP columns may map to different .NET types, which could cause runtime exceptions or unexpected behavior.

Consider either:

  1. Testing thoroughly to ensure the TIMESTAMP columns still map correctly to DateTime
  2. Explicitly configuring the legacy date/time mappings if needed using NpgsqlConnection.GlobalTypeMapper.UseLegacyTimestampBehavior() if the new behavior causes issues
  3. Verifying that PostgreSQL TIMESTAMP WITH TIME ZONE is being used (which continues to map to DateTime) rather than TIMESTAMP (which now maps to DateOnly/TimeOnly)
Suggested change
<PackageVersion Include="Npgsql" Version="10.0.1" />
<PackageVersion Include="Npgsql" Version="9.0.4" />

Copilot uses AI. Check for mistakes.
@claude
Copy link
Contributor

claude bot commented Dec 21, 2025

PR Review: Npgsql 9.0.4 to 10.0.1 Major Version Upgrade

This PR upgrades Npgsql from 9.0.4 to 10.0.1, a major version upgrade with breaking changes.

Positive Aspects

  • Only used in example projects, not core TUnit framework
  • Simple single-line change in centralized package management
  • Version 10.0.1 includes important bug fixes

Breaking Changes in Npgsql 10.0

  1. Type Mapping Changes: date/time now map to DateOnly/TimeOnly by default (was DateTime/TimeSpan)
  2. .NET 6.0 Support Removed: Requires .NET 8.0+ (TUnit uses net10.0 so OK)
  3. AOT Compatible: Aligns well with TUnit requirements

Code Quality Assessment

The existing code using Npgsql follows best practices:

  • Proper async/await with await using for disposables
  • Parameterized queries prevent SQL injection
  • Modern C# syntax (raw strings, collection expressions)
  • Uses TIMESTAMP for created_at column (confirmed at TodoTestBase.cs:79)

Recommendation: LGTM with Verification

This upgrade appears safe because:

  1. TUnit targets net10.0 (compatible)
  2. created_at uses TIMESTAMP not DATE (GetDateTime will work)
  3. Only affects example projects

Action Items:

  • Verify TUnit.Example.Asp.Net.TestProject tests pass
  • Monitor for runtime issues after merge

Future Enhancement: Consider NpgsqlDataSource instead of NpgsqlConnection for better pooling (not required for this PR)

References: https://www.npgsql.org/doc/release-notes/10.0.html

@claude
Copy link
Contributor

claude bot commented Dec 21, 2025

Pull Request Review

Summary

This PR upgrades Npgsql from version 9.0.4 to 10.0.1 (major version upgrade).

Analysis

Usage in Codebase

Npgsql is used exclusively in example/test code:

  • TUnit.Example.Asp.Net/Repositories/TodoRepository.cs - Basic CRUD operations
  • TUnit.Example.Asp.Net.TestProject/TodoTestBase.cs - Test infrastructure with table setup/teardown
  • Usage pattern: Standard NpgsqlConnection, NpgsqlCommand, parameter binding via AddWithValue

Breaking Changes in Npgsql 10.0

Based on the release notes, key breaking changes include:

  1. Dropped .NET 6.0 support - Only supports .NET 8+ (TUnit targets .NET 8+, so this is fine)
  2. Type mapping changes:
    • date/time now map to DateOnly/TimeOnly by default (instead of DateTime/TimeSpan)
    • cidr now maps to IPNetwork by default
  3. NativeAOT improvements - Better trimming and AOT compatibility

Impact Assessment

LOW RISK - The codebase usage is simple and does not rely on:

  • Changed default type mappings (uses basic types: int, string, boolean, DateTime)
  • Advanced features
  • .NET 6.0 (already on .NET 8+)

The existing code at TodoRepository.cs:42-43 and TodoTestBase.cs:79 uses reader.GetDateTime(3) and created_at TIMESTAMP which should continue to work as PostgreSQL TIMESTAMP (without time zone) still maps to DateTime.

Recommendations

  1. Approve the upgrade - No code changes needed
  2. ⚠️ Testing Required: Run the example/test suite to verify the integration still works
  3. 📝 Future Consideration: The Npgsql team has made performance improvements and better AOT support - beneficial for TUnit AOT compatibility goals (as mentioned in CLAUDE.md Rule 5)

Code Quality Notes

  • The existing usage follows good practices (proper await using for disposal, parameterized queries)
  • No security concerns - uses parameterized queries to prevent SQL injection
  • Consistent with TUnit modern C# style requirements

Pre-Commit Checklist (per CLAUDE.md)

  • ✅ Dependency update only (no code changes)
  • ⚠️ Action needed: Verify tests pass with the new version
  • ✅ No breaking changes expected based on usage patterns
  • ✅ No snapshot updates needed (not touching source generators or public APIs)

Verdict: ✅ APPROVE pending successful test execution of the example project.

This was referenced Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file MAJOR renovate-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants