Open alaviss opened 4 years ago
If the query result set might be empty, you should try tryQuery:
let (id, username) =
tryQuery:
select user(id, username)
where id == 1
limit 1
The result:
id = 0
name = ""
The result:
id = 0 name = ""
It'd be a bit more useful to signify if any result has been returned.
Maybe returning Option(tuple[id: int, name: stirng]) is more reasonable.
Given an empty table created with this schema:
This query
Returns a confusing error: