-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom mappers for projections with more than 22 columns #1199
Comments
are there more than 22 columns in the projection? |
yes ! |
ha thats fun. There used to be a constraint on 22 parameters to a lambda but thats gone now. |
I need this as well, I have "polymorphic" items, where all the fields of all subtypes are columns merged in one table Any workaround? |
not really, you have to use exposed method and map from the type given to you. I'll try and get a fix in for this before the next release. |
Okay, that can work in meantime, thanks |
Faced with the same issue on 1.1.3 (Android Driver), Kotlin 1.3.30 |
no, we need the above issue fixed first |
So is it related to Kotlin Native issue? We are moving from SqlDelight 0.7.1 and SqlDelight 1.1.3 doesn't serve well in case if we have at least one JOIN (around 25 fields). That can't be simplified, unfortunately. Do you know if possible to turn off needsLambda check only for Android driver inside sqldelight-compiler and publish it locally? I am stuck with the issue and can't figure out how to resolve it
|
Btw the workaround is to map the FooBar projection object to your DomainFooBar manually (so yea, garbage, but will do until fixed) |
Yeah, this what came to my mind as well, the main issue that I have to do it for every generated interface, even if they have the same fields set. Also another solution is to map SqlCursor manually, but obviously we can't use autogenerated mappers from SqlDelight and it doesn't make much sense to use Delight without it's main features. |
if you are exposing the same fields from multiple queries you can use a view to have the interface be the same |
@AlecStrong view require migrations though 😣 |
"Abitrary Arity" is the name of my punk rock band |
It's now merged, I asked if it's possible to re-open the original PR |
It's fixed in Kotlin 1.3.60, which is not released |
Any updates on this? |
This is fixed in Kotlin 1.3.60. This can prob be closed. |
@benasher44 , Here is a
and here is the generated
However, if a 23rd parameter is added:
there will be no method which takes a mapper generated:
Edit: tested on |
Oh dang. Didn't realize this still need SQLDelight changes. |
Any chance it'll be fixed soon? |
Is it a normal behavior that for queries with a
LEFT OUTER JOIN
, generated code does not give access to the custom mapper ?Example :
Generated code:
The text was updated successfully, but these errors were encountered: