Dapper.FSharp icon indicating copy to clipboard operation
Dapper.FSharp copied to clipboard

Joins limit

Open jannesiera opened this issue 3 years ago • 3 comments

Currently, there seems to be a limit on 2 joins. Would it be possible to increase this limit, and what would need to be done to make this happen?

jannesiera avatar Aug 25 '22 22:08 jannesiera

Hi, it shouldn't be so hard, but I would somehow keep it simple. How many joins do you need?

Things to do in such a case:

  • new generic methods for SelectAsync
  • implementation of methods like select2
  • tests
  • docs update

If you follow the code path of each function with joins, you'll easily find what needs to be done. 😄

Dzoukr avatar Aug 26 '22 07:08 Dzoukr

So it's just a matter of adding some overloads? That seems manageable.

Not sure how many we would need exactly, but we encode Discriminated Unions with multiple child tables. Hence the join amount can run up very quickly. Essentially you get an extra join per case in the DU times the amount of DUs.

jannesiera avatar Aug 26 '22 09:08 jannesiera

So it's just a matter of adding some overloads? That seems manageable.

Yup. I was just lazy at that time so I said "Two joins ought to be enough for anybody." 😄 So even I am not personally big fan of many joins in one query, this should not do any harm actually, so feel free to add few more and send PR.

Dzoukr avatar Aug 26 '22 10:08 Dzoukr

I went ahead and made a PR #82 , this weekend. Please let me know if we think this addresses the request or if you'd like to see changes. @jannesiera @Dzoukr

1eyewonder avatar Feb 27 '23 15:02 1eyewonder

Thanks to @1eyewonder great work, we now have v4.4.0 with 4 joins (all fours here 😂)! Thanks!!!!

Dzoukr avatar Feb 28 '23 06:02 Dzoukr