Open SimonRichardson opened 3 days ago
The work around is to extract something from the table, even if I don't require it.
SELECT name AS &charmName.name
FROM charm
WHERE name = 'juju-controller'
AND uuid = $charmID.uuid;
Ah yea, this is because if your query has no output expressions in it we do tx.Exec
from database/sql under the hood. So no errors get returned.
I've been considering the idea of changing the behvaiour to just do Exec
when you do Run
and always do tx.Query
when you do Get
The following select statement will return no error, even though the table in question does not have a charm by the name of
juju-controller
.Table contents:
Table schema:
Query that should return
sql.ErrNoRows
, instead returns nil.