surrealdb / surrealdb.net

SurrealDB SDK for .NET
https://surrealdb.com
Apache License 2.0
95 stars 20 forks source link

Feature: modify RETURN value #150

Open J05HM0N5TER opened 18 hours ago

J05HM0N5TER commented 18 hours ago

Is your feature request related to a problem?

When I use Upsert, Insert, or Update, I want to be able to change the return value to NONE for performance improvements. I am migrating a lot of data and producing the ID's before I create them in SurrealDB and store them in Valkey, which I found is faster for storing simple mappings between strings and IDs. When I write the SurrealQL directly, then I can specify this, and it seems to give better performance.

Describe the solution

Provide an Enum for the return type as a parameter which has the options NONE, BEFORE, AFTER (the default). I am not sure if the others are practical when deserilising them into a C# object.

Alternative methods

Maybe have a separate function where it's called InsertWithoutRespose? I think this options is a lot worse than the primary solution idea.

SurrealDB version

2.1.0 for linux on x86_64

Package version(s)

 [net9.0]: 
 Top-level Package                                 Requested   Resolved
 > CsvHelper                                       33.0.1      33.0.1  
 > Microsoft.Data.Sqlite                           9.0.0       9.0.0   
 > Microsoft.EntityFrameworkCore                   9.0.0       9.0.0   
 > Microsoft.EntityFrameworkCore.Abstractions      9.0.0       9.0.0   
 > Microsoft.EntityFrameworkCore.Sqlite            9.0.0       9.0.0   
 > Microsoft.Extensions.Hosting                    9.0.0       9.0.0   
 > NRedisStack                                     0.13.0      0.13.0  
 > SurrealDb.Net                                   0.6.0       0.6.0   
 > System.Threading.Tasks.Dataflow                 9.0.0       9.0.0   

Contact Details

j05hm0n5ter@josh.slmail.me

Is there an existing issue for this?

Code of Conduct

Odonno commented 14 hours ago

Hello @J05HM0N5TER

Well, this is an interesting idea. However, the core database does not support this behavior at the moment. If you want to see something like this, I suggest you to create an issue in this repository. Once this is implemented in the core database, we could then implement this behavior in every SurrealDB SDK including the .NET one.

J05HM0N5TER commented 1 hour ago

@Odonno I don't understand, what do you mean by it doesn't support it? Is this something to do with the cbor communication or something? I linked documentation on how to do it using surrealQL, and I have used if myself.