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

Chapter 9: Errors that didn't occur, and a missing assert_single #135

Open
stevechen opened this issue Jul 25, 2024 · 0 comments
Open

Chapter 9: Errors that didn't occur, and a missing assert_single #135

stevechen opened this issue Jul 25, 2024 · 0 comments

Comments

@stevechen
Copy link

stevechen commented Jul 25, 2024

  1. this code
for character_name in {'John Seward', 'Quincey Morris', 'Arthur Holmwood'}
select character_name ++ ' is great';

was suppose to generate error according to the description, but it worked…

  1. this code didn't work:
for character_name in {'John Seward', 'Quincey Morris', 'Arthur Holmwood'}
union (
  insert NPC {
    name := character_name,
    places_visited := (select City filter .name = 'London'),
    lover := (select Person filter .name = 'Lucy Westenra'),
  }
);

It needs a assert_single on lover:

for character_name in {'John Seward', 'Quincey Morris', 'Arthur Holmwood'}
union (
  insert NPC {
    name := character_name,
    places_visited := (select City filter .name = 'London'),
    lover := assert_single((select Person filter .name = 'Lucy Westenra')),
  }
);
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

1 participant