Genie Discord forum

Could anyone give me an exaple on how to use SQLJoin and SQLOn to make a query to join two related tables?

I don't think there's a good way to do it right now, but this should work :
function find_join(m,q,j)
data = DataFrame(m, q, j)
models = SearchLight.to_models(m, data)
joined = [copy(r) for r in eachrow(data)]
models, joined
end
on = SQLOn( SQLColumn("comments.user_id"), SQLColumn("users.id"))
j = Vector{SQLJoin}([
SQLJoin(Users.User, columns = [SQLColumn("users.name")], [on])
])
where_flag = SQLWhereExpression("$(SQLColumn("comments.flag")) = ?", flag)
q = SQLQuery(where = [SQLWhereExpression("$(SQLColumn(:topic_id)) = ?", topic_id), where_flag], order = SQLOrder(:datetime, "DESC"))
find_join(Comments.Comment, q, j)