-
Notifications
You must be signed in to change notification settings - Fork 9
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
How do I use tuple in C# call to _EdgeDBclient.QuerySingleAsync() #75
Comments
You could try this:
You might also consider breaking out |
Crossposting from Discord: from just looking at the code you provided, I noted some immediate problems:
for this error:
Its telling you that you're trying to cast a free object to a tuple, the |
Hi Quin,
Did you see my question on Discord / edgedb-net about nullable C# class
field that is getting runtime error "EdgeDB.MissingCodecException: Cannot
find valid codec for System.Nullable`1[System.DateTimeOffset]" ?
Sincerely and Thanks,
John Ritz, Software Engineer II
503-309-6411 cell
***@***.***
www.linkedin.com/in/johntritz
https://github.com/EncompassingResidential/Band-Tree
-
…On Wed, Jan 17, 2024 at 10:18 AM Quin Lynch ***@***.***> wrote:
Crossposting from Discord:
from just looking at the code you provided, I noted some immediate
problems:
- genres and labels are types within the schema, but in the code your
casting them to <array<str>> which doesn't insert/select them
- familyname in the code doesn't contain type casts for arguments,
resulting in this error:
QueryError: missing a type cast before the parameter
|
1 | INSERT Artist { artistname := <str>$name, othernames := <array<str>>$onam, wikipediapageid := <int32>$wpid, birthdate := <datetime>$bdat, familyname := { first := $fname, middle := $mname, last := $lname }, genres := <array<str>>$genr, labels := <array<str>>$labl, timestamp := <datetime>$ptst }
| ^^^^^^
for this error:
Code: " familyname := { first := <str>$fname, middle := <str>$mname, last := <str>$lname }, " +
Error: invalid target for property 'familyname' of object type 'default::Artist':
'std::FreeObject' (expecting 'tuple<first: std::str, middle: std::str, last: std::str>')
Its telling you that your trying to cast a free object to a tuple, the {
x := y, ...} syntax is a free object in EdgeDB, to specify a tuple you
can use (x, y, z, ...) syntax.
fixing these issues seems to work on my end
—
Reply to this email directly, view it on GitHub
<#75 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWOLCDNAVLEGVI5NYECF263YPAIVRAVCNFSM6AAAAABB5SXZJKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJWGM3DEMZVGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Describe the bug
I submitted a question in Discord -> EdgeDb -> edgedb-dotnet on Mon, 1/15/24
but no one has responded as of 1/16/24 14:58 PAC.
I've tried multiple options for using a tuple in an INSERT statement, but I keep getting different warnings returned from EdgeDB.
For Visual Studio 2022 C# .NET 7 code
$ edgedb --version
EdgeDB CLI 4.0.2+b26c502
Reproduction
Include the code that is causing the error:
Here is the default.esdl
Here is the C# code (below code is the multiple iterations I tried and the EdgeDB errors that were returned):
Here are the various versions I've tried and the error returned:
Expected behavior
Trying to not get and error and INSERT the C# tuple properly into the INSERT statement.
Versions (please complete the following information):
$ dotnet --version8.0.100
Frameworks
MicrosoftAspNetCoreApp
MicrosoftNETCoreApp
Packages
EdgeDB.Net.Driver (1.3.0)
MicrosoftAspNetCore.OpenApi (7.0.10)
Swashbuckle.AspNetCore (6.5.0)
System.Net.Http.Json (8.0.0)
edgedb-net
version:Additional context
The text was updated successfully, but these errors were encountered: