Fix .NET SDK issue by specifying a namespace #129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the motivation?
The SDK was encountering errors with various operations (e.g., QUERY, RAWQUERY, SET, UPSERT) that interact directly with the database. This commit fixes the issue for SurrealDB V2.X, but it is not compatible with V1.X.
What does this change do?
Fixes #127:
Changes included:
What is your testing strategy?
Manual Testing
Initially, I encountered the error: There was a problem with the database: Specify a namespace to use when performing various database operations such as upsert, query, rawquery, set, and create.
To reproduce the issue, I created a simple .NET project with two types of applications: a console app and an MVC app with Dependency Injection (DI). I executed the operations that were triggering the error in both environments.
After identifying the root cause of the error, I applied a fix by ensuring that the correct namespace is specified in the HTTP headers.
I repeated the same operations (upsert, query, rawquery, set, and create) multiple times, confirming that the error no longer occurred and the database interactions proceeded as expected.
Additional Tests:
I tested multiple rawquery operations, created several sets and create operations, ensuring that the fix worked consistently across different scenarios and types of operations.
All tests passed without errors, and the operations successfully interacted with the correct namespace and database.
How to Verify the Changes:
Verify that the correct namespace is being used and that no errors related to namespace specification are thrown.
The operations should complete without errors, and the data should be correctly inserted or queried from the database.
Important
These changes are only supported in SurrealDB V2.X and will not work with V1.X.
Is this related to any issues?
Issue #127
#127
Have you read the Contributing Guidelines?