Skip to content
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

Cannot select overloaded property #6695

Closed
CarsonF opened this issue Jan 11, 2024 · 4 comments
Closed

Cannot select overloaded property #6695

CarsonF opened this issue Jan 11, 2024 · 4 comments

Comments

@CarsonF
Copy link

CarsonF commented Jan 11, 2024

  • EdgeDB Version: 4.4+aa576e1
  • EdgeDB CLI Version: 4.0.2+500be79
  • OS Version: macOS 14.1.2

Steps to Reproduce:

I believe the link is correctly set in the insert statement, but the select query never gives it back - it's always an empty set.

select (insert Post {
  container := (select TranslationProject limit 1),
  body := to_json('{"hello":"world"}'),
  type := Post::Type.Note,
  shareability := Post::Shareability.External
}) {
  container
}

Here's the schema.

I think it's somehow related to the overloaded type.

module Mixin {
  abstract type Embedded {
    required single link container: default::Resource;

And then overloaded here to

module default {
  type Post extending Resource, Mixin::Embedded, Mixin::Owned {
    overloaded required single link container: Mixin::Postable;
@raddevon
Copy link
Contributor

I tried to reproduce with a simpler schema, and I'm having some trouble. I applied this schema:

module default {
  abstract type Animal {
    parent: Animal;
  }
  type Human extending Animal {
    overloaded parent: Human;
  }
}

and ran these two queries:

insert Human;
select (
  insert Human {parent := (select detached Human limit 1)}
) {parent};

This select-wrapped insert query does correctly produce a result with the parent object, so there must be some x-factor here, either in the query or in the schema… 🤔

@CarsonF
Copy link
Author

CarsonF commented Jan 19, 2024

I should clarify:

  • The query does successfully finish, and this field is required. So that leads me to believe that the relationship was stored, but obviously I could be wrong on this.
  • It's not just a select wrapped insert, but any select that fails to produce the linked object.

Based on recent conversations with @msullivan I'd believe that it could take a complex schema to reproduce this.

@CarsonF
Copy link
Author

CarsonF commented Jan 19, 2024

I actually cannot reproduce this now either.
I guess it's possible it was related to #6699 or #6706. I've since worked around those. And it appears to be working.
I'll try a few more things before closing.

@CarsonF
Copy link
Author

CarsonF commented Jan 19, 2024

Yeah I think I'm good here now. If I'm remembering correctly, this didn't happen with other objects as the container. It only happened with TranslationProjects. So that points to #6706, which came from my bug which had a rewrite on TranslationProject. Now that I have that commented out, as a work around, this appears to be fine. So closing this as a symptom of that same root issue.

@CarsonF CarsonF closed this as completed Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants