edgedb / edgedb-net

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

Please add an example with serialization/deserialization of tuples #69

Open mkhlsvn opened 1 year ago

mkhlsvn commented 1 year ago

It is not clear how to correctly access edgedb functions that return or accept unnamed tuples of values as input

For example in schema I define the function function getRepayment(id: uuid, amount: decimal) -> optional tuple<decimal, decimal, decimal, decimal, decimal, decimal> how to query it?

EncompassingResidential commented 1 year ago

Hi, I'm new to EdgeDB and only several months into C#. Their one Readme file here has some examples of serializing and deserializing from your EdgeDB. It doesn't appear to have specifically a Tuple in it, but maybe that's why you are asking.

quinchs commented 1 year ago

You can use the System.Tuple<T..> or System.ValueTuple<T..> types as a result of your query:

await client.QuerySingleAsync<(decimal, decimal, decimal, decimal, decimal, decimal)>("...");