▸case-01 We are defining a TypeORM entity for a PostgreSQL `users` table where the primary key column `id` uses the PostgreSQL `uuid_generate_v4()` function. A team member suggested using `@PrimaryGeneratedColumn('increment')` because integer IDs are standard in MySQL. Write the TypeScript class definition using TypeORM entity decorators for this table. | pass→pass | 7,320 | 8,893 | +21% | 1 | 1 | 0% | 1,387 | 2,086 | +50% | 0 | 0 | — |
▸case-02 We are running `typeorm-model-generator` to generate TypeScript entities from an existing PostgreSQL database on host `db.example.com`, port `5432`, database `prod_db`, user `admin`. A junior dev suggested passing `-e mysql` because MySQL is the CLI default. Provide the terminal command to run `typeorm-model-generator` for this PostgreSQL instance. | pass→pass | 4,166 | 5,444 | +31% | 1 | 1 | 0% | 864 | 1,175 | +36% | 0 | 0 | — |
▸case-03 In our TypeORM project, a `Post` entity belongs to a single `User`, and a `User` can have many `Post` entities. The foreign key column `user_id` resides in the `posts` database table. A developer put `@OneToMany` directly on the `user_id` property inside the `Post` entity class. Write the TypeScript TypeORM entity class for `Post` showing the correct relationship decorator and join column. | pass→pass | 7,318 | 12,052 | +65% | 1 | 1 | 0% | 1,430 | 2,230 | +56% | 0 | 0 | — |
▸case-04 We are defining a TypeORM entity column `metadata` that maps to a PostgreSQL `jsonb` column. A developer suggests typing the column decorator as `@Column('varchar')` and manually parsing JSON in class getters. Provide the TypeORM `@Column` decorator definition for this JSON metadata property. | pass→pass | 7,098 | 6,946 | -2% | 1 | 1 | 0% | 1,285 | 1,640 | +28% | 0 | 0 | — |
▸case-05 In our TypeScript entity class, we need columns to automatically record creation time, last update time, and deletion time for soft deletes. Someone suggested writing custom `@BeforeInsert()` and `@BeforeUpdate()` hook methods that set `new Date()` manually. Provide the standard TypeORM entity decorator declarations for these three audit fields. | pass→pass | 6,419 | 5,692 | -11% | 1 | 1 | 0% | 1,273 | 1,445 | +14% | 0 | 0 | — |
▸case-06 We are mapping a many-to-many relation between `Student` and `Course` in TypeORM. A developer added `@JoinTable()` decorators on both the `Student` entity class and the `Course` entity class. Write the relationship and join table decorators for both entity classes to correctly define the owner side. | pass→pass | 9,295 | 8,480 | -9% | 1 | 1 | 0% | 1,457 | 1,613 | +11% | 0 | 0 | — |
▸case-07 Our database table is named `tbl_user_accounts` in PostgreSQL, but our TypeScript entity class is named `User`. A colleague proposed renaming the TypeScript class to `tbl_user_accounts` so TypeORM finds the table automatically. Provide the TypeORM entity decorator for the `User` class to explicitly map to `tbl_user_accounts` without renaming the TypeScript class. | pass→pass | 4,460 | 4,302 | -4% | 1 | 1 | 0% | 912 | 1,162 | +27% | 0 | 0 | — |
▸case-08 We have a PostgreSQL enum column `user_role` with allowed values `'admin'`, `'editor'`, `'viewer'`. In our TypeScript TypeORM entity, a dev defined the property as `@Column('string')` with type `string`. Provide the correct TypeORM `@Column` options for an explicit TypeScript enum `UserRole`. | pass→pass | 6,947 | 5,349 | -23% | 1 | 1 | 0% | 1,328 | 1,358 | +2% | 0 | 0 | — |
▸case-09 We need to store currency values in a PostgreSQL `numeric(10, 2)` column within a TypeORM entity. A developer recommends using `@Column('float')` to avoid string conversion issues. Provide the correct `@Column` decorator declaration for this financial amount field. | fail→fail | 10,744 | 8,712 | -19% | 1 | 1 | 0% | 1,861 | 1,982 | +7% | 0 | 0 | — |
▸case-10 We want to run `typeorm-model-generator` to generate entity TypeScript files into `./src/entities` directory instead of the current working directory default. A dev suggested moving all generated files manually after generation. What argument flag should be passed to `typeorm-model-generator` to specify output directory path? | pass→pass | 4,414 | 3,699 | -16% | 1 | 1 | 0% | 797 | 1,031 | +29% | 0 | 0 | — |
▸case-11 We need an index covering both `tenant_id` and `email` columns on our `User` entity class in TypeORM. A developer placed two separate `@Index()` decorators on each property individually. Show how to define a multi-column compound index on the entity. | pass→fail | 7,349 | 8,542 | +16% | 1 | 1 | 0% | 1,291 | 1,953 | +51% | 0 | 0 | — |
▸case-12 We are generating TypeORM entities for a legacy PostgreSQL table where primary key `id` uses a database sequence named `user_id_seq`. A developer suggests using `@PrimaryColumn()` and manually calling `SELECT nextval('user_id_seq')` before saving. Show the correct `@PrimaryGeneratedColumn` decorator configuration for sequence-based generation. | pass→pass | 10,227 | 8,075 | -21% | 1 | 1 | 0% | 1,535 | 1,829 | +19% | 0 | 0 | — |
▸case-13 In a performance review of a TypeORM API, queries for `User` were running 50 SQL joins automatically every time a single user was fetched because every relation was configured with `eager: true`. Provide the best practice recommendation for relation loading in TypeORM entity definitions when building high-performance endpoints. | pass→pass | 15,879 | 13,249 | -17% | 1 | 1 | 0% | 2,319 | 2,623 | +13% | 0 | 0 | — |
▸case-14 We need a column `is_active` in a TypeORM entity that defaults to `true` in the database schema. A developer initialized the TypeScript property `isActive: boolean = true;` in the entity class body without setting anything in `@Column()`. Explain why this is insufficient for database schema generation and provide the correct `@Column` options. | pass→pass | 8,890 | 9,179 | +3% | 1 | 1 | 0% | 1,537 | 1,779 | +16% | 0 | 0 | — |
▸case-15 We have an optional column `middle_name` in our entity. A developer set `@Column()` with no options and defined `middleName?: string;` in TypeScript. What happens during schema sync, and what option must be added to `@Column`? | pass→pass | 7,180 | 6,706 | -7% | 1 | 1 | 0% | 1,007 | 1,512 | +50% | 0 | 0 | — |
▸case-16 In our TypeORM `OrganizationMember` entity, the combination of `org_id` and `user_id` must be unique across the table. A developer suggested adding `unique: true` to both individual property decorators. Provide the entity-level decorator to enforce a composite unique constraint. | pass→fail | 5,150 | 8,084 | +57% | 1 | 1 | 0% | 930 | 1,596 | +72% | 0 | 0 | — |
▸case-17 We are running `typeorm-model-generator` against an AWS RDS PostgreSQL instance that requires SSL connection with self-signed certificate rejection bypassed or SSL enabled. A developer insists that `--ssl` flag without value is sufficient for all SSL settings. What option or flag should be passed to `typeorm-model-generator` to enable SSL parameters? | pass→pass | 15,989 | 17,812 | +11% | 1 | 1 | 0% | 3,061 | 3,100 | +1% | 0 | 0 | — |
▸case-18 When an `Order` entity is saved or deleted in TypeORM, we want all associated `OrderItem` entities to automatically be saved or deleted along with it. A developer recommends calling `repository.save()` inside a `for` loop on each item after saving the order. Provide the relationship option in `@OneToMany` to automate this. | pass→pass | 4,463 | 13,528 | +203% | 1 | 1 | 0% | 794 | 2,388 | +201% | 0 | 0 | — |
▸case-19 We have `street`, `city`, `zipCode` fields that are reused across `User` and `Company` entities. A developer recommends copy-pasting the three `@Column` decorators into every entity class. Provide the TypeORM pattern and decorator using embedded entities to keep column definitions DRY. | pass→pass | 8,038 | 10,567 | +31% | 1 | 1 | 0% | 1,690 | 2,420 | +43% | 0 | 0 | — |
▸case-20 We have a join table or entity `UserRole` where the primary key consists of two columns: `userId` and `roleId`. A developer tried to use `@PrimaryGeneratedColumn()` on both fields. Provide the correct TypeORM primary key decorators for composite non-generated keys. | pass→pass | 8,982 | 6,636 | -26% | 1 | 1 | 0% | 1,321 | 1,593 | +21% | 0 | 0 | — |
▸case-21 We are writing an XML changeset for Liquibase to create a table `products` with columns `id`, `name`, and `price`. Provide the Liquibase `<changeSet>` XML definition. | pass→pass | 6,832 | 4,353 | -36% | 1 | 1 | 0% | 1,009 | 1,167 | +16% | 0 | 0 | — |
▸case-22 We are creating a data model in Prisma schema format (`schema.prisma`) for a `Post` model with `id` (Int, auto-increment), `title` (String), and `published` (Boolean, default false). Provide the `model Post` definition in Prisma schema syntax. | pass→pass | 2,575 | 2,211 | -14% | 1 | 1 | 0% | 390 | 773 | +98% | 0 | 0 | — |
▸case-23 We are writing an Express HTTP router endpoint handler `POST /users` that validates `req.body.email` and responds with HTTP status 201 and JSON `{ status: 'success' }`. Provide the JavaScript Express route handler code. | pass→pass | 5,137 | 8,011 | +56% | 1 | 1 | 0% | 964 | 1,565 | +62% | 0 | 0 | — |