Skip to content

Add batch upsert support for SQL Server Memory DB#489

Merged
dluc merged 7 commits intomicrosoft:mainfrom
kbeaugrand:batch-upsert-sqlserver-1
May 18, 2024
Merged

Add batch upsert support for SQL Server Memory DB#489
dluc merged 7 commits intomicrosoft:mainfrom
kbeaugrand:batch-upsert-sqlserver-1

Conversation

@kbeaugrand
Copy link
Copy Markdown
Contributor

@kbeaugrand kbeaugrand commented May 14, 2024

Related to #485

Implements batching upsert functionality in SQL Server Memory DB and updates documentation to reflect the new feature.

  • Code Enhancements:

    • Introduces the IMemoryDbBatchUpsert interface in SqlServerMemory.cs to support batch upsert operations.
    • Adds a new method BatchUpsertAsync for handling multiple record upserts in a batch, improving performance for bulk operations.
    • Modifies the UpsertAsync method to internally call BatchUpsertAsync, ensuring consistency in handling single and multiple record upserts.
    • Implements exception handling for batch upsert scenarios, including throwing an IndexNotFoundException when attempting to upsert to a non-existent index.
  • Documentation Updates:

    • Updates README.md in the SQL Server extension directory to include information about the new batch upsert feature.
    • Provides examples on how to use the BatchUpsertAsync method for efficient data insertion or updating.

For more details, open the Copilot Workspace session.

@kbeaugrand kbeaugrand requested a review from dluc as a code owner May 14, 2024 21:47
@dluc dluc added waiting for author Waiting for author to reply or address comments work in progress labels May 16, 2024
@dluc
Copy link
Copy Markdown
Collaborator

dluc commented May 17, 2024

@kbeaugrand:

Error: SqlServerMemory.cs(377,43): error CS8425: Async-iterator 'SqlServerMemory.BatchUpsertAsync(string, IEnumerable, CancellationToken)' has one or more parameters of type 'CancellationToken' but none of them is decorated with the 'EnumeratorCancellation' attribute, so the cancellation token parameter from the generated 'IAsyncEnumerable<>.GetAsyncEnumerator' will be unconsumed [/home/runner/work/kernel-memory/kernel-memory/extensions/SQLServer/SQLServer/SQLServer.csproj]

https://github.com/microsoft/kernel-memory/actions/runs/9132504455/job/25113991349?pr=489

@kbeaugrand
Copy link
Copy Markdown
Contributor Author

@kbeaugrand:

Error: SqlServerMemory.cs(377,43): error CS8425: Async-iterator 'SqlServerMemory.BatchUpsertAsync(string, IEnumerable, CancellationToken)' has one or more parameters of type 'CancellationToken' but none of them is decorated with the 'EnumeratorCancellation' attribute, so the cancellation token parameter from the generated 'IAsyncEnumerable<>.GetAsyncEnumerator' will be unconsumed [/home/runner/work/kernel-memory/kernel-memory/extensions/SQLServer/SQLServer/SQLServer.csproj]

https://github.com/microsoft/kernel-memory/actions/runs/9132504455/job/25113991349?pr=489

Should be fixed now.

@dluc dluc merged commit 197fbd9 into microsoft:main May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting for author Waiting for author to reply or address comments work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants