Reads and writes · rule
query.not_unique
Query for one record can match several.
Area 6, Reads and writes; not declinable; the next step is usually the agent's.
type Title = Text { max_length: 80}entity Book { id: Uuid title: Title subtitle: Title? available: Bool}query book_titled(title: Book.title) -> Book? { from: Book where: Book.title == title}
error: A query returning `Book?` could match several records --> main.jadpo:14:5 |14 | where: Book.title == title | ^^^^^ not a unique field reason: `Book?` is at most one record, so a `where:` line must test a unique field with `==`: `Book.id`. next: Test a unique field with `==`, or return `List<T>` (agent) rule: query.not_unique help: https://jadpo.dev/docs/errors/query.not_uniquecheck failed: 1 error, 1 file
Markdown for agents: /docs/errors/query.not_unique.md.Built from Jadpo main at a707efb.