Skip to content

Conversation

@goldenice
Copy link
Contributor

No description provided.

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 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.

Comment on lines +151 to +154
// const tx = await this.driver.startTransaction();

// try {
// // Run schema validation with a fictive entity to validate the schema is actually what we expect
Copy link

Copilot AI Oct 17, 2025

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.

Copilot uses AI. Check for mistakes.
@goldenice goldenice merged commit c7d6460 into main Oct 21, 2025
8 checks passed
@goldenice goldenice deleted the refactor 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