ozzo-dbx
ozzo-dbx copied to clipboard
Subqueries
SelectQuery doesn't implement Expression, so I can't use it in ExistsExp or InExp.
I wrote a function to convert it into an Expression:
func SelectExp(query *dbx.SelectQuery) dbx.Expression {
built := query.Build()
return dbx.NewExp(built.SQL(), built.Params())
}
Is this a good idea? Is there a better way to do this (I don't want to write the whole subquery using raw sql)?