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

Fix Batch Insertion/Update for tuple-based fields #103

Merged
merged 1 commit into from
May 16, 2022
Merged

Conversation

deusaquilus
Copy link
Contributor

Allowing tuple-based batch queries.

    "update via tuple" in {
      val birthYearUpdates = List((3431, 1983), (2976, 1972), (1511, 1991))
      val a = ctx.run {
        liftQuery(birthYearUpdates).foreach {
          case (id, year) =>
            query[MyPerson].filter(p => p.id == id).update(p => p.birthYear -> year)
        }
      }
      a.triple mustEqual ("UPDATE MyPerson SET birthYear = ? WHERE id = ?", List(List(1983, 3431), List(1972, 2976), List(1991, 1511)), Static)

      val b = ctx.run {
        liftQuery(birthYearUpdates).foreach((id, year) =>
          query[MyPerson].filter(p => p.id == id).update(p => p.birthYear -> year)
        )
      }
      b.triple mustEqual ("UPDATE MyPerson SET birthYear = ? WHERE id = ?", List(List(1983, 3431), List(1972, 2976), List(1991, 1511)), Static)
    }

Used to fail in TypeRepr.memberType NoDenotations owner because of how memberType was used.

@deusaquilus deusaquilus merged commit 5bac4bd into master May 16, 2022
@deusaquilus deusaquilus deleted the fix_tuples branch May 16, 2022 18:27
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.

1 participant