Skip to content
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

Merged columns with same Java type should persist Java type #2116

Merged
merged 1 commit into from
Dec 19, 2020
Merged

Merged columns with same Java type should persist Java type #2116

merged 1 commit into from
Dec 19, 2020

Conversation

veyndan
Copy link
Collaborator

@veyndan veyndan commented Dec 19, 2020

Closes #2067.

assertThat(generator.customResultTypeFunction().toString()).isEqualTo(
"""
|public override fun <T : kotlin.Any> birthdays(mapper: (birthday: java.time.LocalDate?) -> T): com.squareup.sqldelight.Query<T> {
| kotlin.check(kotlin.collections.setOf(database.childrenAdapter.birthdayAdapter, database.teenagersAdapter.birthdayAdapter, database.adultsAdapter.birthdayAdapter).size == 1) { "Adapter types are expected to be identical." }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clever, i like it

@veyndan veyndan merged commit 19d16a3 into cashapp:master Dec 19, 2020
@veyndan veyndan deleted the 2067/check-adapter branch December 19, 2020 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQL clause should persist adapted type
2 participants