zio-sql
zio-sql copied to clipboard
`in` should support sub queries that return a single column
select * from a where a.id in (select id from b where something) is a fairly common pattern in sql which zio-sql doesn't currently support.
val deleteFromWithSubquery = deleteFrom(orders).where(fkUserId in {
select(userId as "id") from users where (fName === "Fred") //this should work
})
type mismatch;
found : this.Read.Select[this.Features.Source,this.users.TableType,this.SelectionSet.Cons[this.users.TableType,java.util.UUID,this.SelectionSet.Empty]]
(which expands to) this.Read.Select[this.Features.Source,this.users.TableType,this.SelectionSet.Cons[this.users.TableType,java.util.UUID,this.SelectionSet.Empty.type]]
required: this.Read[java.util.UUID]