Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add batch upsert support for SQL Server Memory DB #489

Merged
merged 7 commits into from
May 18, 2024

Conversation

kbeaugrand
Copy link
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
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:/microsoft/kernel-memory/actions/runs/9132504455/job/25113991349?pr=489

@kbeaugrand
Copy link
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:/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
5 of 6 checks passed
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