Feat: From schema.prisma to sql files - #2
Merged
Merged
Conversation
1- refactor the providers into its own package to use in schema and migration packages (might be a part of global enums later) 2-add validateRelation() to the resolver to ensure type consistency in the relations, and the count of FKs and Ref fields 3-add 4 more funcs to the Dialect interface (generateEnum, FormatAutoInc, FormatSinglePk, FormatEnumConstraint), and implement each one in the pgDialect and sqliteDialect 4-define then modulize generateTables() and generateEnums(), takes ASTs and generates full Up migration tables (will refactor the props in a struct), modulized into many helpers, each one with it's own responsibility 5- define DropTables() and DropEnums() to generate the SQL for dropping in goose 6- define 3 facades, GenerateUpMigrations(), which generates tables and enums, returns the up migration. GenerateDownMigration(), which returns the down SQL string, and finally the GenerateMigration() which put it all together into a goose-complient fashion because that's what im gonna use under the hood 7- test file in migration package is Claude trying to break my implementation and it passed so i'll take the win
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.
1- refactor the providers into its own package to use in schema and migration packages (might be a part of global enums later)
2-add validateRelation() to the resolver to ensure type consistency in the relations, and the count of FKs and Ref fields
3-add 4 more funcs to the Dialect interface (generateEnum, FormatAutoInc, FormatSinglePk, FormatEnumConstraint), and implement each one in the pgDialect and sqliteDialect
4-define then modulize generateTables() and generateEnums(), takes ASTs and generates full Up migration tables (will refactor the props in a struct), modulized into many helpers, each one with it's own responsibility
5- define DropTables() and DropEnums() to generate the SQL for dropping in goose
6- define 3 facades, GenerateUpMigrations(), which generates tables and enums, returns the up migration. GenerateDownMigration(), which returns the down SQL string, and finally the GenerateMigration() which put it all together into a goose-complient fashion because that's what im gonna use under the hood
7- test file in migration package is Claude trying to break my implementation and it passed so i'll take the win