ozzo-dbx icon indicating copy to clipboard operation
ozzo-dbx copied to clipboard

Subqueries

Open nkovacs opened this issue 8 years ago • 0 comments

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)?

nkovacs avatar Apr 06 '17 13:04 nkovacs