Codegen: emit one file per model in typed sub-packages#67
Merged
Conversation
Generate one file per table under {package}.tables and one per Postgres enum
under {package}.enums (jOOQ-style) instead of a single SupabaseModels.kt. Keeps
large schemas navigable and yields one-file diffs per column change; a table and
an enum sharing a Kotlin name no longer collide. generate() now returns
List<GeneratedFile>; removed the CLI --file flag and the Gradle fileName option.
Generated header now points users to extension functions for customisation.
Regenerated the chat-compose sample into the new tables/ layout.
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.
Studied OpenAPI Generator / jOOQ layouts and moved codegen from a single
SupabaseModels.ktto one file per model in typed sub-packages.What
{package}.tables(one file each); Postgres enums →{package}.enums(one file each). Mirrors jOOQ.order_status) no longer collide — they're in different packages.API change (pre-stable)
SupabaseModelGenerator.generate(spec, package)now returnsList<GeneratedFile>(was a singleString).--fileflag and the GradlefileNameoption (no longer one file).Verified
:supabase-codegen+:supabase-codegen-gradlebuild green (tests + detekt + spotless); tests updated for the new layout.generated/tables/and compiled the 3 model files withkotlinc+ the serialization plugin (serializers generated).