Skip to content

Conversation

@goldenice
Copy link
Contributor

Merge #6 and #7 first

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds row order preservation to the findByIds function, ensuring returned entities maintain the same order as the input IDs array. Additionally, it refactors type definitions into separate files and introduces explicit nullability settings using 'NULLABLE' and 'NOT NULL' string literals instead of boolean values.

Key Changes

  • Modified findByIds to preserve input ID ordering and handle duplicate IDs
  • Refactored type definitions from main.ts into dedicated type files
  • Introduced explicit nullability with 'NULLABLE'/'NOT NULL' string literals as an alternative to boolean values

Reviewed Changes

Copilot reviewed 20 out of 23 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/pg-backend/findByIds.test.ts Added tests for ID order preservation including ascending, descending, and duplicate ID scenarios
src/main.ts Refactored findByIds to preserve input order, renamed prepEntity to createOutputTypeFromRawSqlType, updated nullability checks
src/entities/BaseEntity.ts Updated field and relation definitions to use new Nullable type
src/entities/Nullable.ts New file defining Nullable type and isNullable helper function
src/types/*.ts New type definition files extracted from main.ts
src/helpers/sql.ts Moved mergeSql function from main.ts
src/relations/ormRelationGetter.ts Extracted relation getter logic into separate file
src/tools/validateSchema.ts Updated import paths
tests/testHelpers.ts Updated import for isOrmRelationGetter
eslint.config.js Commented out require-atomic-updates rule
.changeset/fair-knives-notice.md Added changeset for nullability feature

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@goldenice goldenice self-assigned this Oct 18, 2025
@goldenice goldenice merged commit 6f3b9cf into main Oct 21, 2025
4 checks passed
@goldenice goldenice deleted the order-preservation branch October 21, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants