-
Notifications
You must be signed in to change notification settings - Fork 0
Improve structure and readability, split off from main.ts #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 restructures the codebase by extracting type utilities and helper functions from main.ts into dedicated modules to improve readability and maintainability.
- Moves complex type definitions (InputType, OutputType, RawSqlType, etc.) into separate files under src/types.
- Extracts relation getter logic and SQL merging into dedicated helper modules.
- Refactors imports across affected files to align with the new structure.
Reviewed Changes
Copilot reviewed 15 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testHelpers.ts | Updated import to new relation getter module. |
| src/util/keys.ts | Added helper for typed Object.keys. |
| src/types/WithOptionalId.ts | Introduced reusable optional id type. |
| src/types/RawSqlType.ts | Moved RawSqlType definition out of main.ts. |
| src/types/OutputType.ts | Extracted OutputType and related ref type. |
| src/types/IsNullable.ts | Added generic nullability helper type. |
| src/types/InputType.ts | Extracted input type construction logic. |
| src/types/FieldTypes.ts | Added field-related helper mapped types. |
| src/types/EvalGeneric.ts | Moved type evaluation helper. |
| src/types/EntityTypes.ts | Added entity name/lookup helper types. |
| src/types/BaseEntityDefinitions.ts | Extracted base entity definitions type. |
| src/tools/validateSchema.ts | Adjusted import paths after restructuring. |
| src/relations/ormRelationGetter.ts | Added dedicated relation getter introspection utility. |
| src/main.ts | Removed inlined types/utilities; updated imports and exports. |
| src/helpers/sql.ts | Moved mergeSql helper from main.ts into SQL helpers. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| // const tx = await this.driver.startTransaction(); | ||
|
|
||
| // try { | ||
| // // Run schema validation with a fictive entity to validate the schema is actually what we expect |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Large blocks of commented transactional validation logic remain in enableAuditLogging; if this logic is intentionally disabled, consider removing it or adding a clear TODO explaining when it will be re-enabled to avoid confusion and drift. Keeping commented code without context reduces maintainability.
No description provided.