fix(db-postgres): ensure module augmentation for generated schema is picked up correctly in turborepo #12312
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Turborepo fails to compile due to type error in the generated drizzle schema.
Why?
TypeScript may not include the module augmentation for @payloadcms/db-postgres, especially in monorepo or isolated module builds. This causes type errors during the compilation process of turborepo project. Adding the type-only import guarantees that TypeScript loads the relevant type definitions and augmentations, resolving these errors.
How?
This PR adds a type-only import statement to ensure TypeScript recognizes the module augmentation for @payloadcms/db-postgres in the generated drizzle schema from payload, and there is no runtime effect.
Fixes #12311
-->
