diff --git a/.bleep/generated-sources/typo-tester-anorm@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-anorm@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index 7b129e1ebb..6d220f07b9 100644 --- a/.bleep/generated-sources/typo-tester-anorm@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-anorm@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -22,7 +22,9 @@ import scala.util.Try import testdb.hardcoded.Text case class PersonRow( + /** Default: auto-increment */ one: Long, + /** Default: auto-increment */ two: Option[String], name: Option[String] ){ diff --git a/.bleep/generated-sources/typo-tester-anorm@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-anorm@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala index d71064de24..fa274a0b43 100644 --- a/.bleep/generated-sources/typo-tester-anorm@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-anorm@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala @@ -26,6 +26,7 @@ import testdb.hardcoded.myschema.football_club.FootballClubId import testdb.hardcoded.myschema.marital_status.MaritalStatusId case class PersonRow( + /** Default: auto-increment */ id: PersonId, /** Points to [[football_club.FootballClubRow.id]] */ favouriteFootballClubId: FootballClubId, @@ -35,10 +36,13 @@ case class PersonRow( email: /* max 254 chars */ String, phone: /* max 8 chars */ String, likesPizza: Boolean, - /** Points to [[marital_status.MaritalStatusRow.id]] */ + /** Default: some-value + Points to [[marital_status.MaritalStatusRow.id]] */ maritalStatusId: MaritalStatusId, workEmail: Option[/* max 254 chars */ String], + /** Default: PUBLIC */ sector: Sector, + /** Default: one */ favoriteNumber: Number ) diff --git a/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index 7b129e1ebb..6d220f07b9 100644 --- a/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -22,7 +22,9 @@ import scala.util.Try import testdb.hardcoded.Text case class PersonRow( + /** Default: auto-increment */ one: Long, + /** Default: auto-increment */ two: Option[String], name: Option[String] ){ diff --git a/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala index d71064de24..fa274a0b43 100644 --- a/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala @@ -26,6 +26,7 @@ import testdb.hardcoded.myschema.football_club.FootballClubId import testdb.hardcoded.myschema.marital_status.MaritalStatusId case class PersonRow( + /** Default: auto-increment */ id: PersonId, /** Points to [[football_club.FootballClubRow.id]] */ favouriteFootballClubId: FootballClubId, @@ -35,10 +36,13 @@ case class PersonRow( email: /* max 254 chars */ String, phone: /* max 8 chars */ String, likesPizza: Boolean, - /** Points to [[marital_status.MaritalStatusRow.id]] */ + /** Default: some-value + Points to [[marital_status.MaritalStatusRow.id]] */ maritalStatusId: MaritalStatusId, workEmail: Option[/* max 254 chars */ String], + /** Default: PUBLIC */ sector: Sector, + /** Default: one */ favoriteNumber: Number ) diff --git a/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index 7b129e1ebb..6d220f07b9 100644 --- a/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -22,7 +22,9 @@ import scala.util.Try import testdb.hardcoded.Text case class PersonRow( + /** Default: auto-increment */ one: Long, + /** Default: auto-increment */ two: Option[String], name: Option[String] ){ diff --git a/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala index d71064de24..fa274a0b43 100644 --- a/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala @@ -26,6 +26,7 @@ import testdb.hardcoded.myschema.football_club.FootballClubId import testdb.hardcoded.myschema.marital_status.MaritalStatusId case class PersonRow( + /** Default: auto-increment */ id: PersonId, /** Points to [[football_club.FootballClubRow.id]] */ favouriteFootballClubId: FootballClubId, @@ -35,10 +36,13 @@ case class PersonRow( email: /* max 254 chars */ String, phone: /* max 8 chars */ String, likesPizza: Boolean, - /** Points to [[marital_status.MaritalStatusRow.id]] */ + /** Default: some-value + Points to [[marital_status.MaritalStatusRow.id]] */ maritalStatusId: MaritalStatusId, workEmail: Option[/* max 254 chars */ String], + /** Default: PUBLIC */ sector: Sector, + /** Default: one */ favoriteNumber: Number ) diff --git a/.bleep/generated-sources/typo-tester-doobie@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-doobie@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index d17fe03523..115f85fa34 100644 --- a/.bleep/generated-sources/typo-tester-doobie@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-doobie@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -17,7 +17,9 @@ import io.circe.Encoder import java.sql.ResultSet case class PersonRow( + /** Default: auto-increment */ one: Long, + /** Default: auto-increment */ two: Option[String], name: Option[String] ){ diff --git a/.bleep/generated-sources/typo-tester-doobie@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-doobie@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala index a13f098f50..b09bdca5cb 100644 --- a/.bleep/generated-sources/typo-tester-doobie@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-doobie@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala @@ -21,6 +21,7 @@ import testdb.hardcoded.myschema.football_club.FootballClubId import testdb.hardcoded.myschema.marital_status.MaritalStatusId case class PersonRow( + /** Default: auto-increment */ id: PersonId, /** Points to [[football_club.FootballClubRow.id]] */ favouriteFootballClubId: FootballClubId, @@ -30,10 +31,13 @@ case class PersonRow( email: /* max 254 chars */ String, phone: /* max 8 chars */ String, likesPizza: Boolean, - /** Points to [[marital_status.MaritalStatusRow.id]] */ + /** Default: some-value + Points to [[marital_status.MaritalStatusRow.id]] */ maritalStatusId: MaritalStatusId, workEmail: Option[/* max 254 chars */ String], + /** Default: PUBLIC */ sector: Sector, + /** Default: one */ favoriteNumber: Number ) diff --git a/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index d17fe03523..115f85fa34 100644 --- a/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -17,7 +17,9 @@ import io.circe.Encoder import java.sql.ResultSet case class PersonRow( + /** Default: auto-increment */ one: Long, + /** Default: auto-increment */ two: Option[String], name: Option[String] ){ diff --git a/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala index a13f098f50..b09bdca5cb 100644 --- a/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala @@ -21,6 +21,7 @@ import testdb.hardcoded.myschema.football_club.FootballClubId import testdb.hardcoded.myschema.marital_status.MaritalStatusId case class PersonRow( + /** Default: auto-increment */ id: PersonId, /** Points to [[football_club.FootballClubRow.id]] */ favouriteFootballClubId: FootballClubId, @@ -30,10 +31,13 @@ case class PersonRow( email: /* max 254 chars */ String, phone: /* max 8 chars */ String, likesPizza: Boolean, - /** Points to [[marital_status.MaritalStatusRow.id]] */ + /** Default: some-value + Points to [[marital_status.MaritalStatusRow.id]] */ maritalStatusId: MaritalStatusId, workEmail: Option[/* max 254 chars */ String], + /** Default: PUBLIC */ sector: Sector, + /** Default: one */ favoriteNumber: Number ) diff --git a/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index d17fe03523..115f85fa34 100644 --- a/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -17,7 +17,9 @@ import io.circe.Encoder import java.sql.ResultSet case class PersonRow( + /** Default: auto-increment */ one: Long, + /** Default: auto-increment */ two: Option[String], name: Option[String] ){ diff --git a/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala index a13f098f50..b09bdca5cb 100644 --- a/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala @@ -21,6 +21,7 @@ import testdb.hardcoded.myschema.football_club.FootballClubId import testdb.hardcoded.myschema.marital_status.MaritalStatusId case class PersonRow( + /** Default: auto-increment */ id: PersonId, /** Points to [[football_club.FootballClubRow.id]] */ favouriteFootballClubId: FootballClubId, @@ -30,10 +31,13 @@ case class PersonRow( email: /* max 254 chars */ String, phone: /* max 8 chars */ String, likesPizza: Boolean, - /** Points to [[marital_status.MaritalStatusRow.id]] */ + /** Default: some-value + Points to [[marital_status.MaritalStatusRow.id]] */ maritalStatusId: MaritalStatusId, workEmail: Option[/* max 254 chars */ String], + /** Default: PUBLIC */ sector: Sector, + /** Default: one */ favoriteNumber: Number ) diff --git a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index db4274d24b..e034110d7b 100644 --- a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -17,7 +17,9 @@ import zio.json.ast.Json import zio.json.internal.Write case class PersonRow( + /** Default: auto-increment */ one: Long, + /** Default: auto-increment */ two: Option[String], name: Option[String] ){ diff --git a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala index 32cbdfed95..01cdbb8304 100644 --- a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm212/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala @@ -21,6 +21,7 @@ import zio.json.ast.Json import zio.json.internal.Write case class PersonRow( + /** Default: auto-increment */ id: PersonId, /** Points to [[football_club.FootballClubRow.id]] */ favouriteFootballClubId: FootballClubId, @@ -30,10 +31,13 @@ case class PersonRow( email: /* max 254 chars */ String, phone: /* max 8 chars */ String, likesPizza: Boolean, - /** Points to [[marital_status.MaritalStatusRow.id]] */ + /** Default: some-value + Points to [[marital_status.MaritalStatusRow.id]] */ maritalStatusId: MaritalStatusId, workEmail: Option[/* max 254 chars */ String], + /** Default: PUBLIC */ sector: Sector, + /** Default: one */ favoriteNumber: Number ) diff --git a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index db4274d24b..e034110d7b 100644 --- a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -17,7 +17,9 @@ import zio.json.ast.Json import zio.json.internal.Write case class PersonRow( + /** Default: auto-increment */ one: Long, + /** Default: auto-increment */ two: Option[String], name: Option[String] ){ diff --git a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala index 32cbdfed95..01cdbb8304 100644 --- a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala @@ -21,6 +21,7 @@ import zio.json.ast.Json import zio.json.internal.Write case class PersonRow( + /** Default: auto-increment */ id: PersonId, /** Points to [[football_club.FootballClubRow.id]] */ favouriteFootballClubId: FootballClubId, @@ -30,10 +31,13 @@ case class PersonRow( email: /* max 254 chars */ String, phone: /* max 8 chars */ String, likesPizza: Boolean, - /** Points to [[marital_status.MaritalStatusRow.id]] */ + /** Default: some-value + Points to [[marital_status.MaritalStatusRow.id]] */ maritalStatusId: MaritalStatusId, workEmail: Option[/* max 254 chars */ String], + /** Default: PUBLIC */ sector: Sector, + /** Default: one */ favoriteNumber: Number ) diff --git a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index db4274d24b..e034110d7b 100644 --- a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -17,7 +17,9 @@ import zio.json.ast.Json import zio.json.internal.Write case class PersonRow( + /** Default: auto-increment */ one: Long, + /** Default: auto-increment */ two: Option[String], name: Option[String] ){ diff --git a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala index 32cbdfed95..01cdbb8304 100644 --- a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/myschema/person/PersonRow.scala @@ -21,6 +21,7 @@ import zio.json.ast.Json import zio.json.internal.Write case class PersonRow( + /** Default: auto-increment */ id: PersonId, /** Points to [[football_club.FootballClubRow.id]] */ favouriteFootballClubId: FootballClubId, @@ -30,10 +31,13 @@ case class PersonRow( email: /* max 254 chars */ String, phone: /* max 8 chars */ String, likesPizza: Boolean, - /** Points to [[marital_status.MaritalStatusRow.id]] */ + /** Default: some-value + Points to [[marital_status.MaritalStatusRow.id]] */ maritalStatusId: MaritalStatusId, workEmail: Option[/* max 254 chars */ String], + /** Default: PUBLIC */ sector: Sector, + /** Default: one */ favoriteNumber: Number ) diff --git a/init/data/test-tables.sql b/init/data/test-tables.sql index 2cce621332..1e81854733 100644 --- a/init/data/test-tables.sql +++ b/init/data/test-tables.sql @@ -192,4 +192,11 @@ CREATE TABLE users verified_on TIMESTAMPTZ NULL, CONSTRAINT users_user_id_pk PRIMARY KEY (user_id), CONSTRAINT users_email_unique UNIQUE (email) -); \ No newline at end of file +); + +CREATE TABLE "identity-test" +( + always_generated Integer NOT NULL GENERATED ALWAYS AS IDENTITY (INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1), + default_generated Integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1), + name Character varying(250) NOT NULL primary key +); diff --git a/typo-scripts/src/scala/scripts/GenHardcodedFiles.scala b/typo-scripts/src/scala/scripts/GenHardcodedFiles.scala index 9053e1dbb4..cfbe310793 100644 --- a/typo-scripts/src/scala/scripts/GenHardcodedFiles.scala +++ b/typo-scripts/src/scala/scripts/GenHardcodedFiles.scala @@ -18,53 +18,57 @@ object GenHardcodedFiles extends BleepCodegenScript("GenHardcodedFiles") { val person = db.Table( name = db.RelationName(Some("myschema"), "person"), cols = NonEmptyList( - db.Col(ParsedName.of("id"), db.Type.Int8, Some("int8"), Nullability.NoNulls, columnDefault = Some("auto-increment"), None, Nil, DebugJson.Empty), + db.Col(ParsedName.of("id"), db.Type.Int8, Some("int8"), Nullability.NoNulls, columnDefault = Some("auto-increment"), None, None, Nil, DebugJson.Empty), db.Col( - ParsedName.of("favourite_football_club_id"), - db.Type.VarChar(Some(50)), - Some("varchar"), - Nullability.NoNulls, + parsedName = ParsedName.of("favourite_football_club_id"), + tpe = db.Type.VarChar(Some(50)), + udtName = Some("varchar"), + nullability = Nullability.NoNulls, columnDefault = None, - None, - Nil, - DebugJson.Empty + identity = None, + comment = None, + constraints = Nil, + jsonDescription = DebugJson.Empty ), - db.Col(ParsedName.of("name"), db.Type.VarChar(Some(100)), Some("varchar"), Nullability.NoNulls, columnDefault = None, None, Nil, DebugJson.Empty), - db.Col(ParsedName.of("nick_name"), db.Type.VarChar(Some(30)), Some("varchar"), Nullability.Nullable, columnDefault = None, None, Nil, DebugJson.Empty), - db.Col(ParsedName.of("blog_url"), db.Type.VarChar(Some(100)), Some("varchar"), Nullability.Nullable, columnDefault = None, None, Nil, DebugJson.Empty), - db.Col(ParsedName.of("email"), db.Type.VarChar(Some(254)), Some("varchar"), Nullability.NoNulls, columnDefault = None, None, Nil, DebugJson.Empty), - db.Col(ParsedName.of("phone"), db.Type.VarChar(Some(8)), Some("varchar"), Nullability.NoNulls, columnDefault = None, None, Nil, DebugJson.Empty), - db.Col(ParsedName.of("likes_pizza"), db.Type.Boolean, Some("bool"), Nullability.NoNulls, columnDefault = None, None, Nil, DebugJson.Empty), + db.Col(ParsedName.of("name"), db.Type.VarChar(Some(100)), Some("varchar"), Nullability.NoNulls, columnDefault = None, None, None, Nil, DebugJson.Empty), + db.Col(ParsedName.of("nick_name"), db.Type.VarChar(Some(30)), Some("varchar"), Nullability.Nullable, columnDefault = None, None, None, Nil, DebugJson.Empty), + db.Col(ParsedName.of("blog_url"), db.Type.VarChar(Some(100)), Some("varchar"), Nullability.Nullable, columnDefault = None, None, None, Nil, DebugJson.Empty), + db.Col(ParsedName.of("email"), db.Type.VarChar(Some(254)), Some("varchar"), Nullability.NoNulls, columnDefault = None, None, None, Nil, DebugJson.Empty), + db.Col(ParsedName.of("phone"), db.Type.VarChar(Some(8)), Some("varchar"), Nullability.NoNulls, columnDefault = None, None, None, Nil, DebugJson.Empty), + db.Col(ParsedName.of("likes_pizza"), db.Type.Boolean, Some("bool"), Nullability.NoNulls, columnDefault = None, None, None, Nil, DebugJson.Empty), db.Col( - ParsedName.of("marital_status_id"), - db.Type.VarChar(Some(50)), - Some("varchar"), - Nullability.NoNulls, + parsedName = ParsedName.of("marital_status_id"), + tpe = db.Type.VarChar(Some(50)), + udtName = Some("varchar"), + nullability = Nullability.NoNulls, columnDefault = Some("some-value"), - None, - Nil, - DebugJson.Empty + identity = None, + comment = None, + constraints = Nil, + jsonDescription = DebugJson.Empty ), - db.Col(ParsedName.of("work_email"), db.Type.VarChar(Some(254)), Some("varchar"), Nullability.Nullable, columnDefault = None, None, Nil, DebugJson.Empty), + db.Col(ParsedName.of("work_email"), db.Type.VarChar(Some(254)), Some("varchar"), Nullability.Nullable, columnDefault = None, None, None, Nil, DebugJson.Empty), db.Col( - ParsedName.of("sector"), - db.Type.EnumRef(db.RelationName(Some("myschema"), "sector")), - Some("myschema.sector"), - Nullability.NoNulls, + parsedName = ParsedName.of("sector"), + tpe = db.Type.EnumRef(db.RelationName(Some("myschema"), "sector")), + udtName = Some("myschema.sector"), + nullability = Nullability.NoNulls, columnDefault = Some("PUBLIC"), - None, - Nil, - DebugJson.Empty + identity = None, + comment = None, + constraints = Nil, + jsonDescription = DebugJson.Empty ), db.Col( - ParsedName.of("favorite_number"), - db.Type.EnumRef(db.RelationName(Some("myschema"), "number")), - Some("myschema.number"), - Nullability.NoNulls, + parsedName = ParsedName.of("favorite_number"), + tpe = db.Type.EnumRef(db.RelationName(Some("myschema"), "number")), + udtName = Some("myschema.number"), + nullability = Nullability.NoNulls, columnDefault = Some("one"), - None, - Nil, - DebugJson.Empty + identity = None, + comment = None, + constraints = Nil, + jsonDescription = DebugJson.Empty ) ), Some(db.PrimaryKey(NonEmptyList(db.ColName("id")), db.RelationName(Some("myschema"), "person_pkey"))), @@ -87,8 +91,8 @@ object GenHardcodedFiles extends BleepCodegenScript("GenHardcodedFiles") { val football_club = db.Table( name = db.RelationName(Some("myschema"), "football_club"), cols = NonEmptyList( - db.Col(ParsedName.of("id"), db.Type.Int8, Some("int8"), Nullability.NoNulls, columnDefault = None, None, Nil, DebugJson.Empty), - db.Col(ParsedName.of("name"), db.Type.VarChar(Some(100)), Some("varchar"), Nullability.NoNulls, columnDefault = None, None, Nil, DebugJson.Empty) + db.Col(ParsedName.of("id"), db.Type.Int8, Some("int8"), Nullability.NoNulls, columnDefault = None, None, None, Nil, DebugJson.Empty), + db.Col(ParsedName.of("name"), db.Type.VarChar(Some(100)), Some("varchar"), Nullability.NoNulls, columnDefault = None, None, None, Nil, DebugJson.Empty) ), Some(db.PrimaryKey(NonEmptyList(db.ColName("id")), db.RelationName(Some("myschema"), "football_club_pkey"))), Nil, @@ -97,7 +101,7 @@ object GenHardcodedFiles extends BleepCodegenScript("GenHardcodedFiles") { val marital_status = db.Table( name = db.RelationName(Some("myschema"), "marital_status"), cols = NonEmptyList( - db.Col(ParsedName.of("id"), db.Type.Int8, Some("int8"), Nullability.NoNulls, columnDefault = None, None, Nil, DebugJson.Empty) + db.Col(ParsedName.of("id"), db.Type.Int8, Some("int8"), Nullability.NoNulls, columnDefault = None, None, None, Nil, DebugJson.Empty) ), Some(db.PrimaryKey(NonEmptyList(db.ColName("id")), db.RelationName(Some("myschema"), "marital_status_pkey"))), Nil, @@ -107,9 +111,9 @@ object GenHardcodedFiles extends BleepCodegenScript("GenHardcodedFiles") { val cpk_person = db.Table( name = db.RelationName(Some("compositepk"), "person"), // name clash to ensure we handle it cols = NonEmptyList( - db.Col(ParsedName.of("one"), db.Type.Int8, Some("int8"), Nullability.NoNulls, columnDefault = Some("auto-increment"), None, Nil, DebugJson.Empty), - db.Col(ParsedName.of("two"), db.Type.Text, Some("text"), Nullability.Nullable, columnDefault = Some("auto-increment"), None, Nil, DebugJson.Empty), - db.Col(ParsedName.of("name"), db.Type.Text, Some("text"), Nullability.Nullable, columnDefault = None, None, Nil, DebugJson.Empty) + db.Col(ParsedName.of("one"), db.Type.Int8, Some("int8"), Nullability.NoNulls, columnDefault = Some("auto-increment"), None, None, Nil, DebugJson.Empty), + db.Col(ParsedName.of("two"), db.Type.Text, Some("text"), Nullability.Nullable, columnDefault = Some("auto-increment"), None, None, Nil, DebugJson.Empty), + db.Col(ParsedName.of("name"), db.Type.Text, Some("text"), Nullability.Nullable, columnDefault = None, None, None, Nil, DebugJson.Empty) ), Some(db.PrimaryKey(NonEmptyList(db.ColName("one"), db.ColName("two")), db.RelationName(Some("compositepk"), "person_pkey"))), Nil, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala index 5ecec8503b..58ca624056 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala @@ -21,12 +21,14 @@ import scala.collection.immutable.ListMap import scala.util.Try case class DepartmentRow( - /** Primary key for Department records. */ + /** Primary key for Department records. + Default: nextval('humanresources.department_departmentid_seq'::regclass) */ departmentid: DepartmentId, /** Name of the department. */ name: Name, /** Name of the group to which the department belongs. */ groupname: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala index b7ed5cc464..c3efc0da9b 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala @@ -48,19 +48,26 @@ case class EmployeeRow( /** Employee hired on this date. Constraint CK_Employee_HireDate affecting columns hiredate: (((hiredate >= '1996-07-01'::date) AND (hiredate <= (now() + '1 day'::interval)))) */ hiredate: TypoLocalDate, - /** Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. */ + /** Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. + Default: true */ salariedflag: Flag, /** Number of available vacation hours. + Default: 0 Constraint CK_Employee_VacationHours affecting columns vacationhours: (((vacationhours >= '-40'::integer) AND (vacationhours <= 240))) */ vacationhours: TypoShort, /** Number of available sick leave hours. + Default: 0 Constraint CK_Employee_SickLeaveHours affecting columns sickleavehours: (((sickleavehours >= 0) AND (sickleavehours <= 120))) */ sickleavehours: TypoShort, - /** 0 = Inactive, 1 = Active */ + /** 0 = Inactive, 1 = Active + Default: true */ currentflag: Flag, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime, - /** Where the employee is located in corporate hierarchy. */ + /** Where the employee is located in corporate hierarchy. + Default: '/'::character varying */ organizationnode: Option[String] ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala index a4268360d8..e2f71c532d 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala @@ -41,6 +41,7 @@ case class EmployeedepartmenthistoryRow( /** Date the employee left the department. NULL = Current department. Constraint CK_EmployeeDepartmentHistory_EndDate affecting columns enddate, startdate: (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDate], + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: EmployeedepartmenthistoryId = EmployeedepartmenthistoryId(businessentityid, startdate, departmentid, shiftid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala index 723ddcf57a..8f28af05c7 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala @@ -35,6 +35,7 @@ case class EmployeepayhistoryRow( /** 1 = Salary received monthly, 2 = Salary received biweekly Constraint CK_EmployeePayHistory_PayFrequency affecting columns payfrequency: ((payfrequency = ANY (ARRAY[1, 2]))) */ payfrequency: TypoShort, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: EmployeepayhistoryId = EmployeepayhistoryId(businessentityid, ratechangedate) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala index 7353865ad9..7251618627 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala @@ -24,13 +24,15 @@ import scala.collection.immutable.ListMap import scala.util.Try case class JobcandidateRow( - /** Primary key for JobCandidate records. */ + /** Primary key for JobCandidate records. + Default: nextval('humanresources.jobcandidate_jobcandidateid_seq'::regclass) */ jobcandidateid: JobcandidateId, /** Employee identification number if applicant was hired. Foreign key to Employee.BusinessEntityID. Points to [[employee.EmployeeRow.businessentityid]] */ businessentityid: Option[BusinessentityId], /** Résumé in XML format. */ resume: Option[TypoXml], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala index a80abcbd84..40ce6c120c 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala @@ -22,7 +22,8 @@ import scala.collection.immutable.ListMap import scala.util.Try case class ShiftRow( - /** Primary key for Shift records. */ + /** Primary key for Shift records. + Default: nextval('humanresources.shift_shiftid_seq'::regclass) */ shiftid: ShiftId, /** Shift description. */ name: Name, @@ -30,6 +31,7 @@ case class ShiftRow( starttime: TypoLocalTime, /** Shift end time. */ endtime: TypoLocalTime, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/address/AddressRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/address/AddressRow.scala index 4caf5d06e9..44433edf84 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/address/AddressRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/address/AddressRow.scala @@ -25,7 +25,8 @@ import scala.collection.immutable.ListMap import scala.util.Try case class AddressRow( - /** Primary key for Address records. */ + /** Primary key for Address records. + Default: nextval('person.address_addressid_seq'::regclass) */ addressid: AddressId, /** First street address line. */ addressline1: /* max 60 chars */ String, @@ -40,7 +41,9 @@ case class AddressRow( postalcode: /* max 15 chars */ String, /** Latitude and longitude of this address. */ spatiallocation: Option[TypoBytea], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala index 1e36b5ad87..92ecc3c1f4 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala @@ -22,11 +22,14 @@ import scala.collection.immutable.ListMap import scala.util.Try case class AddresstypeRow( - /** Primary key for AddressType records. */ + /** Primary key for AddressType records. + Default: nextval('person.addresstype_addresstypeid_seq'::regclass) */ addresstypeid: AddresstypeId, /** Address type description. For example, Billing, Home, or Shipping. */ name: Name, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala index 6f3fda7edf..0e04ffcc90 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala @@ -21,9 +21,12 @@ import scala.collection.immutable.ListMap import scala.util.Try case class BusinessentityRow( - /** Primary key for all customers, vendors, and employees. */ + /** Primary key for all customers, vendors, and employees. + Default: nextval('person.businessentity_businessentityid_seq'::regclass) */ businessentityid: BusinessentityId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala index a16c31f18c..1b0bf1a3db 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala @@ -33,7 +33,9 @@ case class BusinessentityaddressRow( /** Primary key. Foreign key to AddressType.AddressTypeID. Points to [[addresstype.AddresstypeRow.addresstypeid]] */ addresstypeid: AddresstypeId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: BusinessentityaddressId = BusinessentityaddressId(businessentityid, addressid, addresstypeid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala index aad790ed47..5733358094 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala @@ -32,7 +32,9 @@ case class BusinessentitycontactRow( /** Primary key. Foreign key to ContactType.ContactTypeID. Points to [[contacttype.ContacttypeRow.contacttypeid]] */ contacttypeid: ContacttypeId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: BusinessentitycontactId = BusinessentitycontactId(businessentityid, personid, contacttypeid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala index 959fe3c1d9..45427f1550 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala @@ -21,10 +21,12 @@ import scala.collection.immutable.ListMap import scala.util.Try case class ContacttypeRow( - /** Primary key for ContactType records. */ + /** Primary key for ContactType records. + Default: nextval('person.contacttype_contacttypeid_seq'::regclass) */ contacttypeid: ContacttypeId, /** Contact type description. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala index ac6cc3e2a7..54980ae867 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala @@ -25,6 +25,7 @@ case class CountryregionRow( countryregioncode: CountryregionId, /** Country or region name. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala index 6bf3c6f63a..a0547f4779 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala @@ -27,11 +27,14 @@ case class EmailaddressRow( /** Primary key. Person associated with this email address. Foreign key to Person.BusinessEntityID Points to [[person.PersonRow.businessentityid]] */ businessentityid: BusinessentityId, - /** Primary key. ID of this email address. */ + /** Primary key. ID of this email address. + Default: nextval('person.emailaddress_emailaddressid_seq'::regclass) */ emailaddressid: Int, /** E-mail address for the person. */ emailaddress: Option[/* max 50 chars */ String], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: EmailaddressId = EmailaddressId(businessentityid, emailaddressid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala index ccc61868b5..5f70b72e72 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala @@ -30,7 +30,9 @@ case class PasswordRow( passwordhash: /* max 128 chars */ String, /** Random value concatenated with the password string before the password is hashed. */ passwordsalt: /* max 10 chars */ String, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/person/PersonRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/person/PersonRow.scala index a4a7a7d115..373e4a5932 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/person/PersonRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/person/PersonRow.scala @@ -34,7 +34,8 @@ case class PersonRow( /** Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact Constraint CK_Person_PersonType affecting columns persontype: (((persontype IS NULL) OR (upper((persontype)::text) = ANY (ARRAY['SC'::text, 'VC'::text, 'IN'::text, 'EM'::text, 'SP'::text, 'GC'::text])))) */ persontype: /* bpchar, max 2 chars */ String, - /** 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. */ + /** 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. + Default: false */ namestyle: NameStyle, /** A courtesy title. For example, Mr. or Ms. */ title: Option[/* max 8 chars */ String], @@ -47,13 +48,16 @@ case class PersonRow( /** Surname suffix. For example, Sr. or Jr. */ suffix: Option[/* max 10 chars */ String], /** 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners. + Default: 0 Constraint CK_Person_EmailPromotion affecting columns emailpromotion: (((emailpromotion >= 0) AND (emailpromotion <= 2))) */ emailpromotion: Int, /** Additional contact information about the person stored in xml format. */ additionalcontactinfo: Option[TypoXml], /** Personal information such as hobbies, and income collected from online shoppers. Used for sales analysis. */ demographics: Option[TypoXml], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala index 8158db37c7..0df74cf9ec 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala @@ -31,6 +31,7 @@ case class PersonphoneRow( /** Kind of phone number. Foreign key to PhoneNumberType.PhoneNumberTypeID. Points to [[phonenumbertype.PhonenumbertypeRow.phonenumbertypeid]] */ phonenumbertypeid: PhonenumbertypeId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: PersonphoneId = PersonphoneId(businessentityid, phonenumber, phonenumbertypeid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala index 6b1fb94ab9..d2b34a945f 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala @@ -21,10 +21,12 @@ import scala.collection.immutable.ListMap import scala.util.Try case class PhonenumbertypeRow( - /** Primary key for telephone number type records. */ + /** Primary key for telephone number type records. + Default: nextval('person.phonenumbertype_phonenumbertypeid_seq'::regclass) */ phonenumbertypeid: PhonenumbertypeId, /** Name of the telephone number type */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala index 0eed4cd196..37f8db51cc 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala @@ -27,21 +27,25 @@ import scala.collection.immutable.ListMap import scala.util.Try case class StateprovinceRow( - /** Primary key for StateProvince records. */ + /** Primary key for StateProvince records. + Default: nextval('person.stateprovince_stateprovinceid_seq'::regclass) */ stateprovinceid: StateprovinceId, /** ISO standard state or province code. */ stateprovincecode: /* bpchar, max 3 chars */ String, /** ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. Points to [[countryregion.CountryregionRow.countryregioncode]] */ countryregioncode: CountryregionId, - /** 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode. */ + /** 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode. + Default: true */ isonlystateprovinceflag: Flag, /** State or province description. */ name: Name, /** ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID. Points to [[sales.salesterritory.SalesterritoryRow.territoryid]] */ territoryid: SalesterritoryId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala index 8abc3ada88..1956b22a0e 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala @@ -25,7 +25,8 @@ import scala.collection.immutable.ListMap import scala.util.Try case class BillofmaterialsRow( - /** Primary key for BillOfMaterials records. */ + /** Primary key for BillOfMaterials records. + Default: nextval('production.billofmaterials_billofmaterialsid_seq'::regclass) */ billofmaterialsid: BillofmaterialsId, /** Parent product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] @@ -37,6 +38,7 @@ case class BillofmaterialsRow( Constraint CK_BillOfMaterials_ProductAssemblyID affecting columns componentid, productassemblyid: ((productassemblyid <> componentid)) */ componentid: ProductId, /** Date the component started being used in the assembly item. + Default: now() Constraint CK_BillOfMaterials_EndDate affecting columns enddate, startdate: (((enddate > startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDateTime, /** Date the component stopped being used in the assembly item. @@ -49,9 +51,11 @@ case class BillofmaterialsRow( Constraint CK_BillOfMaterials_BOMLevel affecting columns bomlevel, perassemblyqty, productassemblyid: ((((productassemblyid IS NULL) AND (bomlevel = 0) AND (perassemblyqty = 1.00)) OR ((productassemblyid IS NOT NULL) AND (bomlevel >= 1)))) */ bomlevel: TypoShort, /** Quantity of the component needed to create the assembly. + Default: 1.00 Constraint CK_BillOfMaterials_BOMLevel affecting columns bomlevel, perassemblyqty, productassemblyid: ((((productassemblyid IS NULL) AND (bomlevel = 0) AND (perassemblyqty = 1.00)) OR ((productassemblyid IS NOT NULL) AND (bomlevel >= 1)))) Constraint CK_BillOfMaterials_PerAssemblyQty affecting columns perassemblyqty: ((perassemblyqty >= 1.00)) */ perassemblyqty: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala index b840db03a7..9f6a06a048 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala @@ -25,6 +25,7 @@ case class CultureRow( cultureid: CultureId, /** Culture description. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala index edace39d82..e777dbf12d 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala @@ -32,7 +32,8 @@ case class DocumentRow( /** Employee who controls the document. Foreign key to Employee.BusinessEntityID Points to [[humanresources.employee.EmployeeRow.businessentityid]] */ owner: BusinessentityId, - /** 0 = This is a folder, 1 = This is a document. */ + /** 0 = This is a folder, 1 = This is a document. + Default: false */ folderflag: Flag, /** File name of the document */ filename: /* max 400 chars */ String, @@ -40,7 +41,8 @@ case class DocumentRow( fileextension: Option[/* max 8 chars */ String], /** Revision number of the document. */ revision: /* bpchar, max 5 chars */ String, - /** Engineering change approval number. */ + /** Engineering change approval number. + Default: 0 */ changenumber: Int, /** 1 = Pending approval, 2 = Approved, 3 = Obsolete Constraint CK_Document_Status affecting columns status: (((status >= 1) AND (status <= 3))) */ @@ -49,10 +51,13 @@ case class DocumentRow( documentsummary: Option[String], /** Complete document. */ document: Option[TypoBytea], - /** ROWGUIDCOL number uniquely identifying the record. Required for FileStream. */ + /** ROWGUIDCOL number uniquely identifying the record. Required for FileStream. + Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime, - /** Primary key for Document records. */ + /** Primary key for Document records. + Default: '/'::character varying */ documentnode: DocumentId ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala index 64058437b2..241a693cbe 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala @@ -23,10 +23,12 @@ import scala.collection.immutable.ListMap import scala.util.Try case class IllustrationRow( - /** Primary key for Illustration records. */ + /** Primary key for Illustration records. + Default: nextval('production.illustration_illustrationid_seq'::regclass) */ illustrationid: IllustrationId, /** Illustrations used in manufacturing instructions. Stored as XML. */ diagram: Option[TypoXml], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/location/LocationRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/location/LocationRow.scala index 2bb9c09488..35f2785d8b 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/location/LocationRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/location/LocationRow.scala @@ -23,16 +23,20 @@ import scala.collection.immutable.ListMap import scala.util.Try case class LocationRow( - /** Primary key for Location records. */ + /** Primary key for Location records. + Default: nextval('production.location_locationid_seq'::regclass) */ locationid: LocationId, /** Location description. */ name: Name, /** Standard hourly cost of the manufacturing location. + Default: 0.00 Constraint CK_Location_CostRate affecting columns costrate: ((costrate >= 0.00)) */ costrate: BigDecimal, /** Work capacity (in hours) of the manufacturing location. + Default: 0.00 Constraint CK_Location_Availability affecting columns availability: ((availability >= 0.00)) */ availability: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/product/ProductRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/product/ProductRow.scala index 86c40c88b0..3a46e1c65f 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/product/ProductRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/product/ProductRow.scala @@ -29,15 +29,18 @@ import scala.collection.immutable.ListMap import scala.util.Try case class ProductRow( - /** Primary key for Product records. */ + /** Primary key for Product records. + Default: nextval('production.product_productid_seq'::regclass) */ productid: ProductId, /** Name of the product. */ name: Name, /** Unique product identification number. */ productnumber: /* max 25 chars */ String, - /** 0 = Product is purchased, 1 = Product is manufactured in-house. */ + /** 0 = Product is purchased, 1 = Product is manufactured in-house. + Default: true */ makeflag: Flag, - /** 0 = Product is not a salable item. 1 = Product is salable. */ + /** 0 = Product is not a salable item. 1 = Product is salable. + Default: true */ finishedgoodsflag: Flag, /** Product color. */ color: Option[/* max 15 chars */ String], @@ -90,7 +93,9 @@ case class ProductRow( sellenddate: Option[TypoLocalDateTime], /** Date the product was discontinued. */ discontinueddate: Option[TypoLocalDateTime], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala index ad9a4c4553..235fa9709a 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala @@ -22,11 +22,14 @@ import scala.collection.immutable.ListMap import scala.util.Try case class ProductcategoryRow( - /** Primary key for ProductCategory records. */ + /** Primary key for ProductCategory records. + Default: nextval('production.productcategory_productcategoryid_seq'::regclass) */ productcategoryid: ProductcategoryId, /** Category description. */ name: Name, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala index a3256073ba..21cba11dd4 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala @@ -35,6 +35,7 @@ case class ProductcosthistoryRow( /** Standard cost of the product. Constraint CK_ProductCostHistory_StandardCost affecting columns standardcost: ((standardcost >= 0.00)) */ standardcost: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductcosthistoryId = ProductcosthistoryId(productid, startdate) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala index 0468e42f69..0124a9496a 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala @@ -23,11 +23,14 @@ import scala.collection.immutable.ListMap import scala.util.Try case class ProductdescriptionRow( - /** Primary key for ProductDescription records. */ + /** Primary key for ProductDescription records. + Default: nextval('production.productdescription_productdescriptionid_seq'::regclass) */ productdescriptionid: ProductdescriptionId, /** Description of the product. */ description: /* max 400 chars */ String, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala index 2d52d050b9..d019ffccc9 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala @@ -25,8 +25,10 @@ case class ProductdocumentRow( /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ productid: ProductId, + /** Default: now() */ modifieddate: TypoLocalDateTime, /** Document identification number. Foreign key to Document.DocumentNode. + Default: '/'::character varying Points to [[document.DocumentRow.documentnode]] */ documentnode: DocumentId ){ diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala index 81fb5149cd..29af591191 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala @@ -37,9 +37,12 @@ case class ProductinventoryRow( /** Storage container on a shelf in an inventory location. Constraint CK_ProductInventory_Bin affecting columns bin: (((bin >= 0) AND (bin <= 100))) */ bin: TypoShort, - /** Quantity of products in the inventory location. */ + /** Quantity of products in the inventory location. + Default: 0 */ quantity: TypoShort, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductinventoryId = ProductinventoryId(productid, locationid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala index b5cf970d88..c4a7e5a102 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala @@ -35,6 +35,7 @@ case class ProductlistpricehistoryRow( /** Product list price. Constraint CK_ProductListPriceHistory_ListPrice affecting columns listprice: ((listprice > 0.00)) */ listprice: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductlistpricehistoryId = ProductlistpricehistoryId(productid, startdate) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala index 536fa0cee7..1777d941a6 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala @@ -25,7 +25,8 @@ import scala.collection.immutable.ListMap import scala.util.Try case class ProductmodelRow( - /** Primary key for ProductModel records. */ + /** Primary key for ProductModel records. + Default: nextval('production.productmodel_productmodelid_seq'::regclass) */ productmodelid: ProductmodelId, /** Product model description. */ name: Name, @@ -33,7 +34,9 @@ case class ProductmodelRow( catalogdescription: Option[TypoXml], /** Manufacturing instructions in xml format. */ instructions: Option[TypoXml], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala index 726ae4d3d1..c7dd419b6e 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala @@ -28,6 +28,7 @@ case class ProductmodelillustrationRow( /** Primary key. Foreign key to Illustration.IllustrationID. Points to [[illustration.IllustrationRow.illustrationid]] */ illustrationid: IllustrationId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductmodelillustrationId = ProductmodelillustrationId(productmodelid, illustrationid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala index abd12c8431..53ab0be916 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala @@ -32,6 +32,7 @@ case class ProductmodelproductdescriptioncultureRow( /** Culture identification number. Foreign key to Culture.CultureID. Points to [[culture.CultureRow.cultureid]] */ cultureid: CultureId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductmodelproductdescriptioncultureId = ProductmodelproductdescriptioncultureId(productmodelid, productdescriptionid, cultureid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala index 524e6b9232..5463fa62ab 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala @@ -23,7 +23,8 @@ import scala.collection.immutable.ListMap import scala.util.Try case class ProductphotoRow( - /** Primary key for ProductPhoto records. */ + /** Primary key for ProductPhoto records. + Default: nextval('production.productphoto_productphotoid_seq'::regclass) */ productphotoid: ProductphotoId, /** Small image of the product. */ thumbnailphoto: Option[TypoBytea], @@ -33,6 +34,7 @@ case class ProductphotoRow( largephoto: Option[TypoBytea], /** Large image file name. */ largephotofilename: Option[/* max 50 chars */ String], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala index 00787c43cb..c8b8e703b9 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala @@ -29,8 +29,10 @@ case class ProductproductphotoRow( /** Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID. Points to [[productphoto.ProductphotoRow.productphotoid]] */ productphotoid: ProductphotoId, - /** 0 = Photo is not the principal image. 1 = Photo is the principal image. */ + /** 0 = Photo is not the principal image. 1 = Photo is the principal image. + Default: false */ primary: Flag, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductproductphotoId = ProductproductphotoId(productid, productphotoid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala index 49f61f1421..01a79fa15a 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala @@ -24,14 +24,16 @@ import scala.collection.immutable.ListMap import scala.util.Try case class ProductreviewRow( - /** Primary key for ProductReview records. */ + /** Primary key for ProductReview records. + Default: nextval('production.productreview_productreviewid_seq'::regclass) */ productreviewid: ProductreviewId, /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ productid: ProductId, /** Name of the reviewer. */ reviewername: Name, - /** Date review was submitted. */ + /** Date review was submitted. + Default: now() */ reviewdate: TypoLocalDateTime, /** Reviewer's e-mail address. */ emailaddress: /* max 50 chars */ String, @@ -40,6 +42,7 @@ case class ProductreviewRow( rating: Int, /** Reviewer's comments */ comments: Option[/* max 3850 chars */ String], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala index f5c80aa3f7..54bf98b1fa 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala @@ -23,14 +23,17 @@ import scala.collection.immutable.ListMap import scala.util.Try case class ProductsubcategoryRow( - /** Primary key for ProductSubcategory records. */ + /** Primary key for ProductSubcategory records. + Default: nextval('production.productsubcategory_productsubcategoryid_seq'::regclass) */ productsubcategoryid: ProductsubcategoryId, /** Product category identification number. Foreign key to ProductCategory.ProductCategoryID. Points to [[productcategory.ProductcategoryRow.productcategoryid]] */ productcategoryid: ProductcategoryId, /** Subcategory description. */ name: Name, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala index f4ba71df91..79e7809652 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala @@ -21,10 +21,12 @@ import scala.collection.immutable.ListMap import scala.util.Try case class ScrapreasonRow( - /** Primary key for ScrapReason records. */ + /** Primary key for ScrapReason records. + Default: nextval('production.scrapreason_scrapreasonid_seq'::regclass) */ scrapreasonid: ScrapreasonId, /** Failure description. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala index 599ebc3bd9..4765b4fc4e 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala @@ -23,16 +23,19 @@ import scala.collection.immutable.ListMap import scala.util.Try case class TransactionhistoryRow( - /** Primary key for TransactionHistory records. */ + /** Primary key for TransactionHistory records. + Default: nextval('production.transactionhistory_transactionid_seq'::regclass) */ transactionid: TransactionhistoryId, /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ productid: ProductId, /** Purchase order, sales order, or work order identification number. */ referenceorderid: Int, - /** Line number associated with the purchase order, sales order, or work order. */ + /** Line number associated with the purchase order, sales order, or work order. + Default: 0 */ referenceorderlineid: Int, - /** Date and time of the transaction. */ + /** Date and time of the transaction. + Default: now() */ transactiondate: TypoLocalDateTime, /** W = WorkOrder, S = SalesOrder, P = PurchaseOrder Constraint CK_TransactionHistory_TransactionType affecting columns transactiontype: ((upper((transactiontype)::text) = ANY (ARRAY['W'::text, 'S'::text, 'P'::text]))) */ @@ -41,6 +44,7 @@ case class TransactionhistoryRow( quantity: Int, /** Product cost. */ actualcost: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala index 47c386b121..56ecef4ab2 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala @@ -28,9 +28,11 @@ case class TransactionhistoryarchiveRow( productid: Int, /** Purchase order, sales order, or work order identification number. */ referenceorderid: Int, - /** Line number associated with the purchase order, sales order, or work order. */ + /** Line number associated with the purchase order, sales order, or work order. + Default: 0 */ referenceorderlineid: Int, - /** Date and time of the transaction. */ + /** Date and time of the transaction. + Default: now() */ transactiondate: TypoLocalDateTime, /** W = Work Order, S = Sales Order, P = Purchase Order Constraint CK_TransactionHistoryArchive_TransactionType affecting columns transactiontype: ((upper((transactiontype)::text) = ANY (ARRAY['W'::text, 'S'::text, 'P'::text]))) */ @@ -39,6 +41,7 @@ case class TransactionhistoryarchiveRow( quantity: Int, /** Product cost. */ actualcost: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala index d124d1b73a..8d8a09a0c3 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala @@ -25,6 +25,7 @@ case class UnitmeasureRow( unitmeasurecode: UnitmeasureId, /** Unit of measure description. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala index c901771bf3..fbf0322158 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala @@ -25,7 +25,8 @@ import scala.collection.immutable.ListMap import scala.util.Try case class WorkorderRow( - /** Primary key for WorkOrder records. */ + /** Primary key for WorkOrder records. + Default: nextval('production.workorder_workorderid_seq'::regclass) */ workorderid: WorkorderId, /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ @@ -47,6 +48,7 @@ case class WorkorderRow( /** Reason for inspection failure. Points to [[scrapreason.ScrapreasonRow.scrapreasonid]] */ scrapreasonid: Option[ScrapreasonId], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala index eac1de7835..97eb006464 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala @@ -56,6 +56,7 @@ case class WorkorderroutingRow( /** Actual manufacturing cost. Constraint CK_WorkOrderRouting_ActualCost affecting columns actualcost: ((actualcost > 0.00)) */ actualcost: Option[BigDecimal], + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: WorkorderroutingId = WorkorderroutingId(workorderid, productid, operationsequence) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestFields.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestFields.scala new file mode 100644 index 0000000000..643c78dd65 --- /dev/null +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestFields.scala @@ -0,0 +1,19 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import typo.dsl.SqlExpr.Field +import typo.dsl.SqlExpr.IdField + +trait IdentityTestFields[Row] { + val alwaysGenerated: Field[Int, Row] + val defaultGenerated: Field[Int, Row] + val name: IdField[IdentityTestId, Row] +} +object IdentityTestFields extends IdentityTestStructure[IdentityTestRow](None, identity, (_, x) => x) + diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestId.scala new file mode 100644 index 0000000000..7f2097b971 --- /dev/null +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestId.scala @@ -0,0 +1,37 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import adventureworks.Text +import anorm.Column +import anorm.ParameterMetaData +import anorm.ToStatement +import play.api.libs.json.Reads +import play.api.libs.json.Writes +import typo.dsl.Bijection + +/** Type for the primary key of table `public.identity-test` */ +case class IdentityTestId(value: /* max 250 chars */ String) extends AnyVal +object IdentityTestId { + implicit lazy val arrayColumn: Column[Array[IdentityTestId]] = Column.columnToArray(column, implicitly) + implicit lazy val arrayToStatement: ToStatement[Array[IdentityTestId]] = ToStatement.arrayToParameter(ParameterMetaData.StringParameterMetaData).contramap(_.map(_.value)) + implicit lazy val bijection: Bijection[IdentityTestId, /* max 250 chars */ String] = Bijection[IdentityTestId, /* max 250 chars */ String](_.value)(IdentityTestId.apply) + implicit lazy val column: Column[IdentityTestId] = Column.columnToString.map(IdentityTestId.apply) + implicit lazy val ordering: Ordering[IdentityTestId] = Ordering.by(_.value) + implicit lazy val parameterMetadata: ParameterMetaData[IdentityTestId] = new ParameterMetaData[IdentityTestId] { + override def sqlType: String = ParameterMetaData.StringParameterMetaData.sqlType + override def jdbcType: Int = ParameterMetaData.StringParameterMetaData.jdbcType + } + implicit lazy val reads: Reads[IdentityTestId] = Reads.StringReads.map(IdentityTestId.apply) + implicit lazy val text: Text[IdentityTestId] = new Text[IdentityTestId] { + override def unsafeEncode(v: IdentityTestId, sb: StringBuilder) = Text.stringInstance.unsafeEncode(v.value, sb) + override def unsafeArrayEncode(v: IdentityTestId, sb: StringBuilder) = Text.stringInstance.unsafeArrayEncode(v.value, sb) + } + implicit lazy val toStatement: ToStatement[IdentityTestId] = ToStatement.stringToStatement.contramap(_.value) + implicit lazy val writes: Writes[IdentityTestId] = Writes.StringWrites.contramap(_.value) +} diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepo.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepo.scala new file mode 100644 index 0000000000..243c43ef44 --- /dev/null +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepo.scala @@ -0,0 +1,30 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import java.sql.Connection +import typo.dsl.DeleteBuilder +import typo.dsl.SelectBuilder +import typo.dsl.UpdateBuilder + +trait IdentityTestRepo { + def delete(name: IdentityTestId)(implicit c: Connection): Boolean + def delete: DeleteBuilder[IdentityTestFields, IdentityTestRow] + def insert(unsaved: IdentityTestRow)(implicit c: Connection): IdentityTestRow + def insertStreaming(unsaved: Iterator[IdentityTestRow], batchSize: Int)(implicit c: Connection): Long + def insert(unsaved: IdentityTestRowUnsaved)(implicit c: Connection): IdentityTestRow + /* NOTE: this functionality requires PostgreSQL 16 or later! */ + def insertUnsavedStreaming(unsaved: Iterator[IdentityTestRowUnsaved], batchSize: Int)(implicit c: Connection): Long + def select: SelectBuilder[IdentityTestFields, IdentityTestRow] + def selectAll(implicit c: Connection): List[IdentityTestRow] + def selectById(name: IdentityTestId)(implicit c: Connection): Option[IdentityTestRow] + def selectByIds(names: Array[IdentityTestId])(implicit c: Connection): List[IdentityTestRow] + def update(row: IdentityTestRow)(implicit c: Connection): Boolean + def update: UpdateBuilder[IdentityTestFields, IdentityTestRow] + def upsert(unsaved: IdentityTestRow)(implicit c: Connection): IdentityTestRow +} diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoImpl.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoImpl.scala new file mode 100644 index 0000000000..8640391f3a --- /dev/null +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoImpl.scala @@ -0,0 +1,119 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import adventureworks.customtypes.Defaulted +import adventureworks.streamingInsert +import anorm.NamedParameter +import anorm.ParameterValue +import anorm.RowParser +import anorm.SQL +import anorm.SimpleSql +import anorm.SqlStringInterpolation +import anorm.ToStatement +import java.sql.Connection +import typo.dsl.DeleteBuilder +import typo.dsl.SelectBuilder +import typo.dsl.SelectBuilderSql +import typo.dsl.UpdateBuilder + +class IdentityTestRepoImpl extends IdentityTestRepo { + override def delete(name: IdentityTestId)(implicit c: Connection): Boolean = { + SQL"""delete from public.identity-test where "name" = ${ParameterValue(name, null, IdentityTestId.toStatement)}""".executeUpdate() > 0 + } + override def delete: DeleteBuilder[IdentityTestFields, IdentityTestRow] = { + DeleteBuilder("public.identity-test", IdentityTestFields) + } + override def insert(unsaved: IdentityTestRow)(implicit c: Connection): IdentityTestRow = { + SQL"""insert into public.identity-test("always_generated", "default_generated", "name") + values (${ParameterValue(unsaved.alwaysGenerated, null, ToStatement.intToStatement)}::int4, ${ParameterValue(unsaved.defaultGenerated, null, ToStatement.intToStatement)}::int4, ${ParameterValue(unsaved.name, null, IdentityTestId.toStatement)}) + returning "always_generated", "default_generated", "name" + """ + .executeInsert(IdentityTestRow.rowParser(1).single) + + } + override def insertStreaming(unsaved: Iterator[IdentityTestRow], batchSize: Int)(implicit c: Connection): Long = { + streamingInsert(s"""COPY public.identity-test("always_generated", "default_generated", "name") FROM STDIN""", batchSize, unsaved)(IdentityTestRow.text, c) + } + override def insert(unsaved: IdentityTestRowUnsaved)(implicit c: Connection): IdentityTestRow = { + val namedParameters = List( + Some((NamedParameter("name", ParameterValue(unsaved.name, null, IdentityTestId.toStatement)), "")), + unsaved.defaultGenerated match { + case Defaulted.UseDefault => None + case Defaulted.Provided(value) => Some((NamedParameter("default_generated", ParameterValue(value, null, ToStatement.intToStatement)), "::int4")) + } + ).flatten + val quote = '"'.toString + if (namedParameters.isEmpty) { + SQL"""insert into public.identity-test default values + returning "always_generated", "default_generated", "name" + """ + .executeInsert(IdentityTestRow.rowParser(1).single) + } else { + val q = s"""insert into public.identity-test(${namedParameters.map{case (x, _) => quote + x.name + quote}.mkString(", ")}) + values (${namedParameters.map{ case (np, cast) => s"{${np.name}}$cast"}.mkString(", ")}) + returning "always_generated", "default_generated", "name" + """ + SimpleSql(SQL(q), namedParameters.map { case (np, _) => np.tupled }.toMap, RowParser.successful) + .executeInsert(IdentityTestRow.rowParser(1).single) + } + + } + /* NOTE: this functionality requires PostgreSQL 16 or later! */ + override def insertUnsavedStreaming(unsaved: Iterator[IdentityTestRowUnsaved], batchSize: Int)(implicit c: Connection): Long = { + streamingInsert(s"""COPY public.identity-test("name", "default_generated") FROM STDIN (DEFAULT '__DEFAULT_VALUE__')""", batchSize, unsaved)(IdentityTestRowUnsaved.text, c) + } + override def select: SelectBuilder[IdentityTestFields, IdentityTestRow] = { + SelectBuilderSql("public.identity-test", IdentityTestFields, IdentityTestRow.rowParser) + } + override def selectAll(implicit c: Connection): List[IdentityTestRow] = { + SQL"""select "always_generated", "default_generated", "name" + from public.identity-test + """.as(IdentityTestRow.rowParser(1).*) + } + override def selectById(name: IdentityTestId)(implicit c: Connection): Option[IdentityTestRow] = { + SQL"""select "always_generated", "default_generated", "name" + from public.identity-test + where "name" = ${ParameterValue(name, null, IdentityTestId.toStatement)} + """.as(IdentityTestRow.rowParser(1).singleOpt) + } + override def selectByIds(names: Array[IdentityTestId])(implicit c: Connection): List[IdentityTestRow] = { + SQL"""select "always_generated", "default_generated", "name" + from public.identity-test + where "name" = ANY(${names}) + """.as(IdentityTestRow.rowParser(1).*) + + } + override def update(row: IdentityTestRow)(implicit c: Connection): Boolean = { + val name = row.name + SQL"""update public.identity-test + set "always_generated" = ${ParameterValue(row.alwaysGenerated, null, ToStatement.intToStatement)}::int4, + "default_generated" = ${ParameterValue(row.defaultGenerated, null, ToStatement.intToStatement)}::int4 + where "name" = ${ParameterValue(name, null, IdentityTestId.toStatement)} + """.executeUpdate() > 0 + } + override def update: UpdateBuilder[IdentityTestFields, IdentityTestRow] = { + UpdateBuilder("public.identity-test", IdentityTestFields, IdentityTestRow.rowParser) + } + override def upsert(unsaved: IdentityTestRow)(implicit c: Connection): IdentityTestRow = { + SQL"""insert into public.identity-test("always_generated", "default_generated", "name") + values ( + ${ParameterValue(unsaved.alwaysGenerated, null, ToStatement.intToStatement)}::int4, + ${ParameterValue(unsaved.defaultGenerated, null, ToStatement.intToStatement)}::int4, + ${ParameterValue(unsaved.name, null, IdentityTestId.toStatement)} + ) + on conflict ("name") + do update set + "always_generated" = EXCLUDED."always_generated", + "default_generated" = EXCLUDED."default_generated" + returning "always_generated", "default_generated", "name" + """ + .executeInsert(IdentityTestRow.rowParser(1).single) + + } +} diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoMock.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoMock.scala new file mode 100644 index 0000000000..6d4e814952 --- /dev/null +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoMock.scala @@ -0,0 +1,83 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import java.sql.Connection +import scala.annotation.nowarn +import typo.dsl.DeleteBuilder +import typo.dsl.DeleteBuilder.DeleteBuilderMock +import typo.dsl.DeleteParams +import typo.dsl.SelectBuilder +import typo.dsl.SelectBuilderMock +import typo.dsl.SelectParams +import typo.dsl.UpdateBuilder +import typo.dsl.UpdateBuilder.UpdateBuilderMock +import typo.dsl.UpdateParams + +class IdentityTestRepoMock(toRow: Function1[IdentityTestRowUnsaved, IdentityTestRow], + map: scala.collection.mutable.Map[IdentityTestId, IdentityTestRow] = scala.collection.mutable.Map.empty) extends IdentityTestRepo { + override def delete(name: IdentityTestId)(implicit c: Connection): Boolean = { + map.remove(name).isDefined + } + override def delete: DeleteBuilder[IdentityTestFields, IdentityTestRow] = { + DeleteBuilderMock(DeleteParams.empty, IdentityTestFields, map) + } + override def insert(unsaved: IdentityTestRow)(implicit c: Connection): IdentityTestRow = { + val _ = if (map.contains(unsaved.name)) + sys.error(s"id ${unsaved.name} already exists") + else + map.put(unsaved.name, unsaved) + + unsaved + } + override def insertStreaming(unsaved: Iterator[IdentityTestRow], batchSize: Int)(implicit c: Connection): Long = { + unsaved.foreach { row => + map += (row.name -> row) + } + unsaved.size.toLong + } + override def insert(unsaved: IdentityTestRowUnsaved)(implicit c: Connection): IdentityTestRow = { + insert(toRow(unsaved)) + } + /* NOTE: this functionality requires PostgreSQL 16 or later! */ + override def insertUnsavedStreaming(unsaved: Iterator[IdentityTestRowUnsaved], batchSize: Int)(implicit c: Connection): Long = { + unsaved.foreach { unsavedRow => + val row = toRow(unsavedRow) + map += (row.name -> row) + } + unsaved.size.toLong + } + override def select: SelectBuilder[IdentityTestFields, IdentityTestRow] = { + SelectBuilderMock(IdentityTestFields, () => map.values.toList, SelectParams.empty) + } + override def selectAll(implicit c: Connection): List[IdentityTestRow] = { + map.values.toList + } + override def selectById(name: IdentityTestId)(implicit c: Connection): Option[IdentityTestRow] = { + map.get(name) + } + override def selectByIds(names: Array[IdentityTestId])(implicit c: Connection): List[IdentityTestRow] = { + names.flatMap(map.get).toList + } + override def update(row: IdentityTestRow)(implicit c: Connection): Boolean = { + map.get(row.name) match { + case Some(`row`) => false + case Some(_) => + map.put(row.name, row): @nowarn + true + case None => false + } + } + override def update: UpdateBuilder[IdentityTestFields, IdentityTestRow] = { + UpdateBuilderMock(UpdateParams.empty, IdentityTestFields, map) + } + override def upsert(unsaved: IdentityTestRow)(implicit c: Connection): IdentityTestRow = { + map.put(unsaved.name, unsaved): @nowarn + unsaved + } +} diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala new file mode 100644 index 0000000000..e45c8bd736 --- /dev/null +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala @@ -0,0 +1,65 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import adventureworks.Text +import anorm.Column +import anorm.RowParser +import anorm.Success +import play.api.libs.json.JsObject +import play.api.libs.json.JsResult +import play.api.libs.json.JsValue +import play.api.libs.json.OWrites +import play.api.libs.json.Reads +import play.api.libs.json.Writes +import scala.collection.immutable.ListMap +import scala.util.Try + +case class IdentityTestRow( + /** Identity ALWAYS, identityStart: 1, identityIncrement: 1, identityMaximum: 2147483647, identityMinimum: 1 */ + alwaysGenerated: Int, + /** Identity BY DEFAULT, identityStart: 1, identityIncrement: 1, identityMaximum: 2147483647, identityMinimum: 1 */ + defaultGenerated: Int, + name: IdentityTestId +) + +object IdentityTestRow { + implicit lazy val reads: Reads[IdentityTestRow] = Reads[IdentityTestRow](json => JsResult.fromTry( + Try( + IdentityTestRow( + alwaysGenerated = json.\("always_generated").as(Reads.IntReads), + defaultGenerated = json.\("default_generated").as(Reads.IntReads), + name = json.\("name").as(IdentityTestId.reads) + ) + ) + ), + ) + def rowParser(idx: Int): RowParser[IdentityTestRow] = RowParser[IdentityTestRow] { row => + Success( + IdentityTestRow( + alwaysGenerated = row(idx + 0)(Column.columnToInt), + defaultGenerated = row(idx + 1)(Column.columnToInt), + name = row(idx + 2)(IdentityTestId.column) + ) + ) + } + implicit lazy val text: Text[IdentityTestRow] = Text.instance[IdentityTestRow]{ (row, sb) => + Text.intInstance.unsafeEncode(row.alwaysGenerated, sb) + sb.append(Text.DELIMETER) + Text.intInstance.unsafeEncode(row.defaultGenerated, sb) + sb.append(Text.DELIMETER) + IdentityTestId.text.unsafeEncode(row.name, sb) + } + implicit lazy val writes: OWrites[IdentityTestRow] = OWrites[IdentityTestRow](o => + new JsObject(ListMap[String, JsValue]( + "always_generated" -> Writes.IntWrites.writes(o.alwaysGenerated), + "default_generated" -> Writes.IntWrites.writes(o.defaultGenerated), + "name" -> IdentityTestId.writes.writes(o.name) + )) + ) +} diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRowUnsaved.scala new file mode 100644 index 0000000000..e5d1ce1235 --- /dev/null +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRowUnsaved.scala @@ -0,0 +1,58 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import adventureworks.Text +import adventureworks.customtypes.Defaulted +import play.api.libs.json.JsObject +import play.api.libs.json.JsResult +import play.api.libs.json.JsValue +import play.api.libs.json.OWrites +import play.api.libs.json.Reads +import play.api.libs.json.Writes +import scala.collection.immutable.ListMap +import scala.util.Try + +/** This class corresponds to a row in table `public.identity-test` which has not been persisted yet */ +case class IdentityTestRowUnsaved( + name: IdentityTestId, + /** Identity BY DEFAULT, identityStart: 1, identityIncrement: 1, identityMaximum: 2147483647, identityMinimum: 1 */ + defaultGenerated: Defaulted[Int] +) { + def toRow(defaultGeneratedDefault: => Int, alwaysGeneratedDefault: => Int): IdentityTestRow = + IdentityTestRow( + name = name, + defaultGenerated = defaultGenerated match { + case Defaulted.UseDefault => defaultGeneratedDefault + case Defaulted.Provided(value) => value + }, + alwaysGenerated = alwaysGeneratedDefault + ) +} +object IdentityTestRowUnsaved { + implicit lazy val reads: Reads[IdentityTestRowUnsaved] = Reads[IdentityTestRowUnsaved](json => JsResult.fromTry( + Try( + IdentityTestRowUnsaved( + name = json.\("name").as(IdentityTestId.reads), + defaultGenerated = json.\("default_generated").as(Defaulted.reads(Reads.IntReads)) + ) + ) + ), + ) + implicit lazy val text: Text[IdentityTestRowUnsaved] = Text.instance[IdentityTestRowUnsaved]{ (row, sb) => + IdentityTestId.text.unsafeEncode(row.name, sb) + sb.append(Text.DELIMETER) + Defaulted.text(Text.intInstance).unsafeEncode(row.defaultGenerated, sb) + } + implicit lazy val writes: OWrites[IdentityTestRowUnsaved] = OWrites[IdentityTestRowUnsaved](o => + new JsObject(ListMap[String, JsValue]( + "name" -> IdentityTestId.writes.writes(o.name), + "default_generated" -> Defaulted.writes(Writes.IntWrites).writes(o.defaultGenerated) + )) + ) +} diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestStructure.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestStructure.scala new file mode 100644 index 0000000000..60539f99aa --- /dev/null +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestStructure.scala @@ -0,0 +1,28 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import typo.dsl.SqlExpr.Field +import typo.dsl.SqlExpr.FieldLikeNoHkt +import typo.dsl.SqlExpr.IdField +import typo.dsl.Structure.Relation + +class IdentityTestStructure[Row](val prefix: Option[String], val extract: Row => IdentityTestRow, val merge: (Row, IdentityTestRow) => Row) + extends Relation[IdentityTestFields, IdentityTestRow, Row] + with IdentityTestFields[Row] { outer => + + override val alwaysGenerated = new Field[Int, Row](prefix, "always_generated", None, Some("int4"))(x => extract(x).alwaysGenerated, (row, value) => merge(row, extract(row).copy(alwaysGenerated = value))) + override val defaultGenerated = new Field[Int, Row](prefix, "default_generated", None, Some("int4"))(x => extract(x).defaultGenerated, (row, value) => merge(row, extract(row).copy(defaultGenerated = value))) + override val name = new IdField[IdentityTestId, Row](prefix, "name", None, None)(x => extract(x).name, (row, value) => merge(row, extract(row).copy(name = value))) + + override val columns: List[FieldLikeNoHkt[?, Row]] = + List[FieldLikeNoHkt[?, Row]](alwaysGenerated, defaultGenerated, name) + + override def copy[NewRow](prefix: Option[String], extract: NewRow => IdentityTestRow, merge: (NewRow, IdentityTestRow) => NewRow): IdentityTestStructure[NewRow] = + new IdentityTestStructure(prefix, extract, merge) +} diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/users/UsersRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/users/UsersRow.scala index eba74100fe..05c0185652 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/users/UsersRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/users/UsersRow.scala @@ -28,6 +28,7 @@ case class UsersRow( lastName: Option[String], email: TypoUnknownCitext, password: String, + /** Default: now() */ createdAt: TypoInstant, verifiedOn: Option[TypoInstant] ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala index e068bc8a48..078ee34c6e 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala @@ -54,6 +54,7 @@ case class ProductvendorRow( /** The product's unit of measure. Points to [[production.unitmeasure.UnitmeasureRow.unitmeasurecode]] */ unitmeasurecode: UnitmeasureId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductvendorId = ProductvendorId(productid, businessentityid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala index 2b05f7161e..23361b9690 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala @@ -28,7 +28,8 @@ case class PurchaseorderdetailRow( /** Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID. Points to [[purchaseorderheader.PurchaseorderheaderRow.purchaseorderid]] */ purchaseorderid: PurchaseorderheaderId, - /** Primary key. One line number per purchased product. */ + /** Primary key. One line number per purchased product. + Default: nextval('purchasing.purchaseorderdetail_purchaseorderdetailid_seq'::regclass) */ purchaseorderdetailid: Int, /** Date the product is expected to be received. */ duedate: TypoLocalDateTime, @@ -47,6 +48,7 @@ case class PurchaseorderdetailRow( /** Quantity rejected during inspection. Constraint CK_PurchaseOrderDetail_RejectedQty affecting columns rejectedqty: ((rejectedqty >= 0.00)) */ rejectedqty: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: PurchaseorderdetailId = PurchaseorderdetailId(purchaseorderid, purchaseorderdetailid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala index 4400581c3f..b26f21bf1e 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala @@ -25,11 +25,14 @@ import scala.collection.immutable.ListMap import scala.util.Try case class PurchaseorderheaderRow( - /** Primary key. */ + /** Primary key. + Default: nextval('purchasing.purchaseorderheader_purchaseorderid_seq'::regclass) */ purchaseorderid: PurchaseorderheaderId, - /** Incremental number to track changes to the purchase order over time. */ + /** Incremental number to track changes to the purchase order over time. + Default: 0 */ revisionnumber: TypoShort, /** Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete + Default: 1 Constraint CK_PurchaseOrderHeader_Status affecting columns status: (((status >= 1) AND (status <= 4))) */ status: TypoShort, /** Employee who created the purchase order. Foreign key to Employee.BusinessEntityID. @@ -42,20 +45,25 @@ case class PurchaseorderheaderRow( Points to [[shipmethod.ShipmethodRow.shipmethodid]] */ shipmethodid: ShipmethodId, /** Purchase order creation date. + Default: now() Constraint CK_PurchaseOrderHeader_ShipDate affecting columns orderdate, shipdate: (((shipdate >= orderdate) OR (shipdate IS NULL))) */ orderdate: TypoLocalDateTime, /** Estimated shipment date from the vendor. Constraint CK_PurchaseOrderHeader_ShipDate affecting columns orderdate, shipdate: (((shipdate >= orderdate) OR (shipdate IS NULL))) */ shipdate: Option[TypoLocalDateTime], /** Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. + Default: 0.00 Constraint CK_PurchaseOrderHeader_SubTotal affecting columns subtotal: ((subtotal >= 0.00)) */ subtotal: BigDecimal, /** Tax amount. + Default: 0.00 Constraint CK_PurchaseOrderHeader_TaxAmt affecting columns taxamt: ((taxamt >= 0.00)) */ taxamt: BigDecimal, /** Shipping cost. + Default: 0.00 Constraint CK_PurchaseOrderHeader_Freight affecting columns freight: ((freight >= 0.00)) */ freight: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala index 0e744d1cbc..aebacc27b5 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala @@ -24,17 +24,22 @@ import scala.collection.immutable.ListMap import scala.util.Try case class ShipmethodRow( - /** Primary key for ShipMethod records. */ + /** Primary key for ShipMethod records. + Default: nextval('purchasing.shipmethod_shipmethodid_seq'::regclass) */ shipmethodid: ShipmethodId, /** Shipping company name. */ name: Name, /** Minimum shipping charge. + Default: 0.00 Constraint CK_ShipMethod_ShipBase affecting columns shipbase: ((shipbase > 0.00)) */ shipbase: BigDecimal, /** Shipping charge per pound. + Default: 0.00 Constraint CK_ShipMethod_ShipRate affecting columns shiprate: ((shiprate > 0.00)) */ shiprate: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala index 7346dd2de3..6c4415e8b4 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala @@ -37,12 +37,15 @@ case class VendorRow( /** 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average Constraint CK_Vendor_CreditRating affecting columns creditrating: (((creditrating >= 1) AND (creditrating <= 5))) */ creditrating: TypoShort, - /** 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product. */ + /** 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product. + Default: true */ preferredvendorstatus: Flag, - /** 0 = Vendor no longer used. 1 = Vendor is actively used. */ + /** 0 = Vendor no longer used. 1 = Vendor is actively used. + Default: true */ activeflag: Flag, /** Vendor URL. */ purchasingwebserviceurl: Option[/* max 1024 chars */ String], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala index 539ae29496..7752d55646 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala @@ -28,6 +28,7 @@ case class CountryregioncurrencyRow( /** ISO standard currency code. Foreign key to Currency.CurrencyCode. Points to [[currency.CurrencyRow.currencycode]] */ currencycode: CurrencyId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: CountryregioncurrencyId = CountryregioncurrencyId(countryregioncode, currencycode) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala index 87d4678d91..92b4186cae 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala @@ -24,7 +24,8 @@ import scala.collection.immutable.ListMap import scala.util.Try case class CreditcardRow( - /** Primary key for CreditCard records. */ + /** Primary key for CreditCard records. + Default: nextval('sales.creditcard_creditcardid_seq'::regclass) */ creditcardid: /* user-picked */ CustomCreditcardId, /** Credit card name. */ cardtype: /* max 50 chars */ String, @@ -34,6 +35,7 @@ case class CreditcardRow( expmonth: TypoShort, /** Credit card expiration year. */ expyear: TypoShort, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala index 2b435c4e7a..2544bef81b 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala @@ -25,6 +25,7 @@ case class CurrencyRow( currencycode: CurrencyId, /** Currency name. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala index c08269122f..8f85fb5a8d 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala @@ -23,7 +23,8 @@ import scala.collection.immutable.ListMap import scala.util.Try case class CurrencyrateRow( - /** Primary key for CurrencyRate records. */ + /** Primary key for CurrencyRate records. + Default: nextval('sales.currencyrate_currencyrateid_seq'::regclass) */ currencyrateid: CurrencyrateId, /** Date and time the exchange rate was obtained. */ currencyratedate: TypoLocalDateTime, @@ -37,6 +38,7 @@ case class CurrencyrateRow( averagerate: BigDecimal, /** Final exchange rate for the day. */ endofdayrate: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala index 33b6813e62..08024a7fc1 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala @@ -25,7 +25,8 @@ import scala.collection.immutable.ListMap import scala.util.Try case class CustomerRow( - /** Primary key. */ + /** Primary key. + Default: nextval('sales.customer_customerid_seq'::regclass) */ customerid: CustomerId, /** Foreign key to Person.BusinessEntityID Points to [[person.person.PersonRow.businessentityid]] */ @@ -36,7 +37,9 @@ case class CustomerRow( /** ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. Points to [[salesterritory.SalesterritoryRow.territoryid]] */ territoryid: Option[SalesterritoryId], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala index 2ae4f102bb..819a97d06c 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala @@ -28,6 +28,7 @@ case class PersoncreditcardRow( /** Credit card identification number. Foreign key to CreditCard.CreditCardID. Points to [[creditcard.CreditcardRow.creditcardid]] */ creditcardid: /* user-picked */ CustomCreditcardId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: PersoncreditcardId = PersoncreditcardId(businessentityid, creditcardid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala index 78bfde439e..b2e9499a89 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala @@ -30,7 +30,8 @@ case class SalesorderdetailRow( /** Primary key. Foreign key to SalesOrderHeader.SalesOrderID. Points to [[salesorderheader.SalesorderheaderRow.salesorderid]] */ salesorderid: SalesorderheaderId, - /** Primary key. One incremental unique number per product sold. */ + /** Primary key. One incremental unique number per product sold. + Default: nextval('sales.salesorderdetail_salesorderdetailid_seq'::regclass) */ salesorderdetailid: Int, /** Shipment tracking number supplied by the shipper. */ carriertrackingnumber: Option[/* max 25 chars */ String], @@ -47,9 +48,12 @@ case class SalesorderdetailRow( Constraint CK_SalesOrderDetail_UnitPrice affecting columns unitprice: ((unitprice >= 0.00)) */ unitprice: BigDecimal, /** Discount amount. + Default: 0.0 Constraint CK_SalesOrderDetail_UnitPriceDiscount affecting columns unitpricediscount: ((unitpricediscount >= 0.00)) */ unitpricediscount: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SalesorderdetailId = SalesorderdetailId(salesorderid, salesorderdetailid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala index 55da71c659..e67944dc68 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala @@ -34,11 +34,14 @@ import scala.collection.immutable.ListMap import scala.util.Try case class SalesorderheaderRow( - /** Primary key. */ + /** Primary key. + Default: nextval('sales.salesorderheader_salesorderid_seq'::regclass) */ salesorderid: SalesorderheaderId, - /** Incremental number to track changes to the sales order over time. */ + /** Incremental number to track changes to the sales order over time. + Default: 0 */ revisionnumber: TypoShort, /** Dates the sales order was created. + Default: now() Constraint CK_SalesOrderHeader_DueDate affecting columns duedate, orderdate: ((duedate >= orderdate)) Constraint CK_SalesOrderHeader_ShipDate affecting columns orderdate, shipdate: (((shipdate >= orderdate) OR (shipdate IS NULL))) */ orderdate: TypoLocalDateTime, @@ -49,9 +52,11 @@ case class SalesorderheaderRow( Constraint CK_SalesOrderHeader_ShipDate affecting columns orderdate, shipdate: (((shipdate >= orderdate) OR (shipdate IS NULL))) */ shipdate: Option[TypoLocalDateTime], /** Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled + Default: 1 Constraint CK_SalesOrderHeader_Status affecting columns status: (((status >= 0) AND (status <= 8))) */ status: TypoShort, - /** 0 = Order placed by sales person. 1 = Order placed online by customer. */ + /** 0 = Order placed by sales person. 1 = Order placed online by customer. + Default: true */ onlineorderflag: Flag, /** Customer purchase order number reference. */ purchaseordernumber: Option[OrderNumber], @@ -84,19 +89,24 @@ case class SalesorderheaderRow( Points to [[currencyrate.CurrencyrateRow.currencyrateid]] */ currencyrateid: Option[CurrencyrateId], /** Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. + Default: 0.00 Constraint CK_SalesOrderHeader_SubTotal affecting columns subtotal: ((subtotal >= 0.00)) */ subtotal: BigDecimal, /** Tax amount. + Default: 0.00 Constraint CK_SalesOrderHeader_TaxAmt affecting columns taxamt: ((taxamt >= 0.00)) */ taxamt: BigDecimal, /** Shipping cost. + Default: 0.00 Constraint CK_SalesOrderHeader_Freight affecting columns freight: ((freight >= 0.00)) */ freight: BigDecimal, /** Total due from customer. Computed as Subtotal + TaxAmt + Freight. */ totaldue: Option[BigDecimal], /** Sales representative comments. */ comment: Option[/* max 128 chars */ String], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala index 35ca278edf..cbd879c86a 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala @@ -28,6 +28,7 @@ case class SalesorderheadersalesreasonRow( /** Primary key. Foreign key to SalesReason.SalesReasonID. Points to [[salesreason.SalesreasonRow.salesreasonid]] */ salesreasonid: SalesreasonId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SalesorderheadersalesreasonId = SalesorderheadersalesreasonId(salesorderid, salesreasonid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala index 42fb99a419..2da22e2122 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala @@ -35,18 +35,24 @@ case class SalespersonRow( Constraint CK_SalesPerson_SalesQuota affecting columns salesquota: ((salesquota > 0.00)) */ salesquota: Option[BigDecimal], /** Bonus due if quota is met. + Default: 0.00 Constraint CK_SalesPerson_Bonus affecting columns bonus: ((bonus >= 0.00)) */ bonus: BigDecimal, /** Commision percent received per sale. + Default: 0.00 Constraint CK_SalesPerson_CommissionPct affecting columns commissionpct: ((commissionpct >= 0.00)) */ commissionpct: BigDecimal, /** Sales total year to date. + Default: 0.00 Constraint CK_SalesPerson_SalesYTD affecting columns salesytd: ((salesytd >= 0.00)) */ salesytd: BigDecimal, /** Sales total of previous year. + Default: 0.00 Constraint CK_SalesPerson_SalesLastYear affecting columns saleslastyear: ((saleslastyear >= 0.00)) */ saleslastyear: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala index c9ed4dba47..406b1e89db 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala @@ -32,7 +32,9 @@ case class SalespersonquotahistoryRow( /** Sales quota amount. Constraint CK_SalesPersonQuotaHistory_SalesQuota affecting columns salesquota: ((salesquota > 0.00)) */ salesquota: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SalespersonquotahistoryId = SalespersonquotahistoryId(businessentityid, quotadate) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala index 27dad96920..10e56285de 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala @@ -21,12 +21,14 @@ import scala.collection.immutable.ListMap import scala.util.Try case class SalesreasonRow( - /** Primary key for SalesReason records. */ + /** Primary key for SalesReason records. + Default: nextval('sales.salesreason_salesreasonid_seq'::regclass) */ salesreasonid: SalesreasonId, /** Sales reason description. */ name: Name, /** Category the sales reason belongs to. */ reasontype: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala index f1677c0f36..e389b02580 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala @@ -26,7 +26,8 @@ import scala.collection.immutable.ListMap import scala.util.Try case class SalestaxrateRow( - /** Primary key for SalesTaxRate records. */ + /** Primary key for SalesTaxRate records. + Default: nextval('sales.salestaxrate_salestaxrateid_seq'::regclass) */ salestaxrateid: SalestaxrateId, /** State, province, or country/region the sales tax applies to. Points to [[person.stateprovince.StateprovinceRow.stateprovinceid]] */ @@ -34,11 +35,14 @@ case class SalestaxrateRow( /** 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions. Constraint CK_SalesTaxRate_TaxType affecting columns taxtype: (((taxtype >= 1) AND (taxtype <= 3))) */ taxtype: TypoShort, - /** Tax rate amount. */ + /** Tax rate amount. + Default: 0.00 */ taxrate: BigDecimal, /** Tax rate description. */ name: Name, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala index 468c65e4bb..db62a0f322 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala @@ -25,7 +25,8 @@ import scala.collection.immutable.ListMap import scala.util.Try case class SalesterritoryRow( - /** Primary key for SalesTerritory records. */ + /** Primary key for SalesTerritory records. + Default: nextval('sales.salesterritory_territoryid_seq'::regclass) */ territoryid: SalesterritoryId, /** Sales territory description */ name: Name, @@ -35,18 +36,24 @@ case class SalesterritoryRow( /** Geographic area to which the sales territory belong. */ group: /* max 50 chars */ String, /** Sales in the territory year to date. + Default: 0.00 Constraint CK_SalesTerritory_SalesYTD affecting columns salesytd: ((salesytd >= 0.00)) */ salesytd: BigDecimal, /** Sales in the territory the previous year. + Default: 0.00 Constraint CK_SalesTerritory_SalesLastYear affecting columns saleslastyear: ((saleslastyear >= 0.00)) */ saleslastyear: BigDecimal, /** Business costs in the territory year to date. + Default: 0.00 Constraint CK_SalesTerritory_CostYTD affecting columns costytd: ((costytd >= 0.00)) */ costytd: BigDecimal, /** Business costs in the territory the previous year. + Default: 0.00 Constraint CK_SalesTerritory_CostLastYear affecting columns costlastyear: ((costlastyear >= 0.00)) */ costlastyear: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala index 83d7ed3154..09ef8ce75d 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala @@ -37,7 +37,9 @@ case class SalesterritoryhistoryRow( /** Date the sales representative left work in the territory. Constraint CK_SalesTerritoryHistory_EndDate affecting columns enddate, startdate: (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SalesterritoryhistoryId = SalesterritoryhistoryId(businessentityid, startdate, territoryid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala index 149f171c7b..4b51236317 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala @@ -23,18 +23,22 @@ import scala.collection.immutable.ListMap import scala.util.Try case class ShoppingcartitemRow( - /** Primary key for ShoppingCartItem records. */ + /** Primary key for ShoppingCartItem records. + Default: nextval('sales.shoppingcartitem_shoppingcartitemid_seq'::regclass) */ shoppingcartitemid: ShoppingcartitemId, /** Shopping cart identification number. */ shoppingcartid: /* max 50 chars */ String, /** Product quantity ordered. + Default: 1 Constraint CK_ShoppingCartItem_Quantity affecting columns quantity: ((quantity >= 1)) */ quantity: Int, /** Product ordered. Foreign key to Product.ProductID. Points to [[production.product.ProductRow.productid]] */ productid: ProductId, - /** Date the time the record was created. */ + /** Date the time the record was created. + Default: now() */ datecreated: TypoLocalDateTime, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala index 82b5c7476f..0074af8fd2 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala @@ -23,11 +23,13 @@ import scala.collection.immutable.ListMap import scala.util.Try case class SpecialofferRow( - /** Primary key for SpecialOffer records. */ + /** Primary key for SpecialOffer records. + Default: nextval('sales.specialoffer_specialofferid_seq'::regclass) */ specialofferid: SpecialofferId, /** Discount description. */ description: /* max 255 chars */ String, /** Discount precentage. + Default: 0.00 Constraint CK_SpecialOffer_DiscountPct affecting columns discountpct: ((discountpct >= 0.00)) */ discountpct: BigDecimal, /** Discount type category. */ @@ -41,12 +43,15 @@ case class SpecialofferRow( Constraint CK_SpecialOffer_EndDate affecting columns enddate, startdate: ((enddate >= startdate)) */ enddate: TypoLocalDateTime, /** Minimum discount percent allowed. + Default: 0 Constraint CK_SpecialOffer_MinQty affecting columns minqty: ((minqty >= 0)) */ minqty: Int, /** Maximum discount percent allowed. Constraint CK_SpecialOffer_MaxQty affecting columns maxqty: ((maxqty >= 0)) */ maxqty: Option[Int], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala index 48fae2fa76..191504c4bc 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala @@ -29,7 +29,9 @@ case class SpecialofferproductRow( /** Product identification number. Foreign key to Product.ProductID. Points to [[production.product.ProductRow.productid]] */ productid: ProductId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SpecialofferproductId = SpecialofferproductId(specialofferid, productid) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala index c16a9a8811..2a9399f459 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala @@ -36,7 +36,9 @@ case class StoreRow( salespersonid: Option[BusinessentityId], /** Demographic informationg about the store such as the number of employees, annual sales and store type. */ demographics: Option[TypoXml], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/testInsert.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/testInsert.scala index 53e8ea8166..8354b3162a 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/testInsert.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/testInsert.scala @@ -198,6 +198,10 @@ import adventureworks.public.Name import adventureworks.public.NameStyle import adventureworks.public.OrderNumber import adventureworks.public.Phone +import adventureworks.public.identity_test.IdentityTestId +import adventureworks.public.identity_test.IdentityTestRepoImpl +import adventureworks.public.identity_test.IdentityTestRow +import adventureworks.public.identity_test.IdentityTestRowUnsaved import adventureworks.public.pgtest.PgtestRepoImpl import adventureworks.public.pgtest.PgtestRow import adventureworks.public.pgtestnull.PgtestnullRepoImpl @@ -617,6 +621,7 @@ class TestInsert(random: Random) { actualcost: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): WorkorderroutingRow = (new WorkorderroutingRepoImpl).insert(new WorkorderroutingRowUnsaved(workorderid = workorderid, locationid = locationid, productid = productid, operationsequence = operationsequence, scheduledstartdate = scheduledstartdate, scheduledenddate = scheduledenddate, actualstartdate = actualstartdate, actualenddate = actualenddate, actualresourcehrs = actualresourcehrs, plannedcost = plannedcost, actualcost = actualcost, modifieddate = modifieddate)) + def publicIdentityTest(name: IdentityTestId, defaultGenerated: Defaulted[Int] = Defaulted.UseDefault)(implicit c: Connection): IdentityTestRow = (new IdentityTestRepoImpl).insert(new IdentityTestRowUnsaved(name = name, defaultGenerated = defaultGenerated)) def publicPgtest(box: TypoBox, bytea: TypoBytea, circle: TypoCircle, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala index e420198f88..02e66ef5db 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala @@ -17,12 +17,14 @@ import io.circe.Encoder import java.sql.ResultSet case class DepartmentRow( - /** Primary key for Department records. */ + /** Primary key for Department records. + Default: nextval('humanresources.department_departmentid_seq'::regclass) */ departmentid: DepartmentId, /** Name of the department. */ name: Name, /** Name of the group to which the department belongs. */ groupname: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala index 8c71dfaaaa..da7e8a7d58 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala @@ -43,19 +43,26 @@ case class EmployeeRow( /** Employee hired on this date. Constraint CK_Employee_HireDate affecting columns hiredate: (((hiredate >= '1996-07-01'::date) AND (hiredate <= (now() + '1 day'::interval)))) */ hiredate: TypoLocalDate, - /** Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. */ + /** Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. + Default: true */ salariedflag: Flag, /** Number of available vacation hours. + Default: 0 Constraint CK_Employee_VacationHours affecting columns vacationhours: (((vacationhours >= '-40'::integer) AND (vacationhours <= 240))) */ vacationhours: TypoShort, /** Number of available sick leave hours. + Default: 0 Constraint CK_Employee_SickLeaveHours affecting columns sickleavehours: (((sickleavehours >= 0) AND (sickleavehours <= 120))) */ sickleavehours: TypoShort, - /** 0 = Inactive, 1 = Active */ + /** 0 = Inactive, 1 = Active + Default: true */ currentflag: Flag, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime, - /** Where the employee is located in corporate hierarchy. */ + /** Where the employee is located in corporate hierarchy. + Default: '/'::character varying */ organizationnode: Option[String] ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala index 971e484c97..aeba735673 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala @@ -35,6 +35,7 @@ case class EmployeedepartmenthistoryRow( /** Date the employee left the department. NULL = Current department. Constraint CK_EmployeeDepartmentHistory_EndDate affecting columns enddate, startdate: (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDate], + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: EmployeedepartmenthistoryId = EmployeedepartmenthistoryId(businessentityid, startdate, departmentid, shiftid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala index 0a65a9c9c6..88f26e55ec 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala @@ -30,6 +30,7 @@ case class EmployeepayhistoryRow( /** 1 = Salary received monthly, 2 = Salary received biweekly Constraint CK_EmployeePayHistory_PayFrequency affecting columns payfrequency: ((payfrequency = ANY (ARRAY[1, 2]))) */ payfrequency: TypoShort, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: EmployeepayhistoryId = EmployeepayhistoryId(businessentityid, ratechangedate) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala index 5a3504edcc..b3bed6f2ba 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala @@ -18,13 +18,15 @@ import io.circe.Encoder import java.sql.ResultSet case class JobcandidateRow( - /** Primary key for JobCandidate records. */ + /** Primary key for JobCandidate records. + Default: nextval('humanresources.jobcandidate_jobcandidateid_seq'::regclass) */ jobcandidateid: JobcandidateId, /** Employee identification number if applicant was hired. Foreign key to Employee.BusinessEntityID. Points to [[employee.EmployeeRow.businessentityid]] */ businessentityid: Option[BusinessentityId], /** Résumé in XML format. */ resume: Option[TypoXml], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala index 162afd7ebe..a4f2f3b20e 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala @@ -18,7 +18,8 @@ import io.circe.Encoder import java.sql.ResultSet case class ShiftRow( - /** Primary key for Shift records. */ + /** Primary key for Shift records. + Default: nextval('humanresources.shift_shiftid_seq'::regclass) */ shiftid: ShiftId, /** Shift description. */ name: Name, @@ -26,6 +27,7 @@ case class ShiftRow( starttime: TypoLocalTime, /** Shift end time. */ endtime: TypoLocalTime, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/address/AddressRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/address/AddressRow.scala index da1b95bb99..d3926fdd17 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/address/AddressRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/address/AddressRow.scala @@ -20,7 +20,8 @@ import io.circe.Encoder import java.sql.ResultSet case class AddressRow( - /** Primary key for Address records. */ + /** Primary key for Address records. + Default: nextval('person.address_addressid_seq'::regclass) */ addressid: AddressId, /** First street address line. */ addressline1: /* max 60 chars */ String, @@ -35,7 +36,9 @@ case class AddressRow( postalcode: /* max 15 chars */ String, /** Latitude and longitude of this address. */ spatiallocation: Option[TypoBytea], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala index 06634bf960..14731a7f91 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala @@ -18,11 +18,14 @@ import io.circe.Encoder import java.sql.ResultSet case class AddresstypeRow( - /** Primary key for AddressType records. */ + /** Primary key for AddressType records. + Default: nextval('person.addresstype_addresstypeid_seq'::regclass) */ addresstypeid: AddresstypeId, /** Address type description. For example, Billing, Home, or Shipping. */ name: Name, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala index a38b5f13c6..8066060e64 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala @@ -17,9 +17,12 @@ import io.circe.Encoder import java.sql.ResultSet case class BusinessentityRow( - /** Primary key for all customers, vendors, and employees. */ + /** Primary key for all customers, vendors, and employees. + Default: nextval('person.businessentity_businessentityid_seq'::regclass) */ businessentityid: BusinessentityId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala index 432dc04ce4..a7d30cce4a 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala @@ -29,7 +29,9 @@ case class BusinessentityaddressRow( /** Primary key. Foreign key to AddressType.AddressTypeID. Points to [[addresstype.AddresstypeRow.addresstypeid]] */ addresstypeid: AddresstypeId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: BusinessentityaddressId = BusinessentityaddressId(businessentityid, addressid, addresstypeid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala index e733952485..67c188126d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala @@ -28,7 +28,9 @@ case class BusinessentitycontactRow( /** Primary key. Foreign key to ContactType.ContactTypeID. Points to [[contacttype.ContacttypeRow.contacttypeid]] */ contacttypeid: ContacttypeId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: BusinessentitycontactId = BusinessentitycontactId(businessentityid, personid, contacttypeid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala index e998e6dfe8..7dc97ae182 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala @@ -17,10 +17,12 @@ import io.circe.Encoder import java.sql.ResultSet case class ContacttypeRow( - /** Primary key for ContactType records. */ + /** Primary key for ContactType records. + Default: nextval('person.contacttype_contacttypeid_seq'::regclass) */ contacttypeid: ContacttypeId, /** Contact type description. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala index c885fc4e8f..d6e5d9a6f3 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala @@ -21,6 +21,7 @@ case class CountryregionRow( countryregioncode: CountryregionId, /** Country or region name. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala index 2c89ff25f4..d8e7f9e6b8 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala @@ -22,11 +22,14 @@ case class EmailaddressRow( /** Primary key. Person associated with this email address. Foreign key to Person.BusinessEntityID Points to [[person.PersonRow.businessentityid]] */ businessentityid: BusinessentityId, - /** Primary key. ID of this email address. */ + /** Primary key. ID of this email address. + Default: nextval('person.emailaddress_emailaddressid_seq'::regclass) */ emailaddressid: Int, /** E-mail address for the person. */ emailaddress: Option[/* max 50 chars */ String], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: EmailaddressId = EmailaddressId(businessentityid, emailaddressid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala index 9313d0bed7..5349b4ae5f 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala @@ -25,7 +25,9 @@ case class PasswordRow( passwordhash: /* max 128 chars */ String, /** Random value concatenated with the password string before the password is hashed. */ passwordsalt: /* max 10 chars */ String, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/person/PersonRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/person/PersonRow.scala index c755d35724..f39e7b631d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/person/PersonRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/person/PersonRow.scala @@ -29,7 +29,8 @@ case class PersonRow( /** Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact Constraint CK_Person_PersonType affecting columns persontype: (((persontype IS NULL) OR (upper((persontype)::text) = ANY (ARRAY['SC'::text, 'VC'::text, 'IN'::text, 'EM'::text, 'SP'::text, 'GC'::text])))) */ persontype: /* bpchar, max 2 chars */ String, - /** 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. */ + /** 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. + Default: false */ namestyle: NameStyle, /** A courtesy title. For example, Mr. or Ms. */ title: Option[/* max 8 chars */ String], @@ -42,13 +43,16 @@ case class PersonRow( /** Surname suffix. For example, Sr. or Jr. */ suffix: Option[/* max 10 chars */ String], /** 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners. + Default: 0 Constraint CK_Person_EmailPromotion affecting columns emailpromotion: (((emailpromotion >= 0) AND (emailpromotion <= 2))) */ emailpromotion: Int, /** Additional contact information about the person stored in xml format. */ additionalcontactinfo: Option[TypoXml], /** Personal information such as hobbies, and income collected from online shoppers. Used for sales analysis. */ demographics: Option[TypoXml], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala index e0340bf394..7e5faf6500 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala @@ -27,6 +27,7 @@ case class PersonphoneRow( /** Kind of phone number. Foreign key to PhoneNumberType.PhoneNumberTypeID. Points to [[phonenumbertype.PhonenumbertypeRow.phonenumbertypeid]] */ phonenumbertypeid: PhonenumbertypeId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: PersonphoneId = PersonphoneId(businessentityid, phonenumber, phonenumbertypeid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala index cf3f71e4b4..c2958df922 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala @@ -17,10 +17,12 @@ import io.circe.Encoder import java.sql.ResultSet case class PhonenumbertypeRow( - /** Primary key for telephone number type records. */ + /** Primary key for telephone number type records. + Default: nextval('person.phonenumbertype_phonenumbertypeid_seq'::regclass) */ phonenumbertypeid: PhonenumbertypeId, /** Name of the telephone number type */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala index e2d95d6b96..d325716c25 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala @@ -22,21 +22,25 @@ import io.circe.Encoder import java.sql.ResultSet case class StateprovinceRow( - /** Primary key for StateProvince records. */ + /** Primary key for StateProvince records. + Default: nextval('person.stateprovince_stateprovinceid_seq'::regclass) */ stateprovinceid: StateprovinceId, /** ISO standard state or province code. */ stateprovincecode: /* bpchar, max 3 chars */ String, /** ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. Points to [[countryregion.CountryregionRow.countryregioncode]] */ countryregioncode: CountryregionId, - /** 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode. */ + /** 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode. + Default: true */ isonlystateprovinceflag: Flag, /** State or province description. */ name: Name, /** ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID. Points to [[sales.salesterritory.SalesterritoryRow.territoryid]] */ territoryid: SalesterritoryId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala index 21e7dab968..d794030e5d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala @@ -20,7 +20,8 @@ import io.circe.Encoder import java.sql.ResultSet case class BillofmaterialsRow( - /** Primary key for BillOfMaterials records. */ + /** Primary key for BillOfMaterials records. + Default: nextval('production.billofmaterials_billofmaterialsid_seq'::regclass) */ billofmaterialsid: BillofmaterialsId, /** Parent product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] @@ -32,6 +33,7 @@ case class BillofmaterialsRow( Constraint CK_BillOfMaterials_ProductAssemblyID affecting columns componentid, productassemblyid: ((productassemblyid <> componentid)) */ componentid: ProductId, /** Date the component started being used in the assembly item. + Default: now() Constraint CK_BillOfMaterials_EndDate affecting columns enddate, startdate: (((enddate > startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDateTime, /** Date the component stopped being used in the assembly item. @@ -44,9 +46,11 @@ case class BillofmaterialsRow( Constraint CK_BillOfMaterials_BOMLevel affecting columns bomlevel, perassemblyqty, productassemblyid: ((((productassemblyid IS NULL) AND (bomlevel = 0) AND (perassemblyqty = 1.00)) OR ((productassemblyid IS NOT NULL) AND (bomlevel >= 1)))) */ bomlevel: TypoShort, /** Quantity of the component needed to create the assembly. + Default: 1.00 Constraint CK_BillOfMaterials_BOMLevel affecting columns bomlevel, perassemblyqty, productassemblyid: ((((productassemblyid IS NULL) AND (bomlevel = 0) AND (perassemblyqty = 1.00)) OR ((productassemblyid IS NOT NULL) AND (bomlevel >= 1)))) Constraint CK_BillOfMaterials_PerAssemblyQty affecting columns perassemblyqty: ((perassemblyqty >= 1.00)) */ perassemblyqty: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala index c59f29d66b..c2eb1e532a 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala @@ -21,6 +21,7 @@ case class CultureRow( cultureid: CultureId, /** Culture description. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala index a630ee0d0f..10a0115b22 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala @@ -27,7 +27,8 @@ case class DocumentRow( /** Employee who controls the document. Foreign key to Employee.BusinessEntityID Points to [[humanresources.employee.EmployeeRow.businessentityid]] */ owner: BusinessentityId, - /** 0 = This is a folder, 1 = This is a document. */ + /** 0 = This is a folder, 1 = This is a document. + Default: false */ folderflag: Flag, /** File name of the document */ filename: /* max 400 chars */ String, @@ -35,7 +36,8 @@ case class DocumentRow( fileextension: Option[/* max 8 chars */ String], /** Revision number of the document. */ revision: /* bpchar, max 5 chars */ String, - /** Engineering change approval number. */ + /** Engineering change approval number. + Default: 0 */ changenumber: Int, /** 1 = Pending approval, 2 = Approved, 3 = Obsolete Constraint CK_Document_Status affecting columns status: (((status >= 1) AND (status <= 3))) */ @@ -44,10 +46,13 @@ case class DocumentRow( documentsummary: Option[String], /** Complete document. */ document: Option[TypoBytea], - /** ROWGUIDCOL number uniquely identifying the record. Required for FileStream. */ + /** ROWGUIDCOL number uniquely identifying the record. Required for FileStream. + Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime, - /** Primary key for Document records. */ + /** Primary key for Document records. + Default: '/'::character varying */ documentnode: DocumentId ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala index 734ddc0dec..aad90f52f9 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala @@ -17,10 +17,12 @@ import io.circe.Encoder import java.sql.ResultSet case class IllustrationRow( - /** Primary key for Illustration records. */ + /** Primary key for Illustration records. + Default: nextval('production.illustration_illustrationid_seq'::regclass) */ illustrationid: IllustrationId, /** Illustrations used in manufacturing instructions. Stored as XML. */ diagram: Option[TypoXml], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/location/LocationRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/location/LocationRow.scala index cd2b3e716c..a68963f46f 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/location/LocationRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/location/LocationRow.scala @@ -18,16 +18,20 @@ import io.circe.Encoder import java.sql.ResultSet case class LocationRow( - /** Primary key for Location records. */ + /** Primary key for Location records. + Default: nextval('production.location_locationid_seq'::regclass) */ locationid: LocationId, /** Location description. */ name: Name, /** Standard hourly cost of the manufacturing location. + Default: 0.00 Constraint CK_Location_CostRate affecting columns costrate: ((costrate >= 0.00)) */ costrate: BigDecimal, /** Work capacity (in hours) of the manufacturing location. + Default: 0.00 Constraint CK_Location_Availability affecting columns availability: ((availability >= 0.00)) */ availability: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/product/ProductRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/product/ProductRow.scala index aaa46bc1ec..6d17df8643 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/product/ProductRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/product/ProductRow.scala @@ -28,15 +28,18 @@ import java.sql.ResultSet import scala.util.Try case class ProductRow( - /** Primary key for Product records. */ + /** Primary key for Product records. + Default: nextval('production.product_productid_seq'::regclass) */ productid: ProductId, /** Name of the product. */ name: Name, /** Unique product identification number. */ productnumber: /* max 25 chars */ String, - /** 0 = Product is purchased, 1 = Product is manufactured in-house. */ + /** 0 = Product is purchased, 1 = Product is manufactured in-house. + Default: true */ makeflag: Flag, - /** 0 = Product is not a salable item. 1 = Product is salable. */ + /** 0 = Product is not a salable item. 1 = Product is salable. + Default: true */ finishedgoodsflag: Flag, /** Product color. */ color: Option[/* max 15 chars */ String], @@ -89,7 +92,9 @@ case class ProductRow( sellenddate: Option[TypoLocalDateTime], /** Date the product was discontinued. */ discontinueddate: Option[TypoLocalDateTime], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala index b3a4afe8ed..c61b51fff4 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala @@ -18,11 +18,14 @@ import io.circe.Encoder import java.sql.ResultSet case class ProductcategoryRow( - /** Primary key for ProductCategory records. */ + /** Primary key for ProductCategory records. + Default: nextval('production.productcategory_productcategoryid_seq'::regclass) */ productcategoryid: ProductcategoryId, /** Category description. */ name: Name, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala index f3619b1ae9..1309143abb 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala @@ -30,6 +30,7 @@ case class ProductcosthistoryRow( /** Standard cost of the product. Constraint CK_ProductCostHistory_StandardCost affecting columns standardcost: ((standardcost >= 0.00)) */ standardcost: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductcosthistoryId = ProductcosthistoryId(productid, startdate) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala index ad08a91c0f..d7e78c63a3 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala @@ -18,11 +18,14 @@ import io.circe.Encoder import java.sql.ResultSet case class ProductdescriptionRow( - /** Primary key for ProductDescription records. */ + /** Primary key for ProductDescription records. + Default: nextval('production.productdescription_productdescriptionid_seq'::regclass) */ productdescriptionid: ProductdescriptionId, /** Description of the product. */ description: /* max 400 chars */ String, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala index d56960dd76..5ad879bcde 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala @@ -21,8 +21,10 @@ case class ProductdocumentRow( /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ productid: ProductId, + /** Default: now() */ modifieddate: TypoLocalDateTime, /** Document identification number. Foreign key to Document.DocumentNode. + Default: '/'::character varying Points to [[document.DocumentRow.documentnode]] */ documentnode: DocumentId ){ diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala index 9e717b8e86..edadff1464 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala @@ -32,9 +32,12 @@ case class ProductinventoryRow( /** Storage container on a shelf in an inventory location. Constraint CK_ProductInventory_Bin affecting columns bin: (((bin >= 0) AND (bin <= 100))) */ bin: TypoShort, - /** Quantity of products in the inventory location. */ + /** Quantity of products in the inventory location. + Default: 0 */ quantity: TypoShort, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductinventoryId = ProductinventoryId(productid, locationid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala index 74a4cb4193..59399c55b0 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala @@ -30,6 +30,7 @@ case class ProductlistpricehistoryRow( /** Product list price. Constraint CK_ProductListPriceHistory_ListPrice affecting columns listprice: ((listprice > 0.00)) */ listprice: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductlistpricehistoryId = ProductlistpricehistoryId(productid, startdate) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala index 365ea1216f..1bc0db0234 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala @@ -19,7 +19,8 @@ import io.circe.Encoder import java.sql.ResultSet case class ProductmodelRow( - /** Primary key for ProductModel records. */ + /** Primary key for ProductModel records. + Default: nextval('production.productmodel_productmodelid_seq'::regclass) */ productmodelid: ProductmodelId, /** Product model description. */ name: Name, @@ -27,7 +28,9 @@ case class ProductmodelRow( catalogdescription: Option[TypoXml], /** Manufacturing instructions in xml format. */ instructions: Option[TypoXml], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala index a10158a21a..1b40352e3e 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala @@ -24,6 +24,7 @@ case class ProductmodelillustrationRow( /** Primary key. Foreign key to Illustration.IllustrationID. Points to [[illustration.IllustrationRow.illustrationid]] */ illustrationid: IllustrationId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductmodelillustrationId = ProductmodelillustrationId(productmodelid, illustrationid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala index 2467dc69d6..21ab2591cf 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala @@ -28,6 +28,7 @@ case class ProductmodelproductdescriptioncultureRow( /** Culture identification number. Foreign key to Culture.CultureID. Points to [[culture.CultureRow.cultureid]] */ cultureid: CultureId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductmodelproductdescriptioncultureId = ProductmodelproductdescriptioncultureId(productmodelid, productdescriptionid, cultureid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala index 036750110b..af358cff14 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala @@ -18,7 +18,8 @@ import io.circe.Encoder import java.sql.ResultSet case class ProductphotoRow( - /** Primary key for ProductPhoto records. */ + /** Primary key for ProductPhoto records. + Default: nextval('production.productphoto_productphotoid_seq'::regclass) */ productphotoid: ProductphotoId, /** Small image of the product. */ thumbnailphoto: Option[TypoBytea], @@ -28,6 +29,7 @@ case class ProductphotoRow( largephoto: Option[TypoBytea], /** Large image file name. */ largephotofilename: Option[/* max 50 chars */ String], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala index 3f380def21..ca43e8d855 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala @@ -25,8 +25,10 @@ case class ProductproductphotoRow( /** Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID. Points to [[productphoto.ProductphotoRow.productphotoid]] */ productphotoid: ProductphotoId, - /** 0 = Photo is not the principal image. 1 = Photo is the principal image. */ + /** 0 = Photo is not the principal image. 1 = Photo is the principal image. + Default: false */ primary: Flag, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductproductphotoId = ProductproductphotoId(productid, productphotoid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala index 506b91faf6..6d5032f497 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala @@ -19,14 +19,16 @@ import io.circe.Encoder import java.sql.ResultSet case class ProductreviewRow( - /** Primary key for ProductReview records. */ + /** Primary key for ProductReview records. + Default: nextval('production.productreview_productreviewid_seq'::regclass) */ productreviewid: ProductreviewId, /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ productid: ProductId, /** Name of the reviewer. */ reviewername: Name, - /** Date review was submitted. */ + /** Date review was submitted. + Default: now() */ reviewdate: TypoLocalDateTime, /** Reviewer's e-mail address. */ emailaddress: /* max 50 chars */ String, @@ -35,6 +37,7 @@ case class ProductreviewRow( rating: Int, /** Reviewer's comments */ comments: Option[/* max 3850 chars */ String], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala index 8da573db17..5a45145c0b 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala @@ -19,14 +19,17 @@ import io.circe.Encoder import java.sql.ResultSet case class ProductsubcategoryRow( - /** Primary key for ProductSubcategory records. */ + /** Primary key for ProductSubcategory records. + Default: nextval('production.productsubcategory_productsubcategoryid_seq'::regclass) */ productsubcategoryid: ProductsubcategoryId, /** Product category identification number. Foreign key to ProductCategory.ProductCategoryID. Points to [[productcategory.ProductcategoryRow.productcategoryid]] */ productcategoryid: ProductcategoryId, /** Subcategory description. */ name: Name, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala index 23b7dc898c..4482111a79 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala @@ -17,10 +17,12 @@ import io.circe.Encoder import java.sql.ResultSet case class ScrapreasonRow( - /** Primary key for ScrapReason records. */ + /** Primary key for ScrapReason records. + Default: nextval('production.scrapreason_scrapreasonid_seq'::regclass) */ scrapreasonid: ScrapreasonId, /** Failure description. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala index 8b7cbdb000..585967d773 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala @@ -18,16 +18,19 @@ import io.circe.Encoder import java.sql.ResultSet case class TransactionhistoryRow( - /** Primary key for TransactionHistory records. */ + /** Primary key for TransactionHistory records. + Default: nextval('production.transactionhistory_transactionid_seq'::regclass) */ transactionid: TransactionhistoryId, /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ productid: ProductId, /** Purchase order, sales order, or work order identification number. */ referenceorderid: Int, - /** Line number associated with the purchase order, sales order, or work order. */ + /** Line number associated with the purchase order, sales order, or work order. + Default: 0 */ referenceorderlineid: Int, - /** Date and time of the transaction. */ + /** Date and time of the transaction. + Default: now() */ transactiondate: TypoLocalDateTime, /** W = WorkOrder, S = SalesOrder, P = PurchaseOrder Constraint CK_TransactionHistory_TransactionType affecting columns transactiontype: ((upper((transactiontype)::text) = ANY (ARRAY['W'::text, 'S'::text, 'P'::text]))) */ @@ -36,6 +39,7 @@ case class TransactionhistoryRow( quantity: Int, /** Product cost. */ actualcost: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala index 38ed9be95b..41f0cb1527 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala @@ -23,9 +23,11 @@ case class TransactionhistoryarchiveRow( productid: Int, /** Purchase order, sales order, or work order identification number. */ referenceorderid: Int, - /** Line number associated with the purchase order, sales order, or work order. */ + /** Line number associated with the purchase order, sales order, or work order. + Default: 0 */ referenceorderlineid: Int, - /** Date and time of the transaction. */ + /** Date and time of the transaction. + Default: now() */ transactiondate: TypoLocalDateTime, /** W = Work Order, S = Sales Order, P = Purchase Order Constraint CK_TransactionHistoryArchive_TransactionType affecting columns transactiontype: ((upper((transactiontype)::text) = ANY (ARRAY['W'::text, 'S'::text, 'P'::text]))) */ @@ -34,6 +36,7 @@ case class TransactionhistoryarchiveRow( quantity: Int, /** Product cost. */ actualcost: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala index d40d062482..4b15662a63 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala @@ -21,6 +21,7 @@ case class UnitmeasureRow( unitmeasurecode: UnitmeasureId, /** Unit of measure description. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala index 7e7afec0e2..bb47b813d9 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala @@ -20,7 +20,8 @@ import io.circe.Encoder import java.sql.ResultSet case class WorkorderRow( - /** Primary key for WorkOrder records. */ + /** Primary key for WorkOrder records. + Default: nextval('production.workorder_workorderid_seq'::regclass) */ workorderid: WorkorderId, /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ @@ -42,6 +43,7 @@ case class WorkorderRow( /** Reason for inspection failure. Points to [[scrapreason.ScrapreasonRow.scrapreasonid]] */ scrapreasonid: Option[ScrapreasonId], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala index 5323448319..4a9cadc39f 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala @@ -51,6 +51,7 @@ case class WorkorderroutingRow( /** Actual manufacturing cost. Constraint CK_WorkOrderRouting_ActualCost affecting columns actualcost: ((actualcost > 0.00)) */ actualcost: Option[BigDecimal], + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: WorkorderroutingId = WorkorderroutingId(workorderid, productid, operationsequence) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestFields.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestFields.scala new file mode 100644 index 0000000000..643c78dd65 --- /dev/null +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestFields.scala @@ -0,0 +1,19 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import typo.dsl.SqlExpr.Field +import typo.dsl.SqlExpr.IdField + +trait IdentityTestFields[Row] { + val alwaysGenerated: Field[Int, Row] + val defaultGenerated: Field[Int, Row] + val name: IdField[IdentityTestId, Row] +} +object IdentityTestFields extends IdentityTestStructure[IdentityTestRow](None, identity, (_, x) => x) + diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestId.scala new file mode 100644 index 0000000000..be8c16098f --- /dev/null +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestId.scala @@ -0,0 +1,33 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import doobie.postgres.Text +import doobie.util.Get +import doobie.util.Put +import doobie.util.meta.Meta +import io.circe.Decoder +import io.circe.Encoder +import typo.dsl.Bijection + +/** Type for the primary key of table `public.identity-test` */ +case class IdentityTestId(value: /* max 250 chars */ String) extends AnyVal +object IdentityTestId { + implicit lazy val arrayGet: Get[Array[IdentityTestId]] = adventureworks.StringArrayMeta.get.map(_.map(IdentityTestId.apply)) + implicit lazy val arrayPut: Put[Array[IdentityTestId]] = adventureworks.StringArrayMeta.put.contramap(_.map(_.value)) + implicit lazy val bijection: Bijection[IdentityTestId, /* max 250 chars */ String] = Bijection[IdentityTestId, /* max 250 chars */ String](_.value)(IdentityTestId.apply) + implicit lazy val decoder: Decoder[IdentityTestId] = Decoder.decodeString.map(IdentityTestId.apply) + implicit lazy val encoder: Encoder[IdentityTestId] = Encoder.encodeString.contramap(_.value) + implicit lazy val get: Get[IdentityTestId] = Meta.StringMeta.get.map(IdentityTestId.apply) + implicit lazy val ordering: Ordering[IdentityTestId] = Ordering.by(_.value) + implicit lazy val put: Put[IdentityTestId] = Meta.StringMeta.put.contramap(_.value) + implicit lazy val text: Text[IdentityTestId] = new Text[IdentityTestId] { + override def unsafeEncode(v: IdentityTestId, sb: StringBuilder) = Text.stringInstance.unsafeEncode(v.value, sb) + override def unsafeArrayEncode(v: IdentityTestId, sb: StringBuilder) = Text.stringInstance.unsafeArrayEncode(v.value, sb) + } +} diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepo.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepo.scala new file mode 100644 index 0000000000..a346fd20e7 --- /dev/null +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepo.scala @@ -0,0 +1,31 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import doobie.free.connection.ConnectionIO +import fs2.Stream +import typo.dsl.DeleteBuilder +import typo.dsl.SelectBuilder +import typo.dsl.UpdateBuilder + +trait IdentityTestRepo { + def delete(name: IdentityTestId): ConnectionIO[Boolean] + def delete: DeleteBuilder[IdentityTestFields, IdentityTestRow] + def insert(unsaved: IdentityTestRow): ConnectionIO[IdentityTestRow] + def insertStreaming(unsaved: Stream[ConnectionIO, IdentityTestRow], batchSize: Int): ConnectionIO[Long] + def insert(unsaved: IdentityTestRowUnsaved): ConnectionIO[IdentityTestRow] + /* NOTE: this functionality requires PostgreSQL 16 or later! */ + def insertUnsavedStreaming(unsaved: Stream[ConnectionIO, IdentityTestRowUnsaved], batchSize: Int): ConnectionIO[Long] + def select: SelectBuilder[IdentityTestFields, IdentityTestRow] + def selectAll: Stream[ConnectionIO, IdentityTestRow] + def selectById(name: IdentityTestId): ConnectionIO[Option[IdentityTestRow]] + def selectByIds(names: Array[IdentityTestId]): Stream[ConnectionIO, IdentityTestRow] + def update(row: IdentityTestRow): ConnectionIO[Boolean] + def update: UpdateBuilder[IdentityTestFields, IdentityTestRow] + def upsert(unsaved: IdentityTestRow): ConnectionIO[IdentityTestRow] +} diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoImpl.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoImpl.scala new file mode 100644 index 0000000000..e6ab1031d7 --- /dev/null +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoImpl.scala @@ -0,0 +1,106 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import adventureworks.customtypes.Defaulted +import doobie.free.connection.ConnectionIO +import doobie.postgres.syntax.FragmentOps +import doobie.syntax.SqlInterpolator.SingleFragment.fromWrite +import doobie.syntax.string.toSqlInterpolator +import doobie.util.Write +import doobie.util.fragment.Fragment +import doobie.util.meta.Meta +import fs2.Stream +import typo.dsl.DeleteBuilder +import typo.dsl.SelectBuilder +import typo.dsl.SelectBuilderSql +import typo.dsl.UpdateBuilder + +class IdentityTestRepoImpl extends IdentityTestRepo { + override def delete(name: IdentityTestId): ConnectionIO[Boolean] = { + sql"""delete from public.identity-test where "name" = ${fromWrite(name)(Write.fromPut(IdentityTestId.put))}""".update.run.map(_ > 0) + } + override def delete: DeleteBuilder[IdentityTestFields, IdentityTestRow] = { + DeleteBuilder("public.identity-test", IdentityTestFields) + } + override def insert(unsaved: IdentityTestRow): ConnectionIO[IdentityTestRow] = { + sql"""insert into public.identity-test("always_generated", "default_generated", "name") + values (${fromWrite(unsaved.alwaysGenerated)(Write.fromPut(Meta.IntMeta.put))}::int4, ${fromWrite(unsaved.defaultGenerated)(Write.fromPut(Meta.IntMeta.put))}::int4, ${fromWrite(unsaved.name)(Write.fromPut(IdentityTestId.put))}) + returning "always_generated", "default_generated", "name" + """.query(IdentityTestRow.read).unique + } + override def insertStreaming(unsaved: Stream[ConnectionIO, IdentityTestRow], batchSize: Int): ConnectionIO[Long] = { + new FragmentOps(sql"""COPY public.identity-test("always_generated", "default_generated", "name") FROM STDIN""").copyIn(unsaved, batchSize)(IdentityTestRow.text) + } + override def insert(unsaved: IdentityTestRowUnsaved): ConnectionIO[IdentityTestRow] = { + val fs = List( + Some((Fragment.const(s""""name""""), fr"${fromWrite(unsaved.name)(Write.fromPut(IdentityTestId.put))}")), + unsaved.defaultGenerated match { + case Defaulted.UseDefault => None + case Defaulted.Provided(value) => Some((Fragment.const(s""""default_generated""""), fr"${fromWrite(value: Int)(Write.fromPut(Meta.IntMeta.put))}::int4")) + } + ).flatten + + val q = if (fs.isEmpty) { + sql"""insert into public.identity-test default values + returning "always_generated", "default_generated", "name" + """ + } else { + val CommaSeparate = Fragment.FragmentMonoid.intercalate(fr", ") + sql"""insert into public.identity-test(${CommaSeparate.combineAllOption(fs.map { case (n, _) => n }).get}) + values (${CommaSeparate.combineAllOption(fs.map { case (_, f) => f }).get}) + returning "always_generated", "default_generated", "name" + """ + } + q.query(IdentityTestRow.read).unique + + } + /* NOTE: this functionality requires PostgreSQL 16 or later! */ + override def insertUnsavedStreaming(unsaved: Stream[ConnectionIO, IdentityTestRowUnsaved], batchSize: Int): ConnectionIO[Long] = { + new FragmentOps(sql"""COPY public.identity-test("name", "default_generated") FROM STDIN (DEFAULT '__DEFAULT_VALUE__')""").copyIn(unsaved, batchSize)(IdentityTestRowUnsaved.text) + } + override def select: SelectBuilder[IdentityTestFields, IdentityTestRow] = { + SelectBuilderSql("public.identity-test", IdentityTestFields, IdentityTestRow.read) + } + override def selectAll: Stream[ConnectionIO, IdentityTestRow] = { + sql"""select "always_generated", "default_generated", "name" from public.identity-test""".query(IdentityTestRow.read).stream + } + override def selectById(name: IdentityTestId): ConnectionIO[Option[IdentityTestRow]] = { + sql"""select "always_generated", "default_generated", "name" from public.identity-test where "name" = ${fromWrite(name)(Write.fromPut(IdentityTestId.put))}""".query(IdentityTestRow.read).option + } + override def selectByIds(names: Array[IdentityTestId]): Stream[ConnectionIO, IdentityTestRow] = { + sql"""select "always_generated", "default_generated", "name" from public.identity-test where "name" = ANY(${names})""".query(IdentityTestRow.read).stream + } + override def update(row: IdentityTestRow): ConnectionIO[Boolean] = { + val name = row.name + sql"""update public.identity-test + set "always_generated" = ${fromWrite(row.alwaysGenerated)(Write.fromPut(Meta.IntMeta.put))}::int4, + "default_generated" = ${fromWrite(row.defaultGenerated)(Write.fromPut(Meta.IntMeta.put))}::int4 + where "name" = ${fromWrite(name)(Write.fromPut(IdentityTestId.put))}""" + .update + .run + .map(_ > 0) + } + override def update: UpdateBuilder[IdentityTestFields, IdentityTestRow] = { + UpdateBuilder("public.identity-test", IdentityTestFields, IdentityTestRow.read) + } + override def upsert(unsaved: IdentityTestRow): ConnectionIO[IdentityTestRow] = { + sql"""insert into public.identity-test("always_generated", "default_generated", "name") + values ( + ${fromWrite(unsaved.alwaysGenerated)(Write.fromPut(Meta.IntMeta.put))}::int4, + ${fromWrite(unsaved.defaultGenerated)(Write.fromPut(Meta.IntMeta.put))}::int4, + ${fromWrite(unsaved.name)(Write.fromPut(IdentityTestId.put))} + ) + on conflict ("name") + do update set + "always_generated" = EXCLUDED."always_generated", + "default_generated" = EXCLUDED."default_generated" + returning "always_generated", "default_generated", "name" + """.query(IdentityTestRow.read).unique + } +} diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoMock.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoMock.scala new file mode 100644 index 0000000000..b75e3fb8dc --- /dev/null +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoMock.scala @@ -0,0 +1,99 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import doobie.free.connection.ConnectionIO +import doobie.free.connection.delay +import fs2.Stream +import scala.annotation.nowarn +import typo.dsl.DeleteBuilder +import typo.dsl.DeleteBuilder.DeleteBuilderMock +import typo.dsl.DeleteParams +import typo.dsl.SelectBuilder +import typo.dsl.SelectBuilderMock +import typo.dsl.SelectParams +import typo.dsl.UpdateBuilder +import typo.dsl.UpdateBuilder.UpdateBuilderMock +import typo.dsl.UpdateParams + +class IdentityTestRepoMock(toRow: Function1[IdentityTestRowUnsaved, IdentityTestRow], + map: scala.collection.mutable.Map[IdentityTestId, IdentityTestRow] = scala.collection.mutable.Map.empty) extends IdentityTestRepo { + override def delete(name: IdentityTestId): ConnectionIO[Boolean] = { + delay(map.remove(name).isDefined) + } + override def delete: DeleteBuilder[IdentityTestFields, IdentityTestRow] = { + DeleteBuilderMock(DeleteParams.empty, IdentityTestFields, map) + } + override def insert(unsaved: IdentityTestRow): ConnectionIO[IdentityTestRow] = { + delay { + val _ = if (map.contains(unsaved.name)) + sys.error(s"id ${unsaved.name} already exists") + else + map.put(unsaved.name, unsaved) + + unsaved + } + } + override def insertStreaming(unsaved: Stream[ConnectionIO, IdentityTestRow], batchSize: Int): ConnectionIO[Long] = { + unsaved.compile.toList.map { rows => + var num = 0L + rows.foreach { row => + map += (row.name -> row) + num += 1 + } + num + } + } + override def insert(unsaved: IdentityTestRowUnsaved): ConnectionIO[IdentityTestRow] = { + insert(toRow(unsaved)) + } + /* NOTE: this functionality requires PostgreSQL 16 or later! */ + override def insertUnsavedStreaming(unsaved: Stream[ConnectionIO, IdentityTestRowUnsaved], batchSize: Int): ConnectionIO[Long] = { + unsaved.compile.toList.map { unsavedRows => + var num = 0L + unsavedRows.foreach { unsavedRow => + val row = toRow(unsavedRow) + map += (row.name -> row) + num += 1 + } + num + } + } + override def select: SelectBuilder[IdentityTestFields, IdentityTestRow] = { + SelectBuilderMock(IdentityTestFields, delay(map.values.toList), SelectParams.empty) + } + override def selectAll: Stream[ConnectionIO, IdentityTestRow] = { + Stream.emits(map.values.toList) + } + override def selectById(name: IdentityTestId): ConnectionIO[Option[IdentityTestRow]] = { + delay(map.get(name)) + } + override def selectByIds(names: Array[IdentityTestId]): Stream[ConnectionIO, IdentityTestRow] = { + Stream.emits(names.flatMap(map.get).toList) + } + override def update(row: IdentityTestRow): ConnectionIO[Boolean] = { + delay { + map.get(row.name) match { + case Some(`row`) => false + case Some(_) => + map.put(row.name, row): @nowarn + true + case None => false + } + } + } + override def update: UpdateBuilder[IdentityTestFields, IdentityTestRow] = { + UpdateBuilderMock(UpdateParams.empty, IdentityTestFields, map) + } + override def upsert(unsaved: IdentityTestRow): ConnectionIO[IdentityTestRow] = { + delay { + map.put(unsaved.name, unsaved): @nowarn + unsaved + } + } +} diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala new file mode 100644 index 0000000000..b721b2c37d --- /dev/null +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala @@ -0,0 +1,48 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import doobie.enumerated.Nullability +import doobie.postgres.Text +import doobie.util.Read +import doobie.util.meta.Meta +import io.circe.Decoder +import io.circe.Encoder +import java.sql.ResultSet + +case class IdentityTestRow( + /** Identity ALWAYS, identityStart: 1, identityIncrement: 1, identityMaximum: 2147483647, identityMinimum: 1 */ + alwaysGenerated: Int, + /** Identity BY DEFAULT, identityStart: 1, identityIncrement: 1, identityMaximum: 2147483647, identityMinimum: 1 */ + defaultGenerated: Int, + name: IdentityTestId +) + +object IdentityTestRow { + implicit lazy val decoder: Decoder[IdentityTestRow] = Decoder.forProduct3[IdentityTestRow, Int, Int, IdentityTestId]("always_generated", "default_generated", "name")(IdentityTestRow.apply)(Decoder.decodeInt, Decoder.decodeInt, IdentityTestId.decoder) + implicit lazy val encoder: Encoder[IdentityTestRow] = Encoder.forProduct3[IdentityTestRow, Int, Int, IdentityTestId]("always_generated", "default_generated", "name")(x => (x.alwaysGenerated, x.defaultGenerated, x.name))(Encoder.encodeInt, Encoder.encodeInt, IdentityTestId.encoder) + implicit lazy val read: Read[IdentityTestRow] = new Read[IdentityTestRow]( + gets = List( + (Meta.IntMeta.get, Nullability.NoNulls), + (Meta.IntMeta.get, Nullability.NoNulls), + (IdentityTestId.get, Nullability.NoNulls) + ), + unsafeGet = (rs: ResultSet, i: Int) => IdentityTestRow( + alwaysGenerated = Meta.IntMeta.get.unsafeGetNonNullable(rs, i + 0), + defaultGenerated = Meta.IntMeta.get.unsafeGetNonNullable(rs, i + 1), + name = IdentityTestId.get.unsafeGetNonNullable(rs, i + 2) + ) + ) + implicit lazy val text: Text[IdentityTestRow] = Text.instance[IdentityTestRow]{ (row, sb) => + Text.intInstance.unsafeEncode(row.alwaysGenerated, sb) + sb.append(Text.DELIMETER) + Text.intInstance.unsafeEncode(row.defaultGenerated, sb) + sb.append(Text.DELIMETER) + IdentityTestId.text.unsafeEncode(row.name, sb) + } +} diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRowUnsaved.scala new file mode 100644 index 0000000000..0a98a0afe1 --- /dev/null +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRowUnsaved.scala @@ -0,0 +1,39 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import adventureworks.customtypes.Defaulted +import doobie.postgres.Text +import io.circe.Decoder +import io.circe.Encoder + +/** This class corresponds to a row in table `public.identity-test` which has not been persisted yet */ +case class IdentityTestRowUnsaved( + name: IdentityTestId, + /** Identity BY DEFAULT, identityStart: 1, identityIncrement: 1, identityMaximum: 2147483647, identityMinimum: 1 */ + defaultGenerated: Defaulted[Int] +) { + def toRow(defaultGeneratedDefault: => Int, alwaysGeneratedDefault: => Int): IdentityTestRow = + IdentityTestRow( + name = name, + defaultGenerated = defaultGenerated match { + case Defaulted.UseDefault => defaultGeneratedDefault + case Defaulted.Provided(value) => value + }, + alwaysGenerated = alwaysGeneratedDefault + ) +} +object IdentityTestRowUnsaved { + implicit lazy val decoder: Decoder[IdentityTestRowUnsaved] = Decoder.forProduct2[IdentityTestRowUnsaved, IdentityTestId, Defaulted[Int]]("name", "default_generated")(IdentityTestRowUnsaved.apply)(IdentityTestId.decoder, Defaulted.decoder(Decoder.decodeInt)) + implicit lazy val encoder: Encoder[IdentityTestRowUnsaved] = Encoder.forProduct2[IdentityTestRowUnsaved, IdentityTestId, Defaulted[Int]]("name", "default_generated")(x => (x.name, x.defaultGenerated))(IdentityTestId.encoder, Defaulted.encoder(Encoder.encodeInt)) + implicit lazy val text: Text[IdentityTestRowUnsaved] = Text.instance[IdentityTestRowUnsaved]{ (row, sb) => + IdentityTestId.text.unsafeEncode(row.name, sb) + sb.append(Text.DELIMETER) + Defaulted.text(Text.intInstance).unsafeEncode(row.defaultGenerated, sb) + } +} diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestStructure.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestStructure.scala new file mode 100644 index 0000000000..60539f99aa --- /dev/null +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestStructure.scala @@ -0,0 +1,28 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import typo.dsl.SqlExpr.Field +import typo.dsl.SqlExpr.FieldLikeNoHkt +import typo.dsl.SqlExpr.IdField +import typo.dsl.Structure.Relation + +class IdentityTestStructure[Row](val prefix: Option[String], val extract: Row => IdentityTestRow, val merge: (Row, IdentityTestRow) => Row) + extends Relation[IdentityTestFields, IdentityTestRow, Row] + with IdentityTestFields[Row] { outer => + + override val alwaysGenerated = new Field[Int, Row](prefix, "always_generated", None, Some("int4"))(x => extract(x).alwaysGenerated, (row, value) => merge(row, extract(row).copy(alwaysGenerated = value))) + override val defaultGenerated = new Field[Int, Row](prefix, "default_generated", None, Some("int4"))(x => extract(x).defaultGenerated, (row, value) => merge(row, extract(row).copy(defaultGenerated = value))) + override val name = new IdField[IdentityTestId, Row](prefix, "name", None, None)(x => extract(x).name, (row, value) => merge(row, extract(row).copy(name = value))) + + override val columns: List[FieldLikeNoHkt[?, Row]] = + List[FieldLikeNoHkt[?, Row]](alwaysGenerated, defaultGenerated, name) + + override def copy[NewRow](prefix: Option[String], extract: NewRow => IdentityTestRow, merge: (NewRow, IdentityTestRow) => NewRow): IdentityTestStructure[NewRow] = + new IdentityTestStructure(prefix, extract, merge) +} diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/users/UsersRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/users/UsersRow.scala index 4070d00410..95d237b634 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/users/UsersRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/users/UsersRow.scala @@ -23,6 +23,7 @@ case class UsersRow( lastName: Option[String], email: TypoUnknownCitext, password: String, + /** Default: now() */ createdAt: TypoInstant, verifiedOn: Option[TypoInstant] ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala index 6e541f0472..e3bf7ae436 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala @@ -49,6 +49,7 @@ case class ProductvendorRow( /** The product's unit of measure. Points to [[production.unitmeasure.UnitmeasureRow.unitmeasurecode]] */ unitmeasurecode: UnitmeasureId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductvendorId = ProductvendorId(productid, businessentityid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala index 05c42e5fb5..ab1dc207d6 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala @@ -23,7 +23,8 @@ case class PurchaseorderdetailRow( /** Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID. Points to [[purchaseorderheader.PurchaseorderheaderRow.purchaseorderid]] */ purchaseorderid: PurchaseorderheaderId, - /** Primary key. One line number per purchased product. */ + /** Primary key. One line number per purchased product. + Default: nextval('purchasing.purchaseorderdetail_purchaseorderdetailid_seq'::regclass) */ purchaseorderdetailid: Int, /** Date the product is expected to be received. */ duedate: TypoLocalDateTime, @@ -42,6 +43,7 @@ case class PurchaseorderdetailRow( /** Quantity rejected during inspection. Constraint CK_PurchaseOrderDetail_RejectedQty affecting columns rejectedqty: ((rejectedqty >= 0.00)) */ rejectedqty: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: PurchaseorderdetailId = PurchaseorderdetailId(purchaseorderid, purchaseorderdetailid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala index 2dcff75dfe..7f6ab5013b 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala @@ -20,11 +20,14 @@ import io.circe.Encoder import java.sql.ResultSet case class PurchaseorderheaderRow( - /** Primary key. */ + /** Primary key. + Default: nextval('purchasing.purchaseorderheader_purchaseorderid_seq'::regclass) */ purchaseorderid: PurchaseorderheaderId, - /** Incremental number to track changes to the purchase order over time. */ + /** Incremental number to track changes to the purchase order over time. + Default: 0 */ revisionnumber: TypoShort, /** Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete + Default: 1 Constraint CK_PurchaseOrderHeader_Status affecting columns status: (((status >= 1) AND (status <= 4))) */ status: TypoShort, /** Employee who created the purchase order. Foreign key to Employee.BusinessEntityID. @@ -37,20 +40,25 @@ case class PurchaseorderheaderRow( Points to [[shipmethod.ShipmethodRow.shipmethodid]] */ shipmethodid: ShipmethodId, /** Purchase order creation date. + Default: now() Constraint CK_PurchaseOrderHeader_ShipDate affecting columns orderdate, shipdate: (((shipdate >= orderdate) OR (shipdate IS NULL))) */ orderdate: TypoLocalDateTime, /** Estimated shipment date from the vendor. Constraint CK_PurchaseOrderHeader_ShipDate affecting columns orderdate, shipdate: (((shipdate >= orderdate) OR (shipdate IS NULL))) */ shipdate: Option[TypoLocalDateTime], /** Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. + Default: 0.00 Constraint CK_PurchaseOrderHeader_SubTotal affecting columns subtotal: ((subtotal >= 0.00)) */ subtotal: BigDecimal, /** Tax amount. + Default: 0.00 Constraint CK_PurchaseOrderHeader_TaxAmt affecting columns taxamt: ((taxamt >= 0.00)) */ taxamt: BigDecimal, /** Shipping cost. + Default: 0.00 Constraint CK_PurchaseOrderHeader_Freight affecting columns freight: ((freight >= 0.00)) */ freight: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala index e956b7e198..7e8957e1e6 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala @@ -19,17 +19,22 @@ import io.circe.Encoder import java.sql.ResultSet case class ShipmethodRow( - /** Primary key for ShipMethod records. */ + /** Primary key for ShipMethod records. + Default: nextval('purchasing.shipmethod_shipmethodid_seq'::regclass) */ shipmethodid: ShipmethodId, /** Shipping company name. */ name: Name, /** Minimum shipping charge. + Default: 0.00 Constraint CK_ShipMethod_ShipBase affecting columns shipbase: ((shipbase > 0.00)) */ shipbase: BigDecimal, /** Shipping charge per pound. + Default: 0.00 Constraint CK_ShipMethod_ShipRate affecting columns shiprate: ((shiprate > 0.00)) */ shiprate: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala index f90c30a609..a829afb5a6 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala @@ -32,12 +32,15 @@ case class VendorRow( /** 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average Constraint CK_Vendor_CreditRating affecting columns creditrating: (((creditrating >= 1) AND (creditrating <= 5))) */ creditrating: TypoShort, - /** 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product. */ + /** 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product. + Default: true */ preferredvendorstatus: Flag, - /** 0 = Vendor no longer used. 1 = Vendor is actively used. */ + /** 0 = Vendor no longer used. 1 = Vendor is actively used. + Default: true */ activeflag: Flag, /** Vendor URL. */ purchasingwebserviceurl: Option[/* max 1024 chars */ String], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala index 7e025daa92..4157a56c27 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala @@ -24,6 +24,7 @@ case class CountryregioncurrencyRow( /** ISO standard currency code. Foreign key to Currency.CurrencyCode. Points to [[currency.CurrencyRow.currencycode]] */ currencycode: CurrencyId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: CountryregioncurrencyId = CountryregioncurrencyId(countryregioncode, currencycode) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala index e37e24d9b3..b41caad2b7 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala @@ -19,7 +19,8 @@ import io.circe.Encoder import java.sql.ResultSet case class CreditcardRow( - /** Primary key for CreditCard records. */ + /** Primary key for CreditCard records. + Default: nextval('sales.creditcard_creditcardid_seq'::regclass) */ creditcardid: /* user-picked */ CustomCreditcardId, /** Credit card name. */ cardtype: /* max 50 chars */ String, @@ -29,6 +30,7 @@ case class CreditcardRow( expmonth: TypoShort, /** Credit card expiration year. */ expyear: TypoShort, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala index 4a47fe0925..95c30544a8 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala @@ -21,6 +21,7 @@ case class CurrencyRow( currencycode: CurrencyId, /** Currency name. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala index b35961167a..af974a40d0 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala @@ -18,7 +18,8 @@ import io.circe.Encoder import java.sql.ResultSet case class CurrencyrateRow( - /** Primary key for CurrencyRate records. */ + /** Primary key for CurrencyRate records. + Default: nextval('sales.currencyrate_currencyrateid_seq'::regclass) */ currencyrateid: CurrencyrateId, /** Date and time the exchange rate was obtained. */ currencyratedate: TypoLocalDateTime, @@ -32,6 +33,7 @@ case class CurrencyrateRow( averagerate: BigDecimal, /** Final exchange rate for the day. */ endofdayrate: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala index ebac2a225f..2c455f8608 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala @@ -19,7 +19,8 @@ import io.circe.Encoder import java.sql.ResultSet case class CustomerRow( - /** Primary key. */ + /** Primary key. + Default: nextval('sales.customer_customerid_seq'::regclass) */ customerid: CustomerId, /** Foreign key to Person.BusinessEntityID Points to [[person.person.PersonRow.businessentityid]] */ @@ -30,7 +31,9 @@ case class CustomerRow( /** ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. Points to [[salesterritory.SalesterritoryRow.territoryid]] */ territoryid: Option[SalesterritoryId], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala index 65238eef86..f3566c5e21 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala @@ -24,6 +24,7 @@ case class PersoncreditcardRow( /** Credit card identification number. Foreign key to CreditCard.CreditCardID. Points to [[creditcard.CreditcardRow.creditcardid]] */ creditcardid: /* user-picked */ CustomCreditcardId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: PersoncreditcardId = PersoncreditcardId(businessentityid, creditcardid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala index d1af4bc81c..a068a163e6 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala @@ -25,7 +25,8 @@ case class SalesorderdetailRow( /** Primary key. Foreign key to SalesOrderHeader.SalesOrderID. Points to [[salesorderheader.SalesorderheaderRow.salesorderid]] */ salesorderid: SalesorderheaderId, - /** Primary key. One incremental unique number per product sold. */ + /** Primary key. One incremental unique number per product sold. + Default: nextval('sales.salesorderdetail_salesorderdetailid_seq'::regclass) */ salesorderdetailid: Int, /** Shipment tracking number supplied by the shipper. */ carriertrackingnumber: Option[/* max 25 chars */ String], @@ -42,9 +43,12 @@ case class SalesorderdetailRow( Constraint CK_SalesOrderDetail_UnitPrice affecting columns unitprice: ((unitprice >= 0.00)) */ unitprice: BigDecimal, /** Discount amount. + Default: 0.0 Constraint CK_SalesOrderDetail_UnitPriceDiscount affecting columns unitpricediscount: ((unitpricediscount >= 0.00)) */ unitpricediscount: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SalesorderdetailId = SalesorderdetailId(salesorderid, salesorderdetailid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala index e8b544f2f4..b62f7c6885 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala @@ -33,11 +33,14 @@ import java.sql.ResultSet import scala.util.Try case class SalesorderheaderRow( - /** Primary key. */ + /** Primary key. + Default: nextval('sales.salesorderheader_salesorderid_seq'::regclass) */ salesorderid: SalesorderheaderId, - /** Incremental number to track changes to the sales order over time. */ + /** Incremental number to track changes to the sales order over time. + Default: 0 */ revisionnumber: TypoShort, /** Dates the sales order was created. + Default: now() Constraint CK_SalesOrderHeader_DueDate affecting columns duedate, orderdate: ((duedate >= orderdate)) Constraint CK_SalesOrderHeader_ShipDate affecting columns orderdate, shipdate: (((shipdate >= orderdate) OR (shipdate IS NULL))) */ orderdate: TypoLocalDateTime, @@ -48,9 +51,11 @@ case class SalesorderheaderRow( Constraint CK_SalesOrderHeader_ShipDate affecting columns orderdate, shipdate: (((shipdate >= orderdate) OR (shipdate IS NULL))) */ shipdate: Option[TypoLocalDateTime], /** Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled + Default: 1 Constraint CK_SalesOrderHeader_Status affecting columns status: (((status >= 0) AND (status <= 8))) */ status: TypoShort, - /** 0 = Order placed by sales person. 1 = Order placed online by customer. */ + /** 0 = Order placed by sales person. 1 = Order placed online by customer. + Default: true */ onlineorderflag: Flag, /** Customer purchase order number reference. */ purchaseordernumber: Option[OrderNumber], @@ -83,19 +88,24 @@ case class SalesorderheaderRow( Points to [[currencyrate.CurrencyrateRow.currencyrateid]] */ currencyrateid: Option[CurrencyrateId], /** Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. + Default: 0.00 Constraint CK_SalesOrderHeader_SubTotal affecting columns subtotal: ((subtotal >= 0.00)) */ subtotal: BigDecimal, /** Tax amount. + Default: 0.00 Constraint CK_SalesOrderHeader_TaxAmt affecting columns taxamt: ((taxamt >= 0.00)) */ taxamt: BigDecimal, /** Shipping cost. + Default: 0.00 Constraint CK_SalesOrderHeader_Freight affecting columns freight: ((freight >= 0.00)) */ freight: BigDecimal, /** Total due from customer. Computed as Subtotal + TaxAmt + Freight. */ totaldue: Option[BigDecimal], /** Sales representative comments. */ comment: Option[/* max 128 chars */ String], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala index 6694feae83..3d9706aa30 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala @@ -24,6 +24,7 @@ case class SalesorderheadersalesreasonRow( /** Primary key. Foreign key to SalesReason.SalesReasonID. Points to [[salesreason.SalesreasonRow.salesreasonid]] */ salesreasonid: SalesreasonId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SalesorderheadersalesreasonId = SalesorderheadersalesreasonId(salesorderid, salesreasonid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala index 6496a040f2..fe73ef5f44 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala @@ -30,18 +30,24 @@ case class SalespersonRow( Constraint CK_SalesPerson_SalesQuota affecting columns salesquota: ((salesquota > 0.00)) */ salesquota: Option[BigDecimal], /** Bonus due if quota is met. + Default: 0.00 Constraint CK_SalesPerson_Bonus affecting columns bonus: ((bonus >= 0.00)) */ bonus: BigDecimal, /** Commision percent received per sale. + Default: 0.00 Constraint CK_SalesPerson_CommissionPct affecting columns commissionpct: ((commissionpct >= 0.00)) */ commissionpct: BigDecimal, /** Sales total year to date. + Default: 0.00 Constraint CK_SalesPerson_SalesYTD affecting columns salesytd: ((salesytd >= 0.00)) */ salesytd: BigDecimal, /** Sales total of previous year. + Default: 0.00 Constraint CK_SalesPerson_SalesLastYear affecting columns saleslastyear: ((saleslastyear >= 0.00)) */ saleslastyear: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala index 67765042ee..15d475dee6 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala @@ -27,7 +27,9 @@ case class SalespersonquotahistoryRow( /** Sales quota amount. Constraint CK_SalesPersonQuotaHistory_SalesQuota affecting columns salesquota: ((salesquota > 0.00)) */ salesquota: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SalespersonquotahistoryId = SalespersonquotahistoryId(businessentityid, quotadate) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala index 5583a235cb..b7261bf95b 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala @@ -17,12 +17,14 @@ import io.circe.Encoder import java.sql.ResultSet case class SalesreasonRow( - /** Primary key for SalesReason records. */ + /** Primary key for SalesReason records. + Default: nextval('sales.salesreason_salesreasonid_seq'::regclass) */ salesreasonid: SalesreasonId, /** Sales reason description. */ name: Name, /** Category the sales reason belongs to. */ reasontype: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala index 2729187e70..bf07be6f52 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala @@ -21,7 +21,8 @@ import io.circe.Encoder import java.sql.ResultSet case class SalestaxrateRow( - /** Primary key for SalesTaxRate records. */ + /** Primary key for SalesTaxRate records. + Default: nextval('sales.salestaxrate_salestaxrateid_seq'::regclass) */ salestaxrateid: SalestaxrateId, /** State, province, or country/region the sales tax applies to. Points to [[person.stateprovince.StateprovinceRow.stateprovinceid]] */ @@ -29,11 +30,14 @@ case class SalestaxrateRow( /** 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions. Constraint CK_SalesTaxRate_TaxType affecting columns taxtype: (((taxtype >= 1) AND (taxtype <= 3))) */ taxtype: TypoShort, - /** Tax rate amount. */ + /** Tax rate amount. + Default: 0.00 */ taxrate: BigDecimal, /** Tax rate description. */ name: Name, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala index dad3f4206f..11d5730d52 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala @@ -20,7 +20,8 @@ import io.circe.Encoder import java.sql.ResultSet case class SalesterritoryRow( - /** Primary key for SalesTerritory records. */ + /** Primary key for SalesTerritory records. + Default: nextval('sales.salesterritory_territoryid_seq'::regclass) */ territoryid: SalesterritoryId, /** Sales territory description */ name: Name, @@ -30,18 +31,24 @@ case class SalesterritoryRow( /** Geographic area to which the sales territory belong. */ group: /* max 50 chars */ String, /** Sales in the territory year to date. + Default: 0.00 Constraint CK_SalesTerritory_SalesYTD affecting columns salesytd: ((salesytd >= 0.00)) */ salesytd: BigDecimal, /** Sales in the territory the previous year. + Default: 0.00 Constraint CK_SalesTerritory_SalesLastYear affecting columns saleslastyear: ((saleslastyear >= 0.00)) */ saleslastyear: BigDecimal, /** Business costs in the territory year to date. + Default: 0.00 Constraint CK_SalesTerritory_CostYTD affecting columns costytd: ((costytd >= 0.00)) */ costytd: BigDecimal, /** Business costs in the territory the previous year. + Default: 0.00 Constraint CK_SalesTerritory_CostLastYear affecting columns costlastyear: ((costlastyear >= 0.00)) */ costlastyear: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala index f11820f384..97a7b28619 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala @@ -31,7 +31,9 @@ case class SalesterritoryhistoryRow( /** Date the sales representative left work in the territory. Constraint CK_SalesTerritoryHistory_EndDate affecting columns enddate, startdate: (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SalesterritoryhistoryId = SalesterritoryhistoryId(businessentityid, startdate, territoryid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala index 5f870c2ea6..3869c30fae 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala @@ -18,18 +18,22 @@ import io.circe.Encoder import java.sql.ResultSet case class ShoppingcartitemRow( - /** Primary key for ShoppingCartItem records. */ + /** Primary key for ShoppingCartItem records. + Default: nextval('sales.shoppingcartitem_shoppingcartitemid_seq'::regclass) */ shoppingcartitemid: ShoppingcartitemId, /** Shopping cart identification number. */ shoppingcartid: /* max 50 chars */ String, /** Product quantity ordered. + Default: 1 Constraint CK_ShoppingCartItem_Quantity affecting columns quantity: ((quantity >= 1)) */ quantity: Int, /** Product ordered. Foreign key to Product.ProductID. Points to [[production.product.ProductRow.productid]] */ productid: ProductId, - /** Date the time the record was created. */ + /** Date the time the record was created. + Default: now() */ datecreated: TypoLocalDateTime, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala index 134471bf53..d4fc1510b9 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala @@ -18,11 +18,13 @@ import io.circe.Encoder import java.sql.ResultSet case class SpecialofferRow( - /** Primary key for SpecialOffer records. */ + /** Primary key for SpecialOffer records. + Default: nextval('sales.specialoffer_specialofferid_seq'::regclass) */ specialofferid: SpecialofferId, /** Discount description. */ description: /* max 255 chars */ String, /** Discount precentage. + Default: 0.00 Constraint CK_SpecialOffer_DiscountPct affecting columns discountpct: ((discountpct >= 0.00)) */ discountpct: BigDecimal, /** Discount type category. */ @@ -36,12 +38,15 @@ case class SpecialofferRow( Constraint CK_SpecialOffer_EndDate affecting columns enddate, startdate: ((enddate >= startdate)) */ enddate: TypoLocalDateTime, /** Minimum discount percent allowed. + Default: 0 Constraint CK_SpecialOffer_MinQty affecting columns minqty: ((minqty >= 0)) */ minqty: Int, /** Maximum discount percent allowed. Constraint CK_SpecialOffer_MaxQty affecting columns maxqty: ((maxqty >= 0)) */ maxqty: Option[Int], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala index 3934f6828a..4b0e46b381 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala @@ -25,7 +25,9 @@ case class SpecialofferproductRow( /** Product identification number. Foreign key to Product.ProductID. Points to [[production.product.ProductRow.productid]] */ productid: ProductId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SpecialofferproductId = SpecialofferproductId(specialofferid, productid) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala index ef83f5bcf2..7fc3c2a399 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala @@ -30,7 +30,9 @@ case class StoreRow( salespersonid: Option[BusinessentityId], /** Demographic informationg about the store such as the number of employees, annual sales and store type. */ demographics: Option[TypoXml], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/testInsert.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/testInsert.scala index 39c9c39949..5768a426cb 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/testInsert.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/testInsert.scala @@ -198,6 +198,10 @@ import adventureworks.public.Name import adventureworks.public.NameStyle import adventureworks.public.OrderNumber import adventureworks.public.Phone +import adventureworks.public.identity_test.IdentityTestId +import adventureworks.public.identity_test.IdentityTestRepoImpl +import adventureworks.public.identity_test.IdentityTestRow +import adventureworks.public.identity_test.IdentityTestRowUnsaved import adventureworks.public.pgtest.PgtestRepoImpl import adventureworks.public.pgtest.PgtestRow import adventureworks.public.pgtestnull.PgtestnullRepoImpl @@ -617,6 +621,7 @@ class TestInsert(random: Random) { actualcost: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[WorkorderroutingRow] = (new WorkorderroutingRepoImpl).insert(new WorkorderroutingRowUnsaved(workorderid = workorderid, locationid = locationid, productid = productid, operationsequence = operationsequence, scheduledstartdate = scheduledstartdate, scheduledenddate = scheduledenddate, actualstartdate = actualstartdate, actualenddate = actualenddate, actualresourcehrs = actualresourcehrs, plannedcost = plannedcost, actualcost = actualcost, modifieddate = modifieddate)) + def publicIdentityTest(name: IdentityTestId, defaultGenerated: Defaulted[Int] = Defaulted.UseDefault): ConnectionIO[IdentityTestRow] = (new IdentityTestRepoImpl).insert(new IdentityTestRowUnsaved(name = name, defaultGenerated = defaultGenerated)) def publicPgtest(box: TypoBox, bytea: TypoBytea, circle: TypoCircle, diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala index dac3635a15..986a5c04af 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala @@ -18,12 +18,14 @@ import zio.json.ast.Json import zio.json.internal.Write case class DepartmentRow( - /** Primary key for Department records. */ + /** Primary key for Department records. + Default: nextval('humanresources.department_departmentid_seq'::regclass) */ departmentid: DepartmentId, /** Name of the department. */ name: Name, /** Name of the group to which the department belongs. */ groupname: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala index f657f8148d..33f61bb07d 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala @@ -43,19 +43,26 @@ case class EmployeeRow( /** Employee hired on this date. Constraint CK_Employee_HireDate affecting columns hiredate: (((hiredate >= '1996-07-01'::date) AND (hiredate <= (now() + '1 day'::interval)))) */ hiredate: TypoLocalDate, - /** Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. */ + /** Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. + Default: true */ salariedflag: Flag, /** Number of available vacation hours. + Default: 0 Constraint CK_Employee_VacationHours affecting columns vacationhours: (((vacationhours >= '-40'::integer) AND (vacationhours <= 240))) */ vacationhours: TypoShort, /** Number of available sick leave hours. + Default: 0 Constraint CK_Employee_SickLeaveHours affecting columns sickleavehours: (((sickleavehours >= 0) AND (sickleavehours <= 120))) */ sickleavehours: TypoShort, - /** 0 = Inactive, 1 = Active */ + /** 0 = Inactive, 1 = Active + Default: true */ currentflag: Flag, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime, - /** Where the employee is located in corporate hierarchy. */ + /** Where the employee is located in corporate hierarchy. + Default: '/'::character varying */ organizationnode: Option[String] ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala index 3eee2649ff..38001f044c 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala @@ -36,6 +36,7 @@ case class EmployeedepartmenthistoryRow( /** Date the employee left the department. NULL = Current department. Constraint CK_EmployeeDepartmentHistory_EndDate affecting columns enddate, startdate: (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDate], + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: EmployeedepartmenthistoryId = EmployeedepartmenthistoryId(businessentityid, startdate, departmentid, shiftid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala index 6dbc78aa66..2839523b33 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala @@ -30,6 +30,7 @@ case class EmployeepayhistoryRow( /** 1 = Salary received monthly, 2 = Salary received biweekly Constraint CK_EmployeePayHistory_PayFrequency affecting columns payfrequency: ((payfrequency = ANY (ARRAY[1, 2]))) */ payfrequency: TypoShort, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: EmployeepayhistoryId = EmployeepayhistoryId(businessentityid, ratechangedate) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala index e038bac8ab..2f6e65ce56 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala @@ -19,13 +19,15 @@ import zio.json.ast.Json import zio.json.internal.Write case class JobcandidateRow( - /** Primary key for JobCandidate records. */ + /** Primary key for JobCandidate records. + Default: nextval('humanresources.jobcandidate_jobcandidateid_seq'::regclass) */ jobcandidateid: JobcandidateId, /** Employee identification number if applicant was hired. Foreign key to Employee.BusinessEntityID. Points to [[employee.EmployeeRow.businessentityid]] */ businessentityid: Option[BusinessentityId], /** Résumé in XML format. */ resume: Option[TypoXml], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala index 84734e4ce6..3f2562c3c7 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala @@ -19,7 +19,8 @@ import zio.json.ast.Json import zio.json.internal.Write case class ShiftRow( - /** Primary key for Shift records. */ + /** Primary key for Shift records. + Default: nextval('humanresources.shift_shiftid_seq'::regclass) */ shiftid: ShiftId, /** Shift description. */ name: Name, @@ -27,6 +28,7 @@ case class ShiftRow( starttime: TypoLocalTime, /** Shift end time. */ endtime: TypoLocalTime, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/address/AddressRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/address/AddressRow.scala index bf9c5fbffc..50b3755511 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/address/AddressRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/address/AddressRow.scala @@ -20,7 +20,8 @@ import zio.json.ast.Json import zio.json.internal.Write case class AddressRow( - /** Primary key for Address records. */ + /** Primary key for Address records. + Default: nextval('person.address_addressid_seq'::regclass) */ addressid: AddressId, /** First street address line. */ addressline1: /* max 60 chars */ String, @@ -35,7 +36,9 @@ case class AddressRow( postalcode: /* max 15 chars */ String, /** Latitude and longitude of this address. */ spatiallocation: Option[TypoBytea], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala index 55098c9c2d..8a00f6e4d7 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala @@ -19,11 +19,14 @@ import zio.json.ast.Json import zio.json.internal.Write case class AddresstypeRow( - /** Primary key for AddressType records. */ + /** Primary key for AddressType records. + Default: nextval('person.addresstype_addresstypeid_seq'::regclass) */ addresstypeid: AddresstypeId, /** Address type description. For example, Billing, Home, or Shipping. */ name: Name, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala index 8313c507fa..cd04c6e2ad 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala @@ -18,9 +18,12 @@ import zio.json.ast.Json import zio.json.internal.Write case class BusinessentityRow( - /** Primary key for all customers, vendors, and employees. */ + /** Primary key for all customers, vendors, and employees. + Default: nextval('person.businessentity_businessentityid_seq'::regclass) */ businessentityid: BusinessentityId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala index 82516972a4..61a280e137 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala @@ -30,7 +30,9 @@ case class BusinessentityaddressRow( /** Primary key. Foreign key to AddressType.AddressTypeID. Points to [[addresstype.AddresstypeRow.addresstypeid]] */ addresstypeid: AddresstypeId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: BusinessentityaddressId = BusinessentityaddressId(businessentityid, addressid, addresstypeid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala index a6b5b01f96..d084b9945e 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala @@ -29,7 +29,9 @@ case class BusinessentitycontactRow( /** Primary key. Foreign key to ContactType.ContactTypeID. Points to [[contacttype.ContacttypeRow.contacttypeid]] */ contacttypeid: ContacttypeId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: BusinessentitycontactId = BusinessentitycontactId(businessentityid, personid, contacttypeid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala index c0224c3d79..1ef467a1a0 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala @@ -18,10 +18,12 @@ import zio.json.ast.Json import zio.json.internal.Write case class ContacttypeRow( - /** Primary key for ContactType records. */ + /** Primary key for ContactType records. + Default: nextval('person.contacttype_contacttypeid_seq'::regclass) */ contacttypeid: ContacttypeId, /** Contact type description. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala index af1b20ae80..afbacd3c72 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala @@ -22,6 +22,7 @@ case class CountryregionRow( countryregioncode: CountryregionId, /** Country or region name. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala index 5720880e40..a5655a2321 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala @@ -22,11 +22,14 @@ case class EmailaddressRow( /** Primary key. Person associated with this email address. Foreign key to Person.BusinessEntityID Points to [[person.PersonRow.businessentityid]] */ businessentityid: BusinessentityId, - /** Primary key. ID of this email address. */ + /** Primary key. ID of this email address. + Default: nextval('person.emailaddress_emailaddressid_seq'::regclass) */ emailaddressid: Int, /** E-mail address for the person. */ emailaddress: Option[/* max 50 chars */ String], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: EmailaddressId = EmailaddressId(businessentityid, emailaddressid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala index 9167b5279a..a2ed27cd26 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala @@ -25,7 +25,9 @@ case class PasswordRow( passwordhash: /* max 128 chars */ String, /** Random value concatenated with the password string before the password is hashed. */ passwordsalt: /* max 10 chars */ String, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/person/PersonRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/person/PersonRow.scala index 13491d3584..7f90bd4ba1 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/person/PersonRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/person/PersonRow.scala @@ -29,7 +29,8 @@ case class PersonRow( /** Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact Constraint CK_Person_PersonType affecting columns persontype: (((persontype IS NULL) OR (upper((persontype)::text) = ANY (ARRAY['SC'::text, 'VC'::text, 'IN'::text, 'EM'::text, 'SP'::text, 'GC'::text])))) */ persontype: /* bpchar, max 2 chars */ String, - /** 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. */ + /** 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. + Default: false */ namestyle: NameStyle, /** A courtesy title. For example, Mr. or Ms. */ title: Option[/* max 8 chars */ String], @@ -42,13 +43,16 @@ case class PersonRow( /** Surname suffix. For example, Sr. or Jr. */ suffix: Option[/* max 10 chars */ String], /** 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners. + Default: 0 Constraint CK_Person_EmailPromotion affecting columns emailpromotion: (((emailpromotion >= 0) AND (emailpromotion <= 2))) */ emailpromotion: Int, /** Additional contact information about the person stored in xml format. */ additionalcontactinfo: Option[TypoXml], /** Personal information such as hobbies, and income collected from online shoppers. Used for sales analysis. */ demographics: Option[TypoXml], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala index 5b03c76e50..6f04c47083 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala @@ -28,6 +28,7 @@ case class PersonphoneRow( /** Kind of phone number. Foreign key to PhoneNumberType.PhoneNumberTypeID. Points to [[phonenumbertype.PhonenumbertypeRow.phonenumbertypeid]] */ phonenumbertypeid: PhonenumbertypeId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: PersonphoneId = PersonphoneId(businessentityid, phonenumber, phonenumbertypeid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala index 899a1ba6d4..0699af11aa 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala @@ -18,10 +18,12 @@ import zio.json.ast.Json import zio.json.internal.Write case class PhonenumbertypeRow( - /** Primary key for telephone number type records. */ + /** Primary key for telephone number type records. + Default: nextval('person.phonenumbertype_phonenumbertypeid_seq'::regclass) */ phonenumbertypeid: PhonenumbertypeId, /** Name of the telephone number type */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala index 8b5ae6fdb6..ab70a51d98 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala @@ -22,21 +22,25 @@ import zio.json.ast.Json import zio.json.internal.Write case class StateprovinceRow( - /** Primary key for StateProvince records. */ + /** Primary key for StateProvince records. + Default: nextval('person.stateprovince_stateprovinceid_seq'::regclass) */ stateprovinceid: StateprovinceId, /** ISO standard state or province code. */ stateprovincecode: /* bpchar, max 3 chars */ String, /** ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. Points to [[countryregion.CountryregionRow.countryregioncode]] */ countryregioncode: CountryregionId, - /** 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode. */ + /** 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode. + Default: true */ isonlystateprovinceflag: Flag, /** State or province description. */ name: Name, /** ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID. Points to [[sales.salesterritory.SalesterritoryRow.territoryid]] */ territoryid: SalesterritoryId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala index bb8419bba2..21f90810e5 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala @@ -20,7 +20,8 @@ import zio.json.ast.Json import zio.json.internal.Write case class BillofmaterialsRow( - /** Primary key for BillOfMaterials records. */ + /** Primary key for BillOfMaterials records. + Default: nextval('production.billofmaterials_billofmaterialsid_seq'::regclass) */ billofmaterialsid: BillofmaterialsId, /** Parent product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] @@ -32,6 +33,7 @@ case class BillofmaterialsRow( Constraint CK_BillOfMaterials_ProductAssemblyID affecting columns componentid, productassemblyid: ((productassemblyid <> componentid)) */ componentid: ProductId, /** Date the component started being used in the assembly item. + Default: now() Constraint CK_BillOfMaterials_EndDate affecting columns enddate, startdate: (((enddate > startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDateTime, /** Date the component stopped being used in the assembly item. @@ -44,9 +46,11 @@ case class BillofmaterialsRow( Constraint CK_BillOfMaterials_BOMLevel affecting columns bomlevel, perassemblyqty, productassemblyid: ((((productassemblyid IS NULL) AND (bomlevel = 0) AND (perassemblyqty = 1.00)) OR ((productassemblyid IS NOT NULL) AND (bomlevel >= 1)))) */ bomlevel: TypoShort, /** Quantity of the component needed to create the assembly. + Default: 1.00 Constraint CK_BillOfMaterials_BOMLevel affecting columns bomlevel, perassemblyqty, productassemblyid: ((((productassemblyid IS NULL) AND (bomlevel = 0) AND (perassemblyqty = 1.00)) OR ((productassemblyid IS NOT NULL) AND (bomlevel >= 1)))) Constraint CK_BillOfMaterials_PerAssemblyQty affecting columns perassemblyqty: ((perassemblyqty >= 1.00)) */ perassemblyqty: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala index 88abe33902..ff40f389d5 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala @@ -22,6 +22,7 @@ case class CultureRow( cultureid: CultureId, /** Culture description. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala index 77731bfdc0..d74bb1e0df 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala @@ -27,7 +27,8 @@ case class DocumentRow( /** Employee who controls the document. Foreign key to Employee.BusinessEntityID Points to [[humanresources.employee.EmployeeRow.businessentityid]] */ owner: BusinessentityId, - /** 0 = This is a folder, 1 = This is a document. */ + /** 0 = This is a folder, 1 = This is a document. + Default: false */ folderflag: Flag, /** File name of the document */ filename: /* max 400 chars */ String, @@ -35,7 +36,8 @@ case class DocumentRow( fileextension: Option[/* max 8 chars */ String], /** Revision number of the document. */ revision: /* bpchar, max 5 chars */ String, - /** Engineering change approval number. */ + /** Engineering change approval number. + Default: 0 */ changenumber: Int, /** 1 = Pending approval, 2 = Approved, 3 = Obsolete Constraint CK_Document_Status affecting columns status: (((status >= 1) AND (status <= 3))) */ @@ -44,10 +46,13 @@ case class DocumentRow( documentsummary: Option[String], /** Complete document. */ document: Option[TypoBytea], - /** ROWGUIDCOL number uniquely identifying the record. Required for FileStream. */ + /** ROWGUIDCOL number uniquely identifying the record. Required for FileStream. + Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime, - /** Primary key for Document records. */ + /** Primary key for Document records. + Default: '/'::character varying */ documentnode: DocumentId ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala index e27c40f05c..5d25b99b1d 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala @@ -18,10 +18,12 @@ import zio.json.ast.Json import zio.json.internal.Write case class IllustrationRow( - /** Primary key for Illustration records. */ + /** Primary key for Illustration records. + Default: nextval('production.illustration_illustrationid_seq'::regclass) */ illustrationid: IllustrationId, /** Illustrations used in manufacturing instructions. Stored as XML. */ diagram: Option[TypoXml], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/location/LocationRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/location/LocationRow.scala index f378735b1d..74ced5b7f1 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/location/LocationRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/location/LocationRow.scala @@ -18,16 +18,20 @@ import zio.json.ast.Json import zio.json.internal.Write case class LocationRow( - /** Primary key for Location records. */ + /** Primary key for Location records. + Default: nextval('production.location_locationid_seq'::regclass) */ locationid: LocationId, /** Location description. */ name: Name, /** Standard hourly cost of the manufacturing location. + Default: 0.00 Constraint CK_Location_CostRate affecting columns costrate: ((costrate >= 0.00)) */ costrate: BigDecimal, /** Work capacity (in hours) of the manufacturing location. + Default: 0.00 Constraint CK_Location_Availability affecting columns availability: ((availability >= 0.00)) */ availability: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/product/ProductRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/product/ProductRow.scala index a4186505ab..473b0f8e44 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/product/ProductRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/product/ProductRow.scala @@ -24,15 +24,18 @@ import zio.json.ast.Json import zio.json.internal.Write case class ProductRow( - /** Primary key for Product records. */ + /** Primary key for Product records. + Default: nextval('production.product_productid_seq'::regclass) */ productid: ProductId, /** Name of the product. */ name: Name, /** Unique product identification number. */ productnumber: /* max 25 chars */ String, - /** 0 = Product is purchased, 1 = Product is manufactured in-house. */ + /** 0 = Product is purchased, 1 = Product is manufactured in-house. + Default: true */ makeflag: Flag, - /** 0 = Product is not a salable item. 1 = Product is salable. */ + /** 0 = Product is not a salable item. 1 = Product is salable. + Default: true */ finishedgoodsflag: Flag, /** Product color. */ color: Option[/* max 15 chars */ String], @@ -85,7 +88,9 @@ case class ProductRow( sellenddate: Option[TypoLocalDateTime], /** Date the product was discontinued. */ discontinueddate: Option[TypoLocalDateTime], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala index 505ac7c8ba..ff720be49e 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala @@ -19,11 +19,14 @@ import zio.json.ast.Json import zio.json.internal.Write case class ProductcategoryRow( - /** Primary key for ProductCategory records. */ + /** Primary key for ProductCategory records. + Default: nextval('production.productcategory_productcategoryid_seq'::regclass) */ productcategoryid: ProductcategoryId, /** Category description. */ name: Name, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala index 5b14f005df..8465a92723 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala @@ -30,6 +30,7 @@ case class ProductcosthistoryRow( /** Standard cost of the product. Constraint CK_ProductCostHistory_StandardCost affecting columns standardcost: ((standardcost >= 0.00)) */ standardcost: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductcosthistoryId = ProductcosthistoryId(productid, startdate) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala index bb444c4dc7..7efe572a3c 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala @@ -18,11 +18,14 @@ import zio.json.ast.Json import zio.json.internal.Write case class ProductdescriptionRow( - /** Primary key for ProductDescription records. */ + /** Primary key for ProductDescription records. + Default: nextval('production.productdescription_productdescriptionid_seq'::regclass) */ productdescriptionid: ProductdescriptionId, /** Description of the product. */ description: /* max 400 chars */ String, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala index 5724434cf6..c4266aa361 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala @@ -22,8 +22,10 @@ case class ProductdocumentRow( /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ productid: ProductId, + /** Default: now() */ modifieddate: TypoLocalDateTime, /** Document identification number. Foreign key to Document.DocumentNode. + Default: '/'::character varying Points to [[document.DocumentRow.documentnode]] */ documentnode: DocumentId ){ diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala index 3c48b2d995..33317a6b5a 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala @@ -32,9 +32,12 @@ case class ProductinventoryRow( /** Storage container on a shelf in an inventory location. Constraint CK_ProductInventory_Bin affecting columns bin: (((bin >= 0) AND (bin <= 100))) */ bin: TypoShort, - /** Quantity of products in the inventory location. */ + /** Quantity of products in the inventory location. + Default: 0 */ quantity: TypoShort, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductinventoryId = ProductinventoryId(productid, locationid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala index e221eb62ac..c4a2983b7d 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala @@ -30,6 +30,7 @@ case class ProductlistpricehistoryRow( /** Product list price. Constraint CK_ProductListPriceHistory_ListPrice affecting columns listprice: ((listprice > 0.00)) */ listprice: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductlistpricehistoryId = ProductlistpricehistoryId(productid, startdate) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala index 3ae4d256cb..ee98dbc5ea 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala @@ -20,7 +20,8 @@ import zio.json.ast.Json import zio.json.internal.Write case class ProductmodelRow( - /** Primary key for ProductModel records. */ + /** Primary key for ProductModel records. + Default: nextval('production.productmodel_productmodelid_seq'::regclass) */ productmodelid: ProductmodelId, /** Product model description. */ name: Name, @@ -28,7 +29,9 @@ case class ProductmodelRow( catalogdescription: Option[TypoXml], /** Manufacturing instructions in xml format. */ instructions: Option[TypoXml], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala index be331ecaf4..c558cc61e1 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala @@ -25,6 +25,7 @@ case class ProductmodelillustrationRow( /** Primary key. Foreign key to Illustration.IllustrationID. Points to [[illustration.IllustrationRow.illustrationid]] */ illustrationid: IllustrationId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductmodelillustrationId = ProductmodelillustrationId(productmodelid, illustrationid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala index 85571d1e89..ec2d267ca7 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala @@ -29,6 +29,7 @@ case class ProductmodelproductdescriptioncultureRow( /** Culture identification number. Foreign key to Culture.CultureID. Points to [[culture.CultureRow.cultureid]] */ cultureid: CultureId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductmodelproductdescriptioncultureId = ProductmodelproductdescriptioncultureId(productmodelid, productdescriptionid, cultureid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala index 230f0a049c..47a1e733e7 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala @@ -18,7 +18,8 @@ import zio.json.ast.Json import zio.json.internal.Write case class ProductphotoRow( - /** Primary key for ProductPhoto records. */ + /** Primary key for ProductPhoto records. + Default: nextval('production.productphoto_productphotoid_seq'::regclass) */ productphotoid: ProductphotoId, /** Small image of the product. */ thumbnailphoto: Option[TypoBytea], @@ -28,6 +29,7 @@ case class ProductphotoRow( largephoto: Option[TypoBytea], /** Large image file name. */ largephotofilename: Option[/* max 50 chars */ String], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala index e5c44aa19d..1f42a1cf75 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala @@ -26,8 +26,10 @@ case class ProductproductphotoRow( /** Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID. Points to [[productphoto.ProductphotoRow.productphotoid]] */ productphotoid: ProductphotoId, - /** 0 = Photo is not the principal image. 1 = Photo is the principal image. */ + /** 0 = Photo is not the principal image. 1 = Photo is the principal image. + Default: false */ primary: Flag, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductproductphotoId = ProductproductphotoId(productid, productphotoid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala index 5df247878f..d9135bc642 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala @@ -19,14 +19,16 @@ import zio.json.ast.Json import zio.json.internal.Write case class ProductreviewRow( - /** Primary key for ProductReview records. */ + /** Primary key for ProductReview records. + Default: nextval('production.productreview_productreviewid_seq'::regclass) */ productreviewid: ProductreviewId, /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ productid: ProductId, /** Name of the reviewer. */ reviewername: Name, - /** Date review was submitted. */ + /** Date review was submitted. + Default: now() */ reviewdate: TypoLocalDateTime, /** Reviewer's e-mail address. */ emailaddress: /* max 50 chars */ String, @@ -35,6 +37,7 @@ case class ProductreviewRow( rating: Int, /** Reviewer's comments */ comments: Option[/* max 3850 chars */ String], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala index 54cb9c8b0e..085f9d37d2 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala @@ -20,14 +20,17 @@ import zio.json.ast.Json import zio.json.internal.Write case class ProductsubcategoryRow( - /** Primary key for ProductSubcategory records. */ + /** Primary key for ProductSubcategory records. + Default: nextval('production.productsubcategory_productsubcategoryid_seq'::regclass) */ productsubcategoryid: ProductsubcategoryId, /** Product category identification number. Foreign key to ProductCategory.ProductCategoryID. Points to [[productcategory.ProductcategoryRow.productcategoryid]] */ productcategoryid: ProductcategoryId, /** Subcategory description. */ name: Name, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala index 4e37d6bbab..dc119fc843 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala @@ -18,10 +18,12 @@ import zio.json.ast.Json import zio.json.internal.Write case class ScrapreasonRow( - /** Primary key for ScrapReason records. */ + /** Primary key for ScrapReason records. + Default: nextval('production.scrapreason_scrapreasonid_seq'::regclass) */ scrapreasonid: ScrapreasonId, /** Failure description. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala index 7aeb647d33..14045a9658 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala @@ -18,16 +18,19 @@ import zio.json.ast.Json import zio.json.internal.Write case class TransactionhistoryRow( - /** Primary key for TransactionHistory records. */ + /** Primary key for TransactionHistory records. + Default: nextval('production.transactionhistory_transactionid_seq'::regclass) */ transactionid: TransactionhistoryId, /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ productid: ProductId, /** Purchase order, sales order, or work order identification number. */ referenceorderid: Int, - /** Line number associated with the purchase order, sales order, or work order. */ + /** Line number associated with the purchase order, sales order, or work order. + Default: 0 */ referenceorderlineid: Int, - /** Date and time of the transaction. */ + /** Date and time of the transaction. + Default: now() */ transactiondate: TypoLocalDateTime, /** W = WorkOrder, S = SalesOrder, P = PurchaseOrder Constraint CK_TransactionHistory_TransactionType affecting columns transactiontype: ((upper((transactiontype)::text) = ANY (ARRAY['W'::text, 'S'::text, 'P'::text]))) */ @@ -36,6 +39,7 @@ case class TransactionhistoryRow( quantity: Int, /** Product cost. */ actualcost: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala index 07b5739304..34932df556 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala @@ -23,9 +23,11 @@ case class TransactionhistoryarchiveRow( productid: Int, /** Purchase order, sales order, or work order identification number. */ referenceorderid: Int, - /** Line number associated with the purchase order, sales order, or work order. */ + /** Line number associated with the purchase order, sales order, or work order. + Default: 0 */ referenceorderlineid: Int, - /** Date and time of the transaction. */ + /** Date and time of the transaction. + Default: now() */ transactiondate: TypoLocalDateTime, /** W = Work Order, S = Sales Order, P = Purchase Order Constraint CK_TransactionHistoryArchive_TransactionType affecting columns transactiontype: ((upper((transactiontype)::text) = ANY (ARRAY['W'::text, 'S'::text, 'P'::text]))) */ @@ -34,6 +36,7 @@ case class TransactionhistoryarchiveRow( quantity: Int, /** Product cost. */ actualcost: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala index c3b1ff1c5c..7b0e4f78e1 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala @@ -22,6 +22,7 @@ case class UnitmeasureRow( unitmeasurecode: UnitmeasureId, /** Unit of measure description. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala index 73fc1be838..1cb75dd16a 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala @@ -20,7 +20,8 @@ import zio.json.ast.Json import zio.json.internal.Write case class WorkorderRow( - /** Primary key for WorkOrder records. */ + /** Primary key for WorkOrder records. + Default: nextval('production.workorder_workorderid_seq'::regclass) */ workorderid: WorkorderId, /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ @@ -42,6 +43,7 @@ case class WorkorderRow( /** Reason for inspection failure. Points to [[scrapreason.ScrapreasonRow.scrapreasonid]] */ scrapreasonid: Option[ScrapreasonId], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala index 8b8baf24b6..e22d9d132f 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala @@ -51,6 +51,7 @@ case class WorkorderroutingRow( /** Actual manufacturing cost. Constraint CK_WorkOrderRouting_ActualCost affecting columns actualcost: ((actualcost > 0.00)) */ actualcost: Option[BigDecimal], + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: WorkorderroutingId = WorkorderroutingId(workorderid, productid, operationsequence) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestFields.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestFields.scala new file mode 100644 index 0000000000..643c78dd65 --- /dev/null +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestFields.scala @@ -0,0 +1,19 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import typo.dsl.SqlExpr.Field +import typo.dsl.SqlExpr.IdField + +trait IdentityTestFields[Row] { + val alwaysGenerated: Field[Int, Row] + val defaultGenerated: Field[Int, Row] + val name: IdField[IdentityTestId, Row] +} +object IdentityTestFields extends IdentityTestStructure[IdentityTestRow](None, identity, (_, x) => x) + diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestId.scala new file mode 100644 index 0000000000..30ac7951e9 --- /dev/null +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestId.scala @@ -0,0 +1,35 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import adventureworks.Text +import typo.dsl.Bijection +import typo.dsl.ParameterMetaData +import zio.jdbc.JdbcDecoder +import zio.jdbc.JdbcEncoder +import zio.jdbc.SqlFragment.Setter +import zio.json.JsonDecoder +import zio.json.JsonEncoder + +/** Type for the primary key of table `public.identity-test` */ +case class IdentityTestId(value: /* max 250 chars */ String) extends AnyVal +object IdentityTestId { + implicit lazy val arraySetter: Setter[Array[IdentityTestId]] = adventureworks.StringArraySetter.contramap(_.map(_.value)) + implicit lazy val bijection: Bijection[IdentityTestId, /* max 250 chars */ String] = Bijection[IdentityTestId, /* max 250 chars */ String](_.value)(IdentityTestId.apply) + implicit lazy val jdbcDecoder: JdbcDecoder[IdentityTestId] = JdbcDecoder.stringDecoder.map(IdentityTestId.apply) + implicit lazy val jdbcEncoder: JdbcEncoder[IdentityTestId] = JdbcEncoder.stringEncoder.contramap(_.value) + implicit lazy val jsonDecoder: JsonDecoder[IdentityTestId] = JsonDecoder.string.map(IdentityTestId.apply) + implicit lazy val jsonEncoder: JsonEncoder[IdentityTestId] = JsonEncoder.string.contramap(_.value) + implicit lazy val ordering: Ordering[IdentityTestId] = Ordering.by(_.value) + implicit lazy val parameterMetadata: ParameterMetaData[IdentityTestId] = ParameterMetaData.instance[IdentityTestId](ParameterMetaData.StringParameterMetaData.sqlType, ParameterMetaData.StringParameterMetaData.jdbcType) + implicit lazy val setter: Setter[IdentityTestId] = Setter.stringSetter.contramap(_.value) + implicit lazy val text: Text[IdentityTestId] = new Text[IdentityTestId] { + override def unsafeEncode(v: IdentityTestId, sb: StringBuilder) = Text.stringInstance.unsafeEncode(v.value, sb) + override def unsafeArrayEncode(v: IdentityTestId, sb: StringBuilder) = Text.stringInstance.unsafeArrayEncode(v.value, sb) + } +} diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepo.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepo.scala new file mode 100644 index 0000000000..fc123f212e --- /dev/null +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepo.scala @@ -0,0 +1,33 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import typo.dsl.DeleteBuilder +import typo.dsl.SelectBuilder +import typo.dsl.UpdateBuilder +import zio.ZIO +import zio.jdbc.UpdateResult +import zio.jdbc.ZConnection +import zio.stream.ZStream + +trait IdentityTestRepo { + def delete(name: IdentityTestId): ZIO[ZConnection, Throwable, Boolean] + def delete: DeleteBuilder[IdentityTestFields, IdentityTestRow] + def insert(unsaved: IdentityTestRow): ZIO[ZConnection, Throwable, IdentityTestRow] + def insertStreaming(unsaved: ZStream[ZConnection, Throwable, IdentityTestRow], batchSize: Int): ZIO[ZConnection, Throwable, Long] + def insert(unsaved: IdentityTestRowUnsaved): ZIO[ZConnection, Throwable, IdentityTestRow] + /* NOTE: this functionality requires PostgreSQL 16 or later! */ + def insertUnsavedStreaming(unsaved: ZStream[ZConnection, Throwable, IdentityTestRowUnsaved], batchSize: Int): ZIO[ZConnection, Throwable, Long] + def select: SelectBuilder[IdentityTestFields, IdentityTestRow] + def selectAll: ZStream[ZConnection, Throwable, IdentityTestRow] + def selectById(name: IdentityTestId): ZIO[ZConnection, Throwable, Option[IdentityTestRow]] + def selectByIds(names: Array[IdentityTestId]): ZStream[ZConnection, Throwable, IdentityTestRow] + def update(row: IdentityTestRow): ZIO[ZConnection, Throwable, Boolean] + def update: UpdateBuilder[IdentityTestFields, IdentityTestRow] + def upsert(unsaved: IdentityTestRow): ZIO[ZConnection, Throwable, UpdateResult[IdentityTestRow]] +} diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoImpl.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoImpl.scala new file mode 100644 index 0000000000..fa2b462103 --- /dev/null +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoImpl.scala @@ -0,0 +1,101 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import adventureworks.customtypes.Defaulted +import adventureworks.streamingInsert +import typo.dsl.DeleteBuilder +import typo.dsl.SelectBuilder +import typo.dsl.SelectBuilderSql +import typo.dsl.UpdateBuilder +import zio.ZIO +import zio.jdbc.SqlFragment +import zio.jdbc.SqlFragment.Segment +import zio.jdbc.SqlFragment.Setter +import zio.jdbc.UpdateResult +import zio.jdbc.ZConnection +import zio.jdbc.sqlInterpolator +import zio.stream.ZStream + +class IdentityTestRepoImpl extends IdentityTestRepo { + override def delete(name: IdentityTestId): ZIO[ZConnection, Throwable, Boolean] = { + sql"""delete from public.identity-test where "name" = ${Segment.paramSegment(name)(IdentityTestId.setter)}""".delete.map(_ > 0) + } + override def delete: DeleteBuilder[IdentityTestFields, IdentityTestRow] = { + DeleteBuilder("public.identity-test", IdentityTestFields) + } + override def insert(unsaved: IdentityTestRow): ZIO[ZConnection, Throwable, IdentityTestRow] = { + sql"""insert into public.identity-test("always_generated", "default_generated", "name") + values (${Segment.paramSegment(unsaved.alwaysGenerated)(Setter.intSetter)}::int4, ${Segment.paramSegment(unsaved.defaultGenerated)(Setter.intSetter)}::int4, ${Segment.paramSegment(unsaved.name)(IdentityTestId.setter)}) + returning "always_generated", "default_generated", "name" + """.insertReturning(IdentityTestRow.jdbcDecoder).map(_.updatedKeys.head) + } + override def insertStreaming(unsaved: ZStream[ZConnection, Throwable, IdentityTestRow], batchSize: Int): ZIO[ZConnection, Throwable, Long] = { + streamingInsert(s"""COPY public.identity-test("always_generated", "default_generated", "name") FROM STDIN""", batchSize, unsaved)(IdentityTestRow.text) + } + override def insert(unsaved: IdentityTestRowUnsaved): ZIO[ZConnection, Throwable, IdentityTestRow] = { + val fs = List( + Some((sql""""name"""", sql"${Segment.paramSegment(unsaved.name)(IdentityTestId.setter)}")), + unsaved.defaultGenerated match { + case Defaulted.UseDefault => None + case Defaulted.Provided(value) => Some((sql""""default_generated"""", sql"${Segment.paramSegment(value: Int)(Setter.intSetter)}::int4")) + } + ).flatten + + val q = if (fs.isEmpty) { + sql"""insert into public.identity-test default values + returning "always_generated", "default_generated", "name" + """ + } else { + val names = fs.map { case (n, _) => n }.mkFragment(SqlFragment(", ")) + val values = fs.map { case (_, f) => f }.mkFragment(SqlFragment(", ")) + sql"""insert into public.identity-test($names) values ($values) returning "always_generated", "default_generated", "name"""" + } + q.insertReturning(IdentityTestRow.jdbcDecoder).map(_.updatedKeys.head) + + } + /* NOTE: this functionality requires PostgreSQL 16 or later! */ + override def insertUnsavedStreaming(unsaved: ZStream[ZConnection, Throwable, IdentityTestRowUnsaved], batchSize: Int): ZIO[ZConnection, Throwable, Long] = { + streamingInsert(s"""COPY public.identity-test("name", "default_generated") FROM STDIN (DEFAULT '__DEFAULT_VALUE__')""", batchSize, unsaved)(IdentityTestRowUnsaved.text) + } + override def select: SelectBuilder[IdentityTestFields, IdentityTestRow] = { + SelectBuilderSql("public.identity-test", IdentityTestFields, IdentityTestRow.jdbcDecoder) + } + override def selectAll: ZStream[ZConnection, Throwable, IdentityTestRow] = { + sql"""select "always_generated", "default_generated", "name" from public.identity-test""".query(IdentityTestRow.jdbcDecoder).selectStream + } + override def selectById(name: IdentityTestId): ZIO[ZConnection, Throwable, Option[IdentityTestRow]] = { + sql"""select "always_generated", "default_generated", "name" from public.identity-test where "name" = ${Segment.paramSegment(name)(IdentityTestId.setter)}""".query(IdentityTestRow.jdbcDecoder).selectOne + } + override def selectByIds(names: Array[IdentityTestId]): ZStream[ZConnection, Throwable, IdentityTestRow] = { + sql"""select "always_generated", "default_generated", "name" from public.identity-test where "name" = ANY(${Segment.paramSegment(names)(IdentityTestId.arraySetter)})""".query(IdentityTestRow.jdbcDecoder).selectStream + } + override def update(row: IdentityTestRow): ZIO[ZConnection, Throwable, Boolean] = { + val name = row.name + sql"""update public.identity-test + set "always_generated" = ${Segment.paramSegment(row.alwaysGenerated)(Setter.intSetter)}::int4, + "default_generated" = ${Segment.paramSegment(row.defaultGenerated)(Setter.intSetter)}::int4 + where "name" = ${Segment.paramSegment(name)(IdentityTestId.setter)}""".update.map(_ > 0) + } + override def update: UpdateBuilder[IdentityTestFields, IdentityTestRow] = { + UpdateBuilder("public.identity-test", IdentityTestFields, IdentityTestRow.jdbcDecoder) + } + override def upsert(unsaved: IdentityTestRow): ZIO[ZConnection, Throwable, UpdateResult[IdentityTestRow]] = { + sql"""insert into public.identity-test("always_generated", "default_generated", "name") + values ( + ${Segment.paramSegment(unsaved.alwaysGenerated)(Setter.intSetter)}::int4, + ${Segment.paramSegment(unsaved.defaultGenerated)(Setter.intSetter)}::int4, + ${Segment.paramSegment(unsaved.name)(IdentityTestId.setter)} + ) + on conflict ("name") + do update set + "always_generated" = EXCLUDED."always_generated", + "default_generated" = EXCLUDED."default_generated" + returning "always_generated", "default_generated", "name"""".insertReturning(IdentityTestRow.jdbcDecoder) + } +} diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoMock.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoMock.scala new file mode 100644 index 0000000000..7cfd110b92 --- /dev/null +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRepoMock.scala @@ -0,0 +1,98 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import scala.annotation.nowarn +import typo.dsl.DeleteBuilder +import typo.dsl.DeleteBuilder.DeleteBuilderMock +import typo.dsl.DeleteParams +import typo.dsl.SelectBuilder +import typo.dsl.SelectBuilderMock +import typo.dsl.SelectParams +import typo.dsl.UpdateBuilder +import typo.dsl.UpdateBuilder.UpdateBuilderMock +import typo.dsl.UpdateParams +import zio.Chunk +import zio.ZIO +import zio.jdbc.UpdateResult +import zio.jdbc.ZConnection +import zio.stream.ZStream + +class IdentityTestRepoMock(toRow: Function1[IdentityTestRowUnsaved, IdentityTestRow], + map: scala.collection.mutable.Map[IdentityTestId, IdentityTestRow] = scala.collection.mutable.Map.empty) extends IdentityTestRepo { + override def delete(name: IdentityTestId): ZIO[ZConnection, Throwable, Boolean] = { + ZIO.succeed(map.remove(name).isDefined) + } + override def delete: DeleteBuilder[IdentityTestFields, IdentityTestRow] = { + DeleteBuilderMock(DeleteParams.empty, IdentityTestFields, map) + } + override def insert(unsaved: IdentityTestRow): ZIO[ZConnection, Throwable, IdentityTestRow] = { + ZIO.succeed { + val _ = + if (map.contains(unsaved.name)) + sys.error(s"id ${unsaved.name} already exists") + else + map.put(unsaved.name, unsaved) + + unsaved + } + } + override def insertStreaming(unsaved: ZStream[ZConnection, Throwable, IdentityTestRow], batchSize: Int): ZIO[ZConnection, Throwable, Long] = { + unsaved.scanZIO(0L) { case (acc, row) => + ZIO.succeed { + map += (row.name -> row) + acc + 1 + } + }.runLast.map(_.getOrElse(0L)) + } + override def insert(unsaved: IdentityTestRowUnsaved): ZIO[ZConnection, Throwable, IdentityTestRow] = { + insert(toRow(unsaved)) + } + /* NOTE: this functionality requires PostgreSQL 16 or later! */ + override def insertUnsavedStreaming(unsaved: ZStream[ZConnection, Throwable, IdentityTestRowUnsaved], batchSize: Int): ZIO[ZConnection, Throwable, Long] = { + unsaved.scanZIO(0L) { case (acc, unsavedRow) => + ZIO.succeed { + val row = toRow(unsavedRow) + map += (row.name -> row) + acc + 1 + } + }.runLast.map(_.getOrElse(0L)) + } + override def select: SelectBuilder[IdentityTestFields, IdentityTestRow] = { + SelectBuilderMock(IdentityTestFields, ZIO.succeed(Chunk.fromIterable(map.values)), SelectParams.empty) + } + override def selectAll: ZStream[ZConnection, Throwable, IdentityTestRow] = { + ZStream.fromIterable(map.values) + } + override def selectById(name: IdentityTestId): ZIO[ZConnection, Throwable, Option[IdentityTestRow]] = { + ZIO.succeed(map.get(name)) + } + override def selectByIds(names: Array[IdentityTestId]): ZStream[ZConnection, Throwable, IdentityTestRow] = { + ZStream.fromIterable(names.flatMap(map.get)) + } + override def update(row: IdentityTestRow): ZIO[ZConnection, Throwable, Boolean] = { + ZIO.succeed { + map.get(row.name) match { + case Some(`row`) => false + case Some(_) => + map.put(row.name, row): @nowarn + true + case None => false + } + } + } + override def update: UpdateBuilder[IdentityTestFields, IdentityTestRow] = { + UpdateBuilderMock(UpdateParams.empty, IdentityTestFields, map) + } + override def upsert(unsaved: IdentityTestRow): ZIO[ZConnection, Throwable, UpdateResult[IdentityTestRow]] = { + ZIO.succeed { + map.put(unsaved.name, unsaved): @nowarn + UpdateResult(1, Chunk.single(unsaved)) + } + } +} diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala new file mode 100644 index 0000000000..cf026316e5 --- /dev/null +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala @@ -0,0 +1,65 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import adventureworks.Text +import java.sql.ResultSet +import zio.jdbc.JdbcDecoder +import zio.json.JsonDecoder +import zio.json.JsonEncoder +import zio.json.ast.Json +import zio.json.internal.Write + +case class IdentityTestRow( + /** Identity ALWAYS, identityStart: 1, identityIncrement: 1, identityMaximum: 2147483647, identityMinimum: 1 */ + alwaysGenerated: Int, + /** Identity BY DEFAULT, identityStart: 1, identityIncrement: 1, identityMaximum: 2147483647, identityMinimum: 1 */ + defaultGenerated: Int, + name: IdentityTestId +) + +object IdentityTestRow { + implicit lazy val jdbcDecoder: JdbcDecoder[IdentityTestRow] = new JdbcDecoder[IdentityTestRow] { + override def unsafeDecode(columIndex: Int, rs: ResultSet): (Int, IdentityTestRow) = + columIndex + 2 -> + IdentityTestRow( + alwaysGenerated = JdbcDecoder.intDecoder.unsafeDecode(columIndex + 0, rs)._2, + defaultGenerated = JdbcDecoder.intDecoder.unsafeDecode(columIndex + 1, rs)._2, + name = IdentityTestId.jdbcDecoder.unsafeDecode(columIndex + 2, rs)._2 + ) + } + implicit lazy val jsonDecoder: JsonDecoder[IdentityTestRow] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => + val alwaysGenerated = jsonObj.get("always_generated").toRight("Missing field 'always_generated'").flatMap(_.as(JsonDecoder.int)) + val defaultGenerated = jsonObj.get("default_generated").toRight("Missing field 'default_generated'").flatMap(_.as(JsonDecoder.int)) + val name = jsonObj.get("name").toRight("Missing field 'name'").flatMap(_.as(IdentityTestId.jsonDecoder)) + if (alwaysGenerated.isRight && defaultGenerated.isRight && name.isRight) + Right(IdentityTestRow(alwaysGenerated = alwaysGenerated.toOption.get, defaultGenerated = defaultGenerated.toOption.get, name = name.toOption.get)) + else Left(List[Either[String, Any]](alwaysGenerated, defaultGenerated, name).flatMap(_.left.toOption).mkString(", ")) + } + implicit lazy val jsonEncoder: JsonEncoder[IdentityTestRow] = new JsonEncoder[IdentityTestRow] { + override def unsafeEncode(a: IdentityTestRow, indent: Option[Int], out: Write): Unit = { + out.write("{") + out.write(""""always_generated":""") + JsonEncoder.int.unsafeEncode(a.alwaysGenerated, indent, out) + out.write(",") + out.write(""""default_generated":""") + JsonEncoder.int.unsafeEncode(a.defaultGenerated, indent, out) + out.write(",") + out.write(""""name":""") + IdentityTestId.jsonEncoder.unsafeEncode(a.name, indent, out) + out.write("}") + } + } + implicit lazy val text: Text[IdentityTestRow] = Text.instance[IdentityTestRow]{ (row, sb) => + Text.intInstance.unsafeEncode(row.alwaysGenerated, sb) + sb.append(Text.DELIMETER) + Text.intInstance.unsafeEncode(row.defaultGenerated, sb) + sb.append(Text.DELIMETER) + IdentityTestId.text.unsafeEncode(row.name, sb) + } +} diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRowUnsaved.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRowUnsaved.scala new file mode 100644 index 0000000000..5a7c9e9606 --- /dev/null +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRowUnsaved.scala @@ -0,0 +1,57 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import adventureworks.Text +import adventureworks.customtypes.Defaulted +import zio.json.JsonDecoder +import zio.json.JsonEncoder +import zio.json.ast.Json +import zio.json.internal.Write + +/** This class corresponds to a row in table `public.identity-test` which has not been persisted yet */ +case class IdentityTestRowUnsaved( + name: IdentityTestId, + /** Identity BY DEFAULT, identityStart: 1, identityIncrement: 1, identityMaximum: 2147483647, identityMinimum: 1 */ + defaultGenerated: Defaulted[Int] +) { + def toRow(defaultGeneratedDefault: => Int, alwaysGeneratedDefault: => Int): IdentityTestRow = + IdentityTestRow( + name = name, + defaultGenerated = defaultGenerated match { + case Defaulted.UseDefault => defaultGeneratedDefault + case Defaulted.Provided(value) => value + }, + alwaysGenerated = alwaysGeneratedDefault + ) +} +object IdentityTestRowUnsaved { + implicit lazy val jsonDecoder: JsonDecoder[IdentityTestRowUnsaved] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => + val name = jsonObj.get("name").toRight("Missing field 'name'").flatMap(_.as(IdentityTestId.jsonDecoder)) + val defaultGenerated = jsonObj.get("default_generated").toRight("Missing field 'default_generated'").flatMap(_.as(Defaulted.jsonDecoder(JsonDecoder.int))) + if (name.isRight && defaultGenerated.isRight) + Right(IdentityTestRowUnsaved(name = name.toOption.get, defaultGenerated = defaultGenerated.toOption.get)) + else Left(List[Either[String, Any]](name, defaultGenerated).flatMap(_.left.toOption).mkString(", ")) + } + implicit lazy val jsonEncoder: JsonEncoder[IdentityTestRowUnsaved] = new JsonEncoder[IdentityTestRowUnsaved] { + override def unsafeEncode(a: IdentityTestRowUnsaved, indent: Option[Int], out: Write): Unit = { + out.write("{") + out.write(""""name":""") + IdentityTestId.jsonEncoder.unsafeEncode(a.name, indent, out) + out.write(",") + out.write(""""default_generated":""") + Defaulted.jsonEncoder(JsonEncoder.int).unsafeEncode(a.defaultGenerated, indent, out) + out.write("}") + } + } + implicit lazy val text: Text[IdentityTestRowUnsaved] = Text.instance[IdentityTestRowUnsaved]{ (row, sb) => + IdentityTestId.text.unsafeEncode(row.name, sb) + sb.append(Text.DELIMETER) + Defaulted.text(Text.intInstance).unsafeEncode(row.defaultGenerated, sb) + } +} diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestStructure.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestStructure.scala new file mode 100644 index 0000000000..60539f99aa --- /dev/null +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestStructure.scala @@ -0,0 +1,28 @@ +/** + * File has been automatically generated by `typo`. + * + * IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. + */ +package adventureworks +package public +package identity_test + +import typo.dsl.SqlExpr.Field +import typo.dsl.SqlExpr.FieldLikeNoHkt +import typo.dsl.SqlExpr.IdField +import typo.dsl.Structure.Relation + +class IdentityTestStructure[Row](val prefix: Option[String], val extract: Row => IdentityTestRow, val merge: (Row, IdentityTestRow) => Row) + extends Relation[IdentityTestFields, IdentityTestRow, Row] + with IdentityTestFields[Row] { outer => + + override val alwaysGenerated = new Field[Int, Row](prefix, "always_generated", None, Some("int4"))(x => extract(x).alwaysGenerated, (row, value) => merge(row, extract(row).copy(alwaysGenerated = value))) + override val defaultGenerated = new Field[Int, Row](prefix, "default_generated", None, Some("int4"))(x => extract(x).defaultGenerated, (row, value) => merge(row, extract(row).copy(defaultGenerated = value))) + override val name = new IdField[IdentityTestId, Row](prefix, "name", None, None)(x => extract(x).name, (row, value) => merge(row, extract(row).copy(name = value))) + + override val columns: List[FieldLikeNoHkt[?, Row]] = + List[FieldLikeNoHkt[?, Row]](alwaysGenerated, defaultGenerated, name) + + override def copy[NewRow](prefix: Option[String], extract: NewRow => IdentityTestRow, merge: (NewRow, IdentityTestRow) => NewRow): IdentityTestStructure[NewRow] = + new IdentityTestStructure(prefix, extract, merge) +} diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/users/UsersRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/users/UsersRow.scala index a6bfe6b3f9..1406a71501 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/users/UsersRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/users/UsersRow.scala @@ -23,6 +23,7 @@ case class UsersRow( lastName: Option[String], email: TypoUnknownCitext, password: String, + /** Default: now() */ createdAt: TypoInstant, verifiedOn: Option[TypoInstant] ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala index 074eac3d55..debfe982ad 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala @@ -49,6 +49,7 @@ case class ProductvendorRow( /** The product's unit of measure. Points to [[production.unitmeasure.UnitmeasureRow.unitmeasurecode]] */ unitmeasurecode: UnitmeasureId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: ProductvendorId = ProductvendorId(productid, businessentityid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala index 09ab8d8624..3a05b77279 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala @@ -23,7 +23,8 @@ case class PurchaseorderdetailRow( /** Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID. Points to [[purchaseorderheader.PurchaseorderheaderRow.purchaseorderid]] */ purchaseorderid: PurchaseorderheaderId, - /** Primary key. One line number per purchased product. */ + /** Primary key. One line number per purchased product. + Default: nextval('purchasing.purchaseorderdetail_purchaseorderdetailid_seq'::regclass) */ purchaseorderdetailid: Int, /** Date the product is expected to be received. */ duedate: TypoLocalDateTime, @@ -42,6 +43,7 @@ case class PurchaseorderdetailRow( /** Quantity rejected during inspection. Constraint CK_PurchaseOrderDetail_RejectedQty affecting columns rejectedqty: ((rejectedqty >= 0.00)) */ rejectedqty: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: PurchaseorderdetailId = PurchaseorderdetailId(purchaseorderid, purchaseorderdetailid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala index a53931c2ad..2410870356 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala @@ -20,11 +20,14 @@ import zio.json.ast.Json import zio.json.internal.Write case class PurchaseorderheaderRow( - /** Primary key. */ + /** Primary key. + Default: nextval('purchasing.purchaseorderheader_purchaseorderid_seq'::regclass) */ purchaseorderid: PurchaseorderheaderId, - /** Incremental number to track changes to the purchase order over time. */ + /** Incremental number to track changes to the purchase order over time. + Default: 0 */ revisionnumber: TypoShort, /** Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete + Default: 1 Constraint CK_PurchaseOrderHeader_Status affecting columns status: (((status >= 1) AND (status <= 4))) */ status: TypoShort, /** Employee who created the purchase order. Foreign key to Employee.BusinessEntityID. @@ -37,20 +40,25 @@ case class PurchaseorderheaderRow( Points to [[shipmethod.ShipmethodRow.shipmethodid]] */ shipmethodid: ShipmethodId, /** Purchase order creation date. + Default: now() Constraint CK_PurchaseOrderHeader_ShipDate affecting columns orderdate, shipdate: (((shipdate >= orderdate) OR (shipdate IS NULL))) */ orderdate: TypoLocalDateTime, /** Estimated shipment date from the vendor. Constraint CK_PurchaseOrderHeader_ShipDate affecting columns orderdate, shipdate: (((shipdate >= orderdate) OR (shipdate IS NULL))) */ shipdate: Option[TypoLocalDateTime], /** Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. + Default: 0.00 Constraint CK_PurchaseOrderHeader_SubTotal affecting columns subtotal: ((subtotal >= 0.00)) */ subtotal: BigDecimal, /** Tax amount. + Default: 0.00 Constraint CK_PurchaseOrderHeader_TaxAmt affecting columns taxamt: ((taxamt >= 0.00)) */ taxamt: BigDecimal, /** Shipping cost. + Default: 0.00 Constraint CK_PurchaseOrderHeader_Freight affecting columns freight: ((freight >= 0.00)) */ freight: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala index 12d51b0095..5396f99520 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala @@ -19,17 +19,22 @@ import zio.json.ast.Json import zio.json.internal.Write case class ShipmethodRow( - /** Primary key for ShipMethod records. */ + /** Primary key for ShipMethod records. + Default: nextval('purchasing.shipmethod_shipmethodid_seq'::regclass) */ shipmethodid: ShipmethodId, /** Shipping company name. */ name: Name, /** Minimum shipping charge. + Default: 0.00 Constraint CK_ShipMethod_ShipBase affecting columns shipbase: ((shipbase > 0.00)) */ shipbase: BigDecimal, /** Shipping charge per pound. + Default: 0.00 Constraint CK_ShipMethod_ShipRate affecting columns shiprate: ((shiprate > 0.00)) */ shiprate: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala index 179adf5bef..d77ffb85a9 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala @@ -32,12 +32,15 @@ case class VendorRow( /** 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average Constraint CK_Vendor_CreditRating affecting columns creditrating: (((creditrating >= 1) AND (creditrating <= 5))) */ creditrating: TypoShort, - /** 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product. */ + /** 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product. + Default: true */ preferredvendorstatus: Flag, - /** 0 = Vendor no longer used. 1 = Vendor is actively used. */ + /** 0 = Vendor no longer used. 1 = Vendor is actively used. + Default: true */ activeflag: Flag, /** Vendor URL. */ purchasingwebserviceurl: Option[/* max 1024 chars */ String], + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala index c56209d53a..251ab208ed 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala @@ -25,6 +25,7 @@ case class CountryregioncurrencyRow( /** ISO standard currency code. Foreign key to Currency.CurrencyCode. Points to [[currency.CurrencyRow.currencycode]] */ currencycode: CurrencyId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: CountryregioncurrencyId = CountryregioncurrencyId(countryregioncode, currencycode) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala index 40097f7c27..34f3316e47 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala @@ -19,7 +19,8 @@ import zio.json.ast.Json import zio.json.internal.Write case class CreditcardRow( - /** Primary key for CreditCard records. */ + /** Primary key for CreditCard records. + Default: nextval('sales.creditcard_creditcardid_seq'::regclass) */ creditcardid: /* user-picked */ CustomCreditcardId, /** Credit card name. */ cardtype: /* max 50 chars */ String, @@ -29,6 +30,7 @@ case class CreditcardRow( expmonth: TypoShort, /** Credit card expiration year. */ expyear: TypoShort, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala index d78ecf09bb..099ff595ad 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala @@ -22,6 +22,7 @@ case class CurrencyRow( currencycode: CurrencyId, /** Currency name. */ name: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala index 36f6b016bf..5e7cc80fc6 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala @@ -18,7 +18,8 @@ import zio.json.ast.Json import zio.json.internal.Write case class CurrencyrateRow( - /** Primary key for CurrencyRate records. */ + /** Primary key for CurrencyRate records. + Default: nextval('sales.currencyrate_currencyrateid_seq'::regclass) */ currencyrateid: CurrencyrateId, /** Date and time the exchange rate was obtained. */ currencyratedate: TypoLocalDateTime, @@ -32,6 +33,7 @@ case class CurrencyrateRow( averagerate: BigDecimal, /** Final exchange rate for the day. */ endofdayrate: BigDecimal, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala index afdecc1e0b..b31b23ecde 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala @@ -20,7 +20,8 @@ import zio.json.ast.Json import zio.json.internal.Write case class CustomerRow( - /** Primary key. */ + /** Primary key. + Default: nextval('sales.customer_customerid_seq'::regclass) */ customerid: CustomerId, /** Foreign key to Person.BusinessEntityID Points to [[person.person.PersonRow.businessentityid]] */ @@ -31,7 +32,9 @@ case class CustomerRow( /** ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. Points to [[salesterritory.SalesterritoryRow.territoryid]] */ territoryid: Option[SalesterritoryId], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala index 5387980d0f..2183790278 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala @@ -25,6 +25,7 @@ case class PersoncreditcardRow( /** Credit card identification number. Foreign key to CreditCard.CreditCardID. Points to [[creditcard.CreditcardRow.creditcardid]] */ creditcardid: /* user-picked */ CustomCreditcardId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: PersoncreditcardId = PersoncreditcardId(businessentityid, creditcardid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala index 1a898c935b..8b00b27e6f 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala @@ -25,7 +25,8 @@ case class SalesorderdetailRow( /** Primary key. Foreign key to SalesOrderHeader.SalesOrderID. Points to [[salesorderheader.SalesorderheaderRow.salesorderid]] */ salesorderid: SalesorderheaderId, - /** Primary key. One incremental unique number per product sold. */ + /** Primary key. One incremental unique number per product sold. + Default: nextval('sales.salesorderdetail_salesorderdetailid_seq'::regclass) */ salesorderdetailid: Int, /** Shipment tracking number supplied by the shipper. */ carriertrackingnumber: Option[/* max 25 chars */ String], @@ -42,9 +43,12 @@ case class SalesorderdetailRow( Constraint CK_SalesOrderDetail_UnitPrice affecting columns unitprice: ((unitprice >= 0.00)) */ unitprice: BigDecimal, /** Discount amount. + Default: 0.0 Constraint CK_SalesOrderDetail_UnitPriceDiscount affecting columns unitpricediscount: ((unitpricediscount >= 0.00)) */ unitpricediscount: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SalesorderdetailId = SalesorderdetailId(salesorderid, salesorderdetailid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala index 9177907b44..3406bb13ff 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala @@ -29,11 +29,14 @@ import zio.json.ast.Json import zio.json.internal.Write case class SalesorderheaderRow( - /** Primary key. */ + /** Primary key. + Default: nextval('sales.salesorderheader_salesorderid_seq'::regclass) */ salesorderid: SalesorderheaderId, - /** Incremental number to track changes to the sales order over time. */ + /** Incremental number to track changes to the sales order over time. + Default: 0 */ revisionnumber: TypoShort, /** Dates the sales order was created. + Default: now() Constraint CK_SalesOrderHeader_DueDate affecting columns duedate, orderdate: ((duedate >= orderdate)) Constraint CK_SalesOrderHeader_ShipDate affecting columns orderdate, shipdate: (((shipdate >= orderdate) OR (shipdate IS NULL))) */ orderdate: TypoLocalDateTime, @@ -44,9 +47,11 @@ case class SalesorderheaderRow( Constraint CK_SalesOrderHeader_ShipDate affecting columns orderdate, shipdate: (((shipdate >= orderdate) OR (shipdate IS NULL))) */ shipdate: Option[TypoLocalDateTime], /** Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled + Default: 1 Constraint CK_SalesOrderHeader_Status affecting columns status: (((status >= 0) AND (status <= 8))) */ status: TypoShort, - /** 0 = Order placed by sales person. 1 = Order placed online by customer. */ + /** 0 = Order placed by sales person. 1 = Order placed online by customer. + Default: true */ onlineorderflag: Flag, /** Customer purchase order number reference. */ purchaseordernumber: Option[OrderNumber], @@ -79,19 +84,24 @@ case class SalesorderheaderRow( Points to [[currencyrate.CurrencyrateRow.currencyrateid]] */ currencyrateid: Option[CurrencyrateId], /** Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. + Default: 0.00 Constraint CK_SalesOrderHeader_SubTotal affecting columns subtotal: ((subtotal >= 0.00)) */ subtotal: BigDecimal, /** Tax amount. + Default: 0.00 Constraint CK_SalesOrderHeader_TaxAmt affecting columns taxamt: ((taxamt >= 0.00)) */ taxamt: BigDecimal, /** Shipping cost. + Default: 0.00 Constraint CK_SalesOrderHeader_Freight affecting columns freight: ((freight >= 0.00)) */ freight: BigDecimal, /** Total due from customer. Computed as Subtotal + TaxAmt + Freight. */ totaldue: Option[BigDecimal], /** Sales representative comments. */ comment: Option[/* max 128 chars */ String], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala index 99394df0d7..0542964bf8 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala @@ -25,6 +25,7 @@ case class SalesorderheadersalesreasonRow( /** Primary key. Foreign key to SalesReason.SalesReasonID. Points to [[salesreason.SalesreasonRow.salesreasonid]] */ salesreasonid: SalesreasonId, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SalesorderheadersalesreasonId = SalesorderheadersalesreasonId(salesorderid, salesreasonid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala index 1e714d3c04..50546ca0d3 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala @@ -30,18 +30,24 @@ case class SalespersonRow( Constraint CK_SalesPerson_SalesQuota affecting columns salesquota: ((salesquota > 0.00)) */ salesquota: Option[BigDecimal], /** Bonus due if quota is met. + Default: 0.00 Constraint CK_SalesPerson_Bonus affecting columns bonus: ((bonus >= 0.00)) */ bonus: BigDecimal, /** Commision percent received per sale. + Default: 0.00 Constraint CK_SalesPerson_CommissionPct affecting columns commissionpct: ((commissionpct >= 0.00)) */ commissionpct: BigDecimal, /** Sales total year to date. + Default: 0.00 Constraint CK_SalesPerson_SalesYTD affecting columns salesytd: ((salesytd >= 0.00)) */ salesytd: BigDecimal, /** Sales total of previous year. + Default: 0.00 Constraint CK_SalesPerson_SalesLastYear affecting columns saleslastyear: ((saleslastyear >= 0.00)) */ saleslastyear: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala index bb18bf6d01..66b10d332a 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala @@ -27,7 +27,9 @@ case class SalespersonquotahistoryRow( /** Sales quota amount. Constraint CK_SalesPersonQuotaHistory_SalesQuota affecting columns salesquota: ((salesquota > 0.00)) */ salesquota: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SalespersonquotahistoryId = SalespersonquotahistoryId(businessentityid, quotadate) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala index c3416e394b..b4859dbfca 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala @@ -18,12 +18,14 @@ import zio.json.ast.Json import zio.json.internal.Write case class SalesreasonRow( - /** Primary key for SalesReason records. */ + /** Primary key for SalesReason records. + Default: nextval('sales.salesreason_salesreasonid_seq'::regclass) */ salesreasonid: SalesreasonId, /** Sales reason description. */ name: Name, /** Category the sales reason belongs to. */ reasontype: Name, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala index 5c35b59aa1..dc4c3d0078 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala @@ -21,7 +21,8 @@ import zio.json.ast.Json import zio.json.internal.Write case class SalestaxrateRow( - /** Primary key for SalesTaxRate records. */ + /** Primary key for SalesTaxRate records. + Default: nextval('sales.salestaxrate_salestaxrateid_seq'::regclass) */ salestaxrateid: SalestaxrateId, /** State, province, or country/region the sales tax applies to. Points to [[person.stateprovince.StateprovinceRow.stateprovinceid]] */ @@ -29,11 +30,14 @@ case class SalestaxrateRow( /** 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions. Constraint CK_SalesTaxRate_TaxType affecting columns taxtype: (((taxtype >= 1) AND (taxtype <= 3))) */ taxtype: TypoShort, - /** Tax rate amount. */ + /** Tax rate amount. + Default: 0.00 */ taxrate: BigDecimal, /** Tax rate description. */ name: Name, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala index 9a8b35cbea..efa4025b00 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala @@ -20,7 +20,8 @@ import zio.json.ast.Json import zio.json.internal.Write case class SalesterritoryRow( - /** Primary key for SalesTerritory records. */ + /** Primary key for SalesTerritory records. + Default: nextval('sales.salesterritory_territoryid_seq'::regclass) */ territoryid: SalesterritoryId, /** Sales territory description */ name: Name, @@ -30,18 +31,24 @@ case class SalesterritoryRow( /** Geographic area to which the sales territory belong. */ group: /* max 50 chars */ String, /** Sales in the territory year to date. + Default: 0.00 Constraint CK_SalesTerritory_SalesYTD affecting columns salesytd: ((salesytd >= 0.00)) */ salesytd: BigDecimal, /** Sales in the territory the previous year. + Default: 0.00 Constraint CK_SalesTerritory_SalesLastYear affecting columns saleslastyear: ((saleslastyear >= 0.00)) */ saleslastyear: BigDecimal, /** Business costs in the territory year to date. + Default: 0.00 Constraint CK_SalesTerritory_CostYTD affecting columns costytd: ((costytd >= 0.00)) */ costytd: BigDecimal, /** Business costs in the territory the previous year. + Default: 0.00 Constraint CK_SalesTerritory_CostLastYear affecting columns costlastyear: ((costlastyear >= 0.00)) */ costlastyear: BigDecimal, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala index 0cc32c0783..e860549d34 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala @@ -32,7 +32,9 @@ case class SalesterritoryhistoryRow( /** Date the sales representative left work in the territory. Constraint CK_SalesTerritoryHistory_EndDate affecting columns enddate, startdate: (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SalesterritoryhistoryId = SalesterritoryhistoryId(businessentityid, startdate, territoryid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala index 4f8e4e21a8..fb8a47c044 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala @@ -18,18 +18,22 @@ import zio.json.ast.Json import zio.json.internal.Write case class ShoppingcartitemRow( - /** Primary key for ShoppingCartItem records. */ + /** Primary key for ShoppingCartItem records. + Default: nextval('sales.shoppingcartitem_shoppingcartitemid_seq'::regclass) */ shoppingcartitemid: ShoppingcartitemId, /** Shopping cart identification number. */ shoppingcartid: /* max 50 chars */ String, /** Product quantity ordered. + Default: 1 Constraint CK_ShoppingCartItem_Quantity affecting columns quantity: ((quantity >= 1)) */ quantity: Int, /** Product ordered. Foreign key to Product.ProductID. Points to [[production.product.ProductRow.productid]] */ productid: ProductId, - /** Date the time the record was created. */ + /** Date the time the record was created. + Default: now() */ datecreated: TypoLocalDateTime, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala index e561492cf9..35c7c77b50 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala @@ -18,11 +18,13 @@ import zio.json.ast.Json import zio.json.internal.Write case class SpecialofferRow( - /** Primary key for SpecialOffer records. */ + /** Primary key for SpecialOffer records. + Default: nextval('sales.specialoffer_specialofferid_seq'::regclass) */ specialofferid: SpecialofferId, /** Discount description. */ description: /* max 255 chars */ String, /** Discount precentage. + Default: 0.00 Constraint CK_SpecialOffer_DiscountPct affecting columns discountpct: ((discountpct >= 0.00)) */ discountpct: BigDecimal, /** Discount type category. */ @@ -36,12 +38,15 @@ case class SpecialofferRow( Constraint CK_SpecialOffer_EndDate affecting columns enddate, startdate: ((enddate >= startdate)) */ enddate: TypoLocalDateTime, /** Minimum discount percent allowed. + Default: 0 Constraint CK_SpecialOffer_MinQty affecting columns minqty: ((minqty >= 0)) */ minqty: Int, /** Maximum discount percent allowed. Constraint CK_SpecialOffer_MaxQty affecting columns maxqty: ((maxqty >= 0)) */ maxqty: Option[Int], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala index 40d5728b7c..adc570c90a 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala @@ -26,7 +26,9 @@ case class SpecialofferproductRow( /** Product identification number. Foreign key to Product.ProductID. Points to [[production.product.ProductRow.productid]] */ productid: ProductId, + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ){ val compositeId: SpecialofferproductId = SpecialofferproductId(specialofferid, productid) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala index f68d31bf21..a787e7351e 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala @@ -31,7 +31,9 @@ case class StoreRow( salespersonid: Option[BusinessentityId], /** Demographic informationg about the store such as the number of employees, annual sales and store type. */ demographics: Option[TypoXml], + /** Default: uuid_generate_v1() */ rowguid: TypoUUID, + /** Default: now() */ modifieddate: TypoLocalDateTime ) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/testInsert.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/testInsert.scala index 01e06c96e8..a1c7dcd7b1 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/testInsert.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/testInsert.scala @@ -198,6 +198,10 @@ import adventureworks.public.Name import adventureworks.public.NameStyle import adventureworks.public.OrderNumber import adventureworks.public.Phone +import adventureworks.public.identity_test.IdentityTestId +import adventureworks.public.identity_test.IdentityTestRepoImpl +import adventureworks.public.identity_test.IdentityTestRow +import adventureworks.public.identity_test.IdentityTestRowUnsaved import adventureworks.public.pgtest.PgtestRepoImpl import adventureworks.public.pgtest.PgtestRow import adventureworks.public.pgtestnull.PgtestnullRepoImpl @@ -618,6 +622,7 @@ class TestInsert(random: Random) { actualcost: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, WorkorderroutingRow] = (new WorkorderroutingRepoImpl).insert(new WorkorderroutingRowUnsaved(workorderid = workorderid, locationid = locationid, productid = productid, operationsequence = operationsequence, scheduledstartdate = scheduledstartdate, scheduledenddate = scheduledenddate, actualstartdate = actualstartdate, actualenddate = actualenddate, actualresourcehrs = actualresourcehrs, plannedcost = plannedcost, actualcost = actualcost, modifieddate = modifieddate)) + def publicIdentityTest(name: IdentityTestId, defaultGenerated: Defaulted[Int] = Defaulted.UseDefault): ZIO[ZConnection, Throwable, IdentityTestRow] = (new IdentityTestRepoImpl).insert(new IdentityTestRowUnsaved(name = name, defaultGenerated = defaultGenerated)) def publicPgtest(box: TypoBox, bytea: TypoBytea, circle: TypoCircle, diff --git a/typo/src/scala/typo/MetaDb.scala b/typo/src/scala/typo/MetaDb.scala index 1363385803..2da4e9f11c 100644 --- a/typo/src/scala/typo/MetaDb.scala +++ b/typo/src/scala/typo/MetaDb.scala @@ -143,6 +143,7 @@ object MetaDb { tpe = dbType, udtName = None, columnDefault = None, + identity = None, comment = comments.get(coord), jsonDescription = DebugJson(mdCol), nullability = nullability, @@ -187,19 +188,31 @@ object MetaDb { case None => Nullability.NullableUnknown case other => throw new Exception(s"Unknown nullability: $other") } + val tpe = typeMapperDb.col(c) { () => logger.warn(s"Couldn't translate type from table ${relationName.value} column ${parsedName.name.value} with type ${c.udtName}. Falling back to text") } + + val identity = c.identityGeneration.map { value => + db.Identity( + identityGeneration = value, + identityStart = c.identityStart, + identityIncrement = c.identityIncrement, + identityMaximum = c.identityMaximum, + identityMinimum = c.identityMinimum + ) + } val coord = (relationName, parsedName.name) db.Col( parsedName = parsedName, - columnDefault = c.columnDefault, - nullability = nullability, tpe = tpe, udtName = c.udtName, + nullability = nullability, + columnDefault = c.columnDefault, + identity = identity, comment = comments.get(coord), - jsonDescription = jsonDescription, - constraints = constraints.getOrElse(coord, Nil) ++ deps.get(parsedName.name).flatMap(otherCoord => constraints.get(otherCoord)).getOrElse(Nil) + constraints = constraints.getOrElse(coord, Nil) ++ deps.get(parsedName.name).flatMap(otherCoord => constraints.get(otherCoord)).getOrElse(Nil), + jsonDescription = jsonDescription ) } diff --git a/typo/src/scala/typo/db.scala b/typo/src/scala/typo/db.scala index 78e476d096..1e82344e6c 100644 --- a/typo/src/scala/typo/db.scala +++ b/typo/src/scala/typo/db.scala @@ -78,12 +78,32 @@ object db { case class Constraint(name: String, columns: SortedSet[ColName], checkClause: String) + case class Identity( + identityGeneration: String, + identityStart: Option[String], + identityIncrement: Option[String], + identityMaximum: Option[String], + identityMinimum: Option[String] + ) { + def ALWAYS = identityGeneration == "ALWAYS" + def `BY DEFAULT` = identityGeneration == "BY DEFAULT" + def asString: String = + List( + Some(s"Identity $identityGeneration"), + identityStart.map("identityStart: " + _), + identityIncrement.map("identityIncrement: " + _), + identityMaximum.map("identityMaximum: " + _), + identityMinimum.map("identityMinimum: " + _) + ).flatten.mkString(", ") + } + case class Col( parsedName: ParsedName, tpe: Type, udtName: Option[String], nullability: Nullability, columnDefault: Option[String], + identity: Option[Identity], comment: Option[String], constraints: List[Constraint], jsonDescription: DebugJson diff --git a/typo/src/scala/typo/internal/ComputedRowUnsaved.scala b/typo/src/scala/typo/internal/ComputedRowUnsaved.scala index 204e695714..8a58ddeab4 100644 --- a/typo/src/scala/typo/internal/ComputedRowUnsaved.scala +++ b/typo/src/scala/typo/internal/ComputedRowUnsaved.scala @@ -3,7 +3,8 @@ package internal object ComputedRowUnsaved { def apply(source: Source, cols: NonEmptyList[ComputedColumn], default: ComputedDefault, naming: Naming): Option[ComputedRowUnsaved] = { - val (defaultCols, restCols) = cols.toList.partition(_.dbCol.columnDefault.nonEmpty) + val (alwaysGenerated, notAlwaysGenerated) = cols.toList.partition(c => c.dbCol.identity.exists(_.ALWAYS)) + val (defaultCols, restCols) = notAlwaysGenerated.partition(c => c.dbCol.columnDefault.nonEmpty || c.dbCol.identity.exists(_.`BY DEFAULT`)) NonEmptyList.fromList(defaultCols).map { nonEmpty => val defaultCols = nonEmpty.map { col => @@ -13,6 +14,7 @@ object ComputedRowUnsaved { new ComputedRowUnsaved( defaultCols = defaultCols, restCols = restCols, + alwaysGeneratedCols = alwaysGenerated, tpe = sc.Type.Qualified(naming.rowUnsaved(source)) ) } @@ -22,6 +24,7 @@ object ComputedRowUnsaved { case class ComputedRowUnsaved( defaultCols: NonEmptyList[(ComputedColumn, sc.Type)], restCols: List[ComputedColumn], + alwaysGeneratedCols: List[ComputedColumn], tpe: sc.Type.Qualified ) { def allCols: NonEmptyList[ComputedColumn] = diff --git a/typo/src/scala/typo/internal/ComputedSqlFile.scala b/typo/src/scala/typo/internal/ComputedSqlFile.scala index 5de3a77c4e..376bdee1d4 100644 --- a/typo/src/scala/typo/internal/ComputedSqlFile.scala +++ b/typo/src/scala/typo/internal/ComputedSqlFile.scala @@ -60,11 +60,12 @@ case class ComputedSqlFile( parsedName = col.parsedColumnName, tpe = dbType, udtName = None, + nullability = nullability, columnDefault = None, + identity = None, comment = None, - jsonDescription = DebugJson(col), - nullability = nullability, - constraints = Nil + constraints = Nil, + jsonDescription = DebugJson(col) ) ) } diff --git a/typo/src/scala/typo/internal/codegen/FilesRelation.scala b/typo/src/scala/typo/internal/codegen/FilesRelation.scala index 6f0590515c..a241349471 100644 --- a/typo/src/scala/typo/internal/codegen/FilesRelation.scala +++ b/typo/src/scala/typo/internal/codegen/FilesRelation.scala @@ -17,6 +17,8 @@ case class FilesRelation(naming: Naming, names: ComputedNames, maybeCols: Option val formattedCols = cols.map { col => val commentPieces = List[Iterable[String]]( col.dbCol.comment, + col.dbCol.columnDefault.map(x => s"Default: $x"), + col.dbCol.identity.map(_.asString), col.pointsTo.map { case (relationName, columnName) => val shortened = sc.QIdent(dropCommonPrefix(naming.rowName(relationName).idents, names.RowName.value.idents)) s"Points to [[${shortened.dotName}.${naming.field(columnName).value}]]" diff --git a/typo/src/scala/typo/internal/codegen/FilesTable.scala b/typo/src/scala/typo/internal/codegen/FilesTable.scala index 71398c6fbd..b86037656d 100644 --- a/typo/src/scala/typo/internal/codegen/FilesTable.scala +++ b/typo/src/scala/typo/internal/codegen/FilesTable.scala @@ -21,9 +21,8 @@ case class FilesTable(table: ComputedTable, options: InternalOptions, genOrderin sc.Ident(col.name.value).appended("Default") val params: NonEmptyList[sc.Param] = - unsaved.defaultCols.map { case (col, originalType) => - sc.Param(mkDefaultParamName(col), sc.Type.ByName(originalType), None) - } + unsaved.defaultCols.map { case (col, originalType) => sc.Param(mkDefaultParamName(col), sc.Type.ByName(originalType), None) } ++ + unsaved.alwaysGeneratedCols.map(col => sc.Param(mkDefaultParamName(col), sc.Type.ByName(col.tpe), None)) val keyValues1 = unsaved.defaultCols.map { case (col, _) => @@ -33,7 +32,11 @@ case class FilesTable(table: ComputedTable, options: InternalOptions, genOrderin | case ${table.default.Defaulted}.${table.default.Provided}(value) => value |}""".stripMargin (col.name, impl) - } + } ++ + unsaved.alwaysGeneratedCols.map { col => + val defaultParamName = mkDefaultParamName(col) + (col.name, defaultParamName.code) + } val keyValues2 = unsaved.restCols.map { col => @@ -52,6 +55,7 @@ case class FilesTable(table: ComputedTable, options: InternalOptions, genOrderin val formattedCols = unsaved.allCols.map { col => val commentPieces = List[Iterable[String]]( col.dbCol.columnDefault.map(x => s"Default: $x"), + col.dbCol.identity.map(_.asString), col.dbCol.comment, col.pointsTo map { case (relationName, columnName) => val shortened = sc.QIdent(relation.dropCommonPrefix(table.naming.rowName(relationName).idents, rowFile.tpe.value.idents))