Skip to content

Commit

Permalink
output max string length as comment
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindberg committed Jun 19, 2023
1 parent 40d9fe5 commit 734c041
Show file tree
Hide file tree
Showing 375 changed files with 1,765 additions and 1,760 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ sealed abstract class FootballClubFieldValue[T](name: String, value: T) extends

object FootballClubFieldValue {
case class id(override val value: FootballClubId) extends FootballClubFieldOrIdValue("id", value)
case class name(override val value: String) extends FootballClubFieldValue("name", value)
case class name(override val value: /* max 100 chars */ String) extends FootballClubFieldValue("name", value)
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ object FootballClubRepoImpl extends FootballClubRepo {
Success(
FootballClubRow(
id = row[FootballClubId]("id"),
name = row[String]("name")
name = row[/* max 100 chars */ String]("name")
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import scala.util.Try

case class FootballClubRow(
id: FootballClubId,
name: String
name: /* max 100 chars */ String
)

object FootballClubRow {
Expand All @@ -33,7 +33,7 @@ object FootballClubRow {
Try(
FootballClubRow(
id = json.\("id").as[FootballClubId],
name = json.\("name").as[String]
name = json.\("name").as[/* max 100 chars */ String]
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ sealed abstract class PersonFieldValue[T](name: String, value: T) extends Person
object PersonFieldValue {
case class id(override val value: PersonId) extends PersonFieldOrIdValue("id", value)
case class favouriteFootballClubId(override val value: FootballClubId) extends PersonFieldValue("favourite_football_club_id", value)
case class name(override val value: String) extends PersonFieldValue("name", value)
case class nickName(override val value: Option[String]) extends PersonFieldValue("nick_name", value)
case class blogUrl(override val value: Option[String]) extends PersonFieldValue("blog_url", value)
case class email(override val value: String) extends PersonFieldValue("email", value)
case class phone(override val value: String) extends PersonFieldValue("phone", value)
case class name(override val value: /* max 100 chars */ String) extends PersonFieldValue("name", value)
case class nickName(override val value: Option[/* max 30 chars */ String]) extends PersonFieldValue("nick_name", value)
case class blogUrl(override val value: Option[/* max 100 chars */ String]) extends PersonFieldValue("blog_url", value)
case class email(override val value: /* max 254 chars */ String) extends PersonFieldValue("email", value)
case class phone(override val value: /* max 8 chars */ String) extends PersonFieldValue("phone", value)
case class likesPizza(override val value: Boolean) extends PersonFieldValue("likes_pizza", value)
case class maritalStatusId(override val value: MaritalStatusId) extends PersonFieldValue("marital_status_id", value)
case class workEmail(override val value: Option[String]) extends PersonFieldValue("work_email", value)
case class workEmail(override val value: Option[/* max 254 chars */ String]) extends PersonFieldValue("work_email", value)
case class sector(override val value: Sector) extends PersonFieldValue("sector", value)
}
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ object PersonRepoImpl extends PersonRepo {
PersonRow(
id = row[PersonId]("id"),
favouriteFootballClubId = row[FootballClubId]("favourite_football_club_id"),
name = row[String]("name"),
nickName = row[Option[String]]("nick_name"),
blogUrl = row[Option[String]]("blog_url"),
email = row[String]("email"),
phone = row[String]("phone"),
name = row[/* max 100 chars */ String]("name"),
nickName = row[Option[/* max 30 chars */ String]]("nick_name"),
blogUrl = row[Option[/* max 100 chars */ String]]("blog_url"),
email = row[/* max 254 chars */ String]("email"),
phone = row[/* max 8 chars */ String]("phone"),
likesPizza = row[Boolean]("likes_pizza"),
maritalStatusId = row[MaritalStatusId]("marital_status_id"),
workEmail = row[Option[String]]("work_email"),
workEmail = row[Option[/* max 254 chars */ String]]("work_email"),
sector = row[Sector]("sector")
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ case class PersonRow(
id: PersonId,
/** Points to [[football_club.FootballClubRow.id]] */
favouriteFootballClubId: FootballClubId,
name: String,
nickName: Option[String],
blogUrl: Option[String],
email: String,
phone: String,
name: /* max 100 chars */ String,
nickName: Option[/* max 30 chars */ String],
blogUrl: Option[/* max 100 chars */ String],
email: /* max 254 chars */ String,
phone: /* max 8 chars */ String,
likesPizza: Boolean,
/** Points to [[marital_status.MaritalStatusRow.id]] */
maritalStatusId: MaritalStatusId,
workEmail: Option[String],
workEmail: Option[/* max 254 chars */ String],
sector: Sector
)

Expand All @@ -57,14 +57,14 @@ object PersonRow {
PersonRow(
id = json.\("id").as[PersonId],
favouriteFootballClubId = json.\("favourite_football_club_id").as[FootballClubId],
name = json.\("name").as[String],
nickName = json.\("nick_name").toOption.map(_.as[String]),
blogUrl = json.\("blog_url").toOption.map(_.as[String]),
email = json.\("email").as[String],
phone = json.\("phone").as[String],
name = json.\("name").as[/* max 100 chars */ String],
nickName = json.\("nick_name").toOption.map(_.as[/* max 30 chars */ String]),
blogUrl = json.\("blog_url").toOption.map(_.as[/* max 100 chars */ String]),
email = json.\("email").as[/* max 254 chars */ String],
phone = json.\("phone").as[/* max 8 chars */ String],
likesPizza = json.\("likes_pizza").as[Boolean],
maritalStatusId = json.\("marital_status_id").as[MaritalStatusId],
workEmail = json.\("work_email").toOption.map(_.as[String]),
workEmail = json.\("work_email").toOption.map(_.as[/* max 254 chars */ String]),
sector = json.\("sector").as[Sector]
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import testdb.hardcoded.myschema.marital_status.MaritalStatusId
case class PersonRowUnsaved(
/** Points to [[football_club.FootballClubRow.id]] */
favouriteFootballClubId: FootballClubId,
name: String,
nickName: Option[String],
blogUrl: Option[String],
email: String,
phone: String,
name: /* max 100 chars */ String,
nickName: Option[/* max 30 chars */ String],
blogUrl: Option[/* max 100 chars */ String],
email: /* max 254 chars */ String,
phone: /* max 8 chars */ String,
likesPizza: Boolean,
workEmail: Option[String],
workEmail: Option[/* max 254 chars */ String],
/** Default: auto-increment */
id: Defaulted[PersonId] = Defaulted.UseDefault,
/** Default: some-value
Expand Down Expand Up @@ -84,13 +84,13 @@ object PersonRowUnsaved {
Try(
PersonRowUnsaved(
favouriteFootballClubId = json.\("favourite_football_club_id").as[FootballClubId],
name = json.\("name").as[String],
nickName = json.\("nick_name").toOption.map(_.as[String]),
blogUrl = json.\("blog_url").toOption.map(_.as[String]),
email = json.\("email").as[String],
phone = json.\("phone").as[String],
name = json.\("name").as[/* max 100 chars */ String],
nickName = json.\("nick_name").toOption.map(_.as[/* max 30 chars */ String]),
blogUrl = json.\("blog_url").toOption.map(_.as[/* max 100 chars */ String]),
email = json.\("email").as[/* max 254 chars */ String],
phone = json.\("phone").as[/* max 8 chars */ String],
likesPizza = json.\("likes_pizza").as[Boolean],
workEmail = json.\("work_email").toOption.map(_.as[String]),
workEmail = json.\("work_email").toOption.map(_.as[/* max 254 chars */ String]),
id = json.\("id").as[Defaulted[PersonId]],
maritalStatusId = json.\("marital_status_id").as[Defaulted[MaritalStatusId]],
sector = json.\("sector").as[Defaulted[Sector]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ sealed abstract class FootballClubFieldValue[T](name: String, value: T) extends

object FootballClubFieldValue {
case class id(override val value: FootballClubId) extends FootballClubFieldOrIdValue("id", value)
case class name(override val value: String) extends FootballClubFieldValue("name", value)
case class name(override val value: /* max 100 chars */ String) extends FootballClubFieldValue("name", value)
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ object FootballClubRepoImpl extends FootballClubRepo {
new Read[FootballClubRow](
gets = List(
(Get[FootballClubId], Nullability.NoNulls),
(Get[String], Nullability.NoNulls)
(Get[/* max 100 chars */ String], Nullability.NoNulls)
),
unsafeGet = (rs: ResultSet, i: Int) => FootballClubRow(
id = Get[FootballClubId].unsafeGetNonNullable(rs, i + 0),
name = Get[String].unsafeGetNonNullable(rs, i + 1)
name = Get[/* max 100 chars */ String].unsafeGetNonNullable(rs, i + 1)
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import io.circe.Json

case class FootballClubRow(
id: FootballClubId,
name: String
name: /* max 100 chars */ String
)

object FootballClubRow {
implicit val decoder: Decoder[FootballClubRow] =
(c: HCursor) =>
for {
id <- c.downField("id").as[FootballClubId]
name <- c.downField("name").as[String]
name <- c.downField("name").as[/* max 100 chars */ String]
} yield FootballClubRow(id, name)
implicit val encoder: Encoder[FootballClubRow] = {
import io.circe.syntax._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ sealed abstract class PersonFieldValue[T](name: String, value: T) extends Person
object PersonFieldValue {
case class id(override val value: PersonId) extends PersonFieldOrIdValue("id", value)
case class favouriteFootballClubId(override val value: FootballClubId) extends PersonFieldValue("favourite_football_club_id", value)
case class name(override val value: String) extends PersonFieldValue("name", value)
case class nickName(override val value: Option[String]) extends PersonFieldValue("nick_name", value)
case class blogUrl(override val value: Option[String]) extends PersonFieldValue("blog_url", value)
case class email(override val value: String) extends PersonFieldValue("email", value)
case class phone(override val value: String) extends PersonFieldValue("phone", value)
case class name(override val value: /* max 100 chars */ String) extends PersonFieldValue("name", value)
case class nickName(override val value: Option[/* max 30 chars */ String]) extends PersonFieldValue("nick_name", value)
case class blogUrl(override val value: Option[/* max 100 chars */ String]) extends PersonFieldValue("blog_url", value)
case class email(override val value: /* max 254 chars */ String) extends PersonFieldValue("email", value)
case class phone(override val value: /* max 8 chars */ String) extends PersonFieldValue("phone", value)
case class likesPizza(override val value: Boolean) extends PersonFieldValue("likes_pizza", value)
case class maritalStatusId(override val value: MaritalStatusId) extends PersonFieldValue("marital_status_id", value)
case class workEmail(override val value: Option[String]) extends PersonFieldValue("work_email", value)
case class workEmail(override val value: Option[/* max 254 chars */ String]) extends PersonFieldValue("work_email", value)
case class sector(override val value: Sector) extends PersonFieldValue("sector", value)
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,27 +177,27 @@ object PersonRepoImpl extends PersonRepo {
gets = List(
(Get[PersonId], Nullability.NoNulls),
(Get[FootballClubId], Nullability.NoNulls),
(Get[String], Nullability.NoNulls),
(Get[String], Nullability.Nullable),
(Get[String], Nullability.Nullable),
(Get[String], Nullability.NoNulls),
(Get[String], Nullability.NoNulls),
(Get[/* max 100 chars */ String], Nullability.NoNulls),
(Get[/* max 30 chars */ String], Nullability.Nullable),
(Get[/* max 100 chars */ String], Nullability.Nullable),
(Get[/* max 254 chars */ String], Nullability.NoNulls),
(Get[/* max 8 chars */ String], Nullability.NoNulls),
(Get[Boolean], Nullability.NoNulls),
(Get[MaritalStatusId], Nullability.NoNulls),
(Get[String], Nullability.Nullable),
(Get[/* max 254 chars */ String], Nullability.Nullable),
(Get[Sector], Nullability.NoNulls)
),
unsafeGet = (rs: ResultSet, i: Int) => PersonRow(
id = Get[PersonId].unsafeGetNonNullable(rs, i + 0),
favouriteFootballClubId = Get[FootballClubId].unsafeGetNonNullable(rs, i + 1),
name = Get[String].unsafeGetNonNullable(rs, i + 2),
nickName = Get[String].unsafeGetNullable(rs, i + 3),
blogUrl = Get[String].unsafeGetNullable(rs, i + 4),
email = Get[String].unsafeGetNonNullable(rs, i + 5),
phone = Get[String].unsafeGetNonNullable(rs, i + 6),
name = Get[/* max 100 chars */ String].unsafeGetNonNullable(rs, i + 2),
nickName = Get[/* max 30 chars */ String].unsafeGetNullable(rs, i + 3),
blogUrl = Get[/* max 100 chars */ String].unsafeGetNullable(rs, i + 4),
email = Get[/* max 254 chars */ String].unsafeGetNonNullable(rs, i + 5),
phone = Get[/* max 8 chars */ String].unsafeGetNonNullable(rs, i + 6),
likesPizza = Get[Boolean].unsafeGetNonNullable(rs, i + 7),
maritalStatusId = Get[MaritalStatusId].unsafeGetNonNullable(rs, i + 8),
workEmail = Get[String].unsafeGetNullable(rs, i + 9),
workEmail = Get[/* max 254 chars */ String].unsafeGetNullable(rs, i + 9),
sector = Get[Sector].unsafeGetNonNullable(rs, i + 10)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ case class PersonRow(
id: PersonId,
/** Points to [[football_club.FootballClubRow.id]] */
favouriteFootballClubId: FootballClubId,
name: String,
nickName: Option[String],
blogUrl: Option[String],
email: String,
phone: String,
name: /* max 100 chars */ String,
nickName: Option[/* max 30 chars */ String],
blogUrl: Option[/* max 100 chars */ String],
email: /* max 254 chars */ String,
phone: /* max 8 chars */ String,
likesPizza: Boolean,
/** Points to [[marital_status.MaritalStatusRow.id]] */
maritalStatusId: MaritalStatusId,
workEmail: Option[String],
workEmail: Option[/* max 254 chars */ String],
sector: Sector
)

Expand All @@ -38,14 +38,14 @@ object PersonRow {
for {
id <- c.downField("id").as[PersonId]
favouriteFootballClubId <- c.downField("favourite_football_club_id").as[FootballClubId]
name <- c.downField("name").as[String]
nickName <- c.downField("nick_name").as[Option[String]]
blogUrl <- c.downField("blog_url").as[Option[String]]
email <- c.downField("email").as[String]
phone <- c.downField("phone").as[String]
name <- c.downField("name").as[/* max 100 chars */ String]
nickName <- c.downField("nick_name").as[Option[/* max 30 chars */ String]]
blogUrl <- c.downField("blog_url").as[Option[/* max 100 chars */ String]]
email <- c.downField("email").as[/* max 254 chars */ String]
phone <- c.downField("phone").as[/* max 8 chars */ String]
likesPizza <- c.downField("likes_pizza").as[Boolean]
maritalStatusId <- c.downField("marital_status_id").as[MaritalStatusId]
workEmail <- c.downField("work_email").as[Option[String]]
workEmail <- c.downField("work_email").as[Option[/* max 254 chars */ String]]
sector <- c.downField("sector").as[Sector]
} yield PersonRow(id, favouriteFootballClubId, name, nickName, blogUrl, email, phone, likesPizza, maritalStatusId, workEmail, sector)
implicit val encoder: Encoder[PersonRow] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import testdb.hardcoded.myschema.marital_status.MaritalStatusId
case class PersonRowUnsaved(
/** Points to [[football_club.FootballClubRow.id]] */
favouriteFootballClubId: FootballClubId,
name: String,
nickName: Option[String],
blogUrl: Option[String],
email: String,
phone: String,
name: /* max 100 chars */ String,
nickName: Option[/* max 30 chars */ String],
blogUrl: Option[/* max 100 chars */ String],
email: /* max 254 chars */ String,
phone: /* max 8 chars */ String,
likesPizza: Boolean,
workEmail: Option[String],
workEmail: Option[/* max 254 chars */ String],
/** Default: auto-increment */
id: Defaulted[PersonId] = Defaulted.UseDefault,
/** Default: some-value
Expand Down Expand Up @@ -65,13 +65,13 @@ object PersonRowUnsaved {
(c: HCursor) =>
for {
favouriteFootballClubId <- c.downField("favourite_football_club_id").as[FootballClubId]
name <- c.downField("name").as[String]
nickName <- c.downField("nick_name").as[Option[String]]
blogUrl <- c.downField("blog_url").as[Option[String]]
email <- c.downField("email").as[String]
phone <- c.downField("phone").as[String]
name <- c.downField("name").as[/* max 100 chars */ String]
nickName <- c.downField("nick_name").as[Option[/* max 30 chars */ String]]
blogUrl <- c.downField("blog_url").as[Option[/* max 100 chars */ String]]
email <- c.downField("email").as[/* max 254 chars */ String]
phone <- c.downField("phone").as[/* max 8 chars */ String]
likesPizza <- c.downField("likes_pizza").as[Boolean]
workEmail <- c.downField("work_email").as[Option[String]]
workEmail <- c.downField("work_email").as[Option[/* max 254 chars */ String]]
id <- c.downField("id").as[Defaulted[PersonId]]
maritalStatusId <- c.downField("marital_status_id").as[Defaulted[MaritalStatusId]]
sector <- c.downField("sector").as[Defaulted[Sector]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ sealed abstract class EViewFieldValue[T](name: String, value: T) extends EViewFi
object EViewFieldValue {
case class id(override val value: Option[Int]) extends EViewFieldValue("id", value)
case class businessentityid(override val value: Option[BusinessentityId]) extends EViewFieldValue("businessentityid", value)
case class nationalidnumber(override val value: Option[String]) extends EViewFieldValue("nationalidnumber", value)
case class loginid(override val value: Option[String]) extends EViewFieldValue("loginid", value)
case class jobtitle(override val value: Option[String]) extends EViewFieldValue("jobtitle", value)
case class nationalidnumber(override val value: Option[/* max 15 chars */ String]) extends EViewFieldValue("nationalidnumber", value)
case class loginid(override val value: Option[/* max 256 chars */ String]) extends EViewFieldValue("loginid", value)
case class jobtitle(override val value: Option[/* max 50 chars */ String]) extends EViewFieldValue("jobtitle", value)
case class birthdate(override val value: Option[LocalDate]) extends EViewFieldValue("birthdate", value)
case class maritalstatus(override val value: Option[/* bpchar */ String]) extends EViewFieldValue("maritalstatus", value)
case class gender(override val value: Option[/* bpchar */ String]) extends EViewFieldValue("gender", value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ object EViewRepoImpl extends EViewRepo {
EViewRow(
id = row[Option[Int]]("id"),
businessentityid = row[Option[BusinessentityId]]("businessentityid"),
nationalidnumber = row[Option[String]]("nationalidnumber"),
loginid = row[Option[String]]("loginid"),
jobtitle = row[Option[String]]("jobtitle"),
nationalidnumber = row[Option[/* max 15 chars */ String]]("nationalidnumber"),
loginid = row[Option[/* max 256 chars */ String]]("loginid"),
jobtitle = row[Option[/* max 50 chars */ String]]("jobtitle"),
birthdate = row[Option[LocalDate]]("birthdate"),
maritalstatus = row[Option[/* bpchar */ String]]("maritalstatus"),
gender = row[Option[/* bpchar */ String]]("gender"),
Expand Down
Loading

0 comments on commit 734c041

Please sign in to comment.