-
This is my code: START TRANSACTION;
START MIGRATION TO {
module default {
type User {
required property nickname -> str;
required property email -> str;
required property email_verified -> bool {
default := false;
};
required property password -> bytes;
required property created_at -> datetime {
default := datetime_current();
};
}
function create_user(nickname: str, ema: str, pass: bytes) -> optional User
{
volatility := 'VOLATILE';
using EdgeQL $$
WITH
MODULE deafult
conflicting := (
SELECT User {
created_at,
}
FILTER .nickname = <str>$nickname OR .email = <str>$email
LIMIT 2
)
SELECT conflicting
$$;
};
};
}; It gives an error: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's a bug. Currently, when an expression in schema is seen, the current module is injected automatically into a @vpetrovykh is currently reworking the expression normalization in #1522 to inject fully-qualifed names instead of injecting an alias, which would make it more robust. |
Beta Was this translation helpful? Give feedback.
It's a bug. Currently, when an expression in schema is seen, the current module is injected automatically into a
WITH
clause. However, it seems that it is appended to theWITH
clause instead of being injected as the first entry, and so your first declaration in theWITH
block does not "see" it (WITH
entries are processed in order).@vpetrovykh is currently reworking the expression normalization in #1522 to inject fully-qualifed names instead of injecting an alias, which would make it more robust.