geldata / geldata/gel-cli

Introducing `required` tuple results in layered errors

Open
#1,123 2 comments 1 reaction 0 assignees View on GitHub
triage
Dominant language
Rust
Stars
175
Forks
32
PR merge metrics
No merged PRs in 30d

Description

- EdgeDB Version: 3.3
- EdgeDB CLI Version: 3.5.0+e1ad387
- OS Version: macos 13.5

Steps to Reproduce:

1. Add required tuple property to a type
```
type Example {
required someTuple: tuple;
}
```
2. Migration produces the following prompt with strange `std|str` syntax
```
did you create property 'someTuple' of object type 'default::Example'? [y,n,l,c,b,s,q,?]
> y
Please specify an expression to populate existing objects in order to make property 'someTuple' of object type 'default::Example' required:
fill_expr> >{}
```
3. Change the set to be a tuple, error appears inline
```
fill_expr> >(a:="a_", b:="b_")1:17: token "," is not allowed in expression (try parenthesize the expression)
```
4. Add parens as suggested, different error
```
fill_expr> (>(a:="a_", b:="b_"))
error: InvalidReferenceError: type 'default::std' does not exist
┌─ :3:22

3 │ SET REQUIRED USING ((>(a:="a_", b:="b_")));
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ did you mean '.id'?

Rolling back last operation...
```

Workaround is to just put in the tuple directly. Filing for 1) the friction here and 2) in case it's a hint of a deeper CLI or compiler problem.
```
fill_expr> (a:="a_", b:="b_")
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.