Dzoukr / Dapper.FSharp

Lightweight F# extension for StackOverflow Dapper with support for MSSQL, MySQL, PostgreSQL, and SQLite
MIT License
365 stars 35 forks source link

Joins limit #66

Closed jannesiera closed 1 year ago

jannesiera commented 1 year ago

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?

Dzoukr commented 1 year ago

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:

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

jannesiera commented 1 year ago

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.

Dzoukr commented 1 year ago

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.

1eyewonder commented 1 year ago

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

Dzoukr commented 1 year ago

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