edgedb
edgedb copied to clipboard
`missing FROM-clause entry for table` ISE on `update`
- EdgeDB Version: 4.7
- EdgeDB CLI Version: 4.0.2
- OS Version: macos 14
Steps to Reproduce: Reduced query + schema as much as possible. Simplifying anything eliminates the error.
update AuditLog set {
cost := (
(AuditLog.model.activePrice.dollar_price_per_thousand_prompt_tokens * <float64>AuditLog.rawModelResponse)
+
(AuditLog.model.activePrice.dollar_price_per_thousand_prompt_tokens * <float64>AuditLog.rawModelResponse)
)
}
InternalServerError: missing FROM-clause entry for table "q~4"
Schema:
type AuditLog {
rawModelResponse: json;
single model: FoundationModel;
cost: float64;
}
type FoundationModel {
single link activePrice := (
select .<FoundationModel[is FoundationModelPrice]
limit 1
);
}
type FoundationModelPrice {
required single link FoundationModel: FoundationModel;
required property dollar_price_per_thousand_prompt_tokens: float64;
}