The query must return two records, but instead it returns only one.
The missing records is the one which has no notes associated. If I copy the query from the instrumentation log and run it manually against the db, it returns two records.
However if I modify the query to (see as):
var query = rel.
Select("c.id", "c.created_time", "c.updated_time", "c.archived", "c.name", "c.description", "^MAX(n.updated_time) as last_note_dated", "^AVG(n.score) as avg_score").
From("contacts as c").
JoinWith("LEFT JOIN", "notes as n", "n.object_id", "c.id", where.Eq("n.archived", false)).
Where(where.Eq("c.archived", false)).
Group("c.id", "c.created_time", "c.updated_time", "c.archived", "c.name", "c.description")
I have got the following error (similar to #370):
sql: Scan error on column index 6, name \"last_note_dated\": unsupported Scan, storing driver.Value type string into type *time.Time", err:(*errors.errorString)(0xc0003f7940)
Looks like something bad is going on when queries got executed. I am probably thinking to quit go-rel as it constantly prevents me from progressing my project.
When I run the following query:
The query must return two records, but instead it returns only one. The missing records is the one which has no notes associated. If I copy the query from the instrumentation log and run it manually against the db, it returns two records.
However if I modify the query to (see
as
):I have got the following error (similar to #370):
Looks like something bad is going on when queries got executed. I am probably thinking to quit
go-rel
as it constantly prevents me from progressing my project.