Skip to content

Conversation

@joelverhagen
Copy link
Member

  • I've read the guidelines for contributing and seen the walkthrough
  • I've posted a comment on an issue with a detailed description of how I am planning to contribute and got approval from a member of the team
    • Feel free to close the PR if this change is not desired.
  • The code builds and tests pass locally (also verified by our automated build checks)
  • Commit messages follow this format:
        Summary of the changes
        - Detail 1
        - Detail 2

        Fixes #bugnumber

@joelverhagen joelverhagen requested a review from a team as a code owner January 11, 2026 20:59
Copilot AI review requested due to automatic review settings January 11, 2026 20:59
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 adds support for binding Memory<byte> and ReadOnlyMemory<byte> types as SQLite parameters, addressing issue #37484. The implementation allows these modern memory types to be used interchangeably with byte arrays when binding parameter values.

Changes:

  • Extended SqliteValueBinder.Bind() method to handle Memory<byte> and ReadOnlyMemory<byte> by extracting their spans
  • Added type mappings for both memory types to SqliteType.Blob in the type mapping dictionary
  • Added comprehensive tests for both memory types, including slice operations and type inference

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Microsoft.Data.Sqlite.Core/SqliteValueBinder.cs Added binding logic for Memory and ReadOnlyMemory types, plus type mappings to SqliteType.Blob
test/Microsoft.Data.Sqlite.Tests/SqliteParameterTest.cs Added functional tests for Memory and ReadOnlyMemory binding with slice operations, plus type inference tests

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

@roji roji merged commit a0afcc4 into dotnet:main Jan 12, 2026
7 checks passed
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.

Support Memory and ReadOnlyMemory parameter binding in Microsoft.Data.Sqlite

2 participants