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

TestInsert: Don't wrap inherited ID types #143

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ class TestInsert(random: Random, domainInsert: TestDomainInsert) {
)(implicit c: Connection): FlaffRow = (new FlaffRepoImpl).insert(new FlaffRow(code = code, anotherCode = anotherCode, someNumber = someNumber, specifier = specifier, parentspecifier = parentspecifier))
def publicIdentityTest(name: IdentityTestId, defaultGenerated: Defaulted[Int] = Defaulted.UseDefault)(implicit c: Connection): IdentityTestRow = (new IdentityTestRepoImpl).insert(new IdentityTestRowUnsaved(name = name, defaultGenerated = defaultGenerated))
def publicIssue142(tabellkode: Issue142Id = Issue142Id(random.alphanumeric.take(20).mkString))(implicit c: Connection): Issue142Row = (new Issue142RepoImpl).insert(new Issue142Row(tabellkode = tabellkode))
def publicIssue1422(tabellkode: Issue142Id = Issue142Id(Issue142Id.All(random.nextInt(2))))(implicit c: Connection): Issue1422Row = (new Issue1422RepoImpl).insert(new Issue1422Row(tabellkode = tabellkode))
def publicIssue1422(tabellkode: Issue142Id = Issue142Id.All(random.nextInt(2)))(implicit c: Connection): Issue1422Row = (new Issue1422RepoImpl).insert(new Issue1422Row(tabellkode = tabellkode))
def publicPgtest(box: TypoBox,
bytea: TypoBytea,
circle: TypoCircle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ class TestInsert(random: Random, domainInsert: TestDomainInsert) {
): ConnectionIO[FlaffRow] = (new FlaffRepoImpl).insert(new FlaffRow(code = code, anotherCode = anotherCode, someNumber = someNumber, specifier = specifier, parentspecifier = parentspecifier))
def publicIdentityTest(name: IdentityTestId, defaultGenerated: Defaulted[Int] = Defaulted.UseDefault): ConnectionIO[IdentityTestRow] = (new IdentityTestRepoImpl).insert(new IdentityTestRowUnsaved(name = name, defaultGenerated = defaultGenerated))
def publicIssue142(tabellkode: Issue142Id = Issue142Id(random.alphanumeric.take(20).mkString)): ConnectionIO[Issue142Row] = (new Issue142RepoImpl).insert(new Issue142Row(tabellkode = tabellkode))
def publicIssue1422(tabellkode: Issue142Id = Issue142Id(Issue142Id.All(random.nextInt(2)))): ConnectionIO[Issue1422Row] = (new Issue1422RepoImpl).insert(new Issue1422Row(tabellkode = tabellkode))
def publicIssue1422(tabellkode: Issue142Id = Issue142Id.All(random.nextInt(2))): ConnectionIO[Issue1422Row] = (new Issue1422RepoImpl).insert(new Issue1422Row(tabellkode = tabellkode))
def publicPgtest(box: TypoBox,
bytea: TypoBytea,
circle: TypoCircle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ class TestInsert(random: Random, domainInsert: TestDomainInsert) {
): ZIO[ZConnection, Throwable, FlaffRow] = (new FlaffRepoImpl).insert(new FlaffRow(code = code, anotherCode = anotherCode, someNumber = someNumber, specifier = specifier, parentspecifier = parentspecifier))
def publicIdentityTest(name: IdentityTestId, defaultGenerated: Defaulted[Int] = Defaulted.UseDefault): ZIO[ZConnection, Throwable, IdentityTestRow] = (new IdentityTestRepoImpl).insert(new IdentityTestRowUnsaved(name = name, defaultGenerated = defaultGenerated))
def publicIssue142(tabellkode: Issue142Id = Issue142Id(random.alphanumeric.take(20).mkString)): ZIO[ZConnection, Throwable, Issue142Row] = (new Issue142RepoImpl).insert(new Issue142Row(tabellkode = tabellkode))
def publicIssue1422(tabellkode: Issue142Id = Issue142Id(Issue142Id.All(random.nextInt(2)))): ZIO[ZConnection, Throwable, Issue1422Row] = (new Issue1422RepoImpl).insert(new Issue1422Row(tabellkode = tabellkode))
def publicIssue1422(tabellkode: Issue142Id = Issue142Id.All(random.nextInt(2))): ZIO[ZConnection, Throwable, Issue1422Row] = (new Issue1422RepoImpl).insert(new Issue1422Row(tabellkode = tabellkode))
def publicPgtest(box: TypoBox,
bytea: TypoBytea,
circle: TypoCircle,
Expand Down
2 changes: 1 addition & 1 deletion typo/src/scala/typo/internal/ComputedTestInserts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ object ComputedTestInserts {
case tpe if tableUnaryId.exists(_.tpe == tpe) =>
tableUnaryId.get match {
case x: IdComputed.UnaryNormal => go(x.underlying, x.col.dbCol.tpe, None).map(default => code"${x.tpe}($default)")
case x: IdComputed.UnaryInherited => go(x.underlying, x.col.dbCol.tpe, None).map(default => code"${x.tpe}($default)")
case x: IdComputed.UnaryInherited => go(x.underlying, x.col.dbCol.tpe, None)
oyvindberg marked this conversation as resolved.
Show resolved Hide resolved
case x: IdComputed.UnaryNoIdType => go(x.underlying, x.col.dbCol.tpe, None)
case x: IdComputed.UnaryOpenEnum => go(x.underlying, x.col.dbCol.tpe, None).map(default => code"${x.tpe}($default)")
case _: IdComputed.UnaryUserSpecified => None
Expand Down
Loading