Skip to content
This repository was archived by the owner on Mar 29, 2026. It is now read-only.

Sph 2026 03 21.01#58

Merged
sphildreth merged 2 commits into
mainfrom
sph-2026-03-21.01
Mar 22, 2026
Merged

Sph 2026 03 21.01#58
sphildreth merged 2 commits into
mainfrom
sph-2026-03-21.01

Conversation

@sphildreth
Copy link
Copy Markdown
Owner

This pull request introduces significant improvements to the .NET ADO.NET binding for DecentDB, focusing on enhanced prepared statement caching, improved handling of native assets, and better support for data types. It also adds a new maintenance utility for database vacuuming. Below are the most important changes:

Prepared Statement Management and Command Execution:

  • Added caching for prepared statements in DecentDBCommand, including logic to invalidate and reuse prepared statements when the SQL or connection changes, improving performance and correctness. Methods such as EnsurePreparedStatement, InvalidatePreparedStatement, and changes to property setters ensure the cache is properly managed. [1] [2] [3] [4] [5] [6] [7]
  • Refactored single-statement execution to use the new prepared statement cache, centralizing logic in ExecuteSingleNonQuery. [1] [2]

Data Type Handling Improvements:

  • Enhanced support for TIMESTAMP columns (type 17) and improved conversion for Guid, DateTime, and DateTimeOffset types in DecentDBDataReader. This includes new helper methods for consistent conversion from microseconds since Unix epoch and correct handling of BLOBs as GUIDs. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Native Asset Packaging:

  • Updated DecentDB.AdoNet.csproj to import a shared native assets property file and use MSBuild variables for runtime asset inclusion, making native library packaging more flexible and maintainable. [1] [2]

Maintenance Utilities:

  • Added a new static class DecentDBMaintenance providing an async method VacuumAtomicAsync to perform an offline vacuum of a database file using the DecentDB CLI, with support for atomic file swapping and optional backup creation.

These changes collectively improve the reliability, maintainability, and performance of the DecentDB .NET integration.

- Introduced FromUnixEpochMicroseconds method for better clarity in converting microseconds to DateTime.
- Updated GetInt64Value method to handle TIMESTAMP columns correctly.
- Modified DataReader to return DateTime for TIMESTAMP columns using the new conversion method.
- Added tests for TIMESTAMP columns to ensure correct metadata reporting and round-trip functionality.
- Implemented DecentDBMaintenance class for database file maintenance, including an atomic vacuum operation.
- Created DecentDB.NativeAssets.props for managing native asset paths across platforms.
- Updated project files to include native assets conditionally based on build outputs.
- Added comprehensive tests for maintenance operations to validate vacuum functionality.
- Documented the changesets implementation plan for better versioning and release management.
Copilot AI review requested due to automatic review settings March 22, 2026 13:29
@sphildreth sphildreth merged commit 6dcdccb into main Mar 22, 2026
11 of 12 checks passed
@sphildreth sphildreth deleted the sph-2026-03-21.01 branch March 22, 2026 13:31
@sphildreth sphildreth review requested due to automatic review settings March 23, 2026 22:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant