Conversation
- Added exhaustive integration test schema covering all Prisma features: - All scalar types (String, Int, Float, Boolean, DateTime, Json, BigInt, Decimal, Bytes) - All array types with proper json<T[]>() mapping - 5 different enums with @Map support - All relationship types (1:1, 1:N, N:N implicit/explicit) - Self-referential relationships (parent/children, social follow, blocked users) - Composite primary keys (@@id) and composite foreign keys - Field mapping (@Map) and table mapping (@@Map) - Various @default configurations - Native PostgreSQL types (@db.*) - Edge cases (reserved words, long names, minimal models) - Model exclusion via excludeTables config - Fixed import generation to correctly extract base types for generics (enumeration<T>() -> enumeration, json<T>() -> json) - Fixed self-referential implicit many-to-many relationships not creating join tables (localeCompare returns 0 when model names are identical) The integration schema is now 990+ lines with 55+ models demonstrating comprehensive coverage of Prisma schema features.
…ions - Reduced schema from 990+ lines to 316 lines while maintaining full coverage - Each model now has clear /// TEST: comments explaining what it tests - Organized into logical sections: Scalars, Mappings, PKs, Relationships, Edge Cases Bug fix: - Fixed self-referential M:N relationships not finding correct backReference (find() was returning same field instead of the paired relation field) Coverage maintained: - All scalar types (String, Int, Float, Boolean, DateTime, Json, BigInt, Decimal, Bytes) - Array types → json<T[]>() - Enums with @Map, enum arrays - Field @Map and table @@Map - Composite @@id primary keys - All relationship types: 1:1, 1:N, implicit M:N, explicit M:N, self-referential - Multiple relations to same model (creator/assignee pattern) - Native @db.* types - excludeTables config - Edge cases (minimal model, reserved words)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
.from(<dbTable>)when@@mapor casing changes; improve relationship mapping by skipping self back-references and producing stable join-column ordering for implicit self many-to-many relations; extend schema-mapper tests for these cases.enumeration<T>(),json<T>()), stop emitting the deprecatedcrudbuilder, bump to0.1.0-canary.2, and remove the unused@ts-morph/commondependency.