edgedb / edgedb-net

The official .NET client library for EdgeDB
https://edgedb.com
Apache License 2.0
82 stars 9 forks source link

How to insert data safely #64

Closed dodyg closed 1 year ago

dodyg commented 1 year ago

I don't find any documentation on how to insert data safely using the client.

For now I just build the string directly. Is this safe or is there a better way?

        await client.ExecuteAsync($$"""
            INSERT BlogPost {
                title := "{{input.Title}}",
                body := "{{input.Body}}",
                status := BlogPostStatus.Pending
            }
        """);

https://github.com/dodyg/practical-edgedb-net/blob/main/projects/simple-blog/Program.cs

dodyg commented 1 year ago

Never mind. Found the explanation here https://github.com/edgedb/edgedb-net/tree/dev/examples/EdgeDB.Examples.ExampleTODOApi