Skip to content

bug-fix#1043

Closed
prem-2006 wants to merge 4 commits intosupabase:masterfrom
prem-2006:master
Closed

bug-fix#1043
prem-2006 wants to merge 4 commits intosupabase:masterfrom
prem-2006:master

Conversation

@prem-2006
Copy link
Copy Markdown

@prem-2006 prem-2006 commented Feb 18, 2026

Closes

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added comprehensive TypeScript schema types (Json, Database, Defaults) and generic utilities to derive Row, Insert, Update, Enum, and CompositeType shapes across schemas; exported readonly constants for enums.
    • Improved generated function argument/return typing for clearer, consistent signatures.
  • Tests

    • Added end-to-end tests validating TypeScript code generation for tables, functions (including zero-arg and single-unnamed-arg cases), and generated type shapes.

Walkthrough

This PR adds a new strongly-typed TypeScript schema module (exports: Json, Database, DatabaseWithoutInternals, DefaultSchema, Tables, TablesInsert, TablesUpdate, Enums, CompositeTypes, and Constants) and updates the TypeScript template generator to: represent zero-argument function Args as Record<PropertyKey, never> and simplify single-unnamed-arg handling when relation types exist. It also adds a Vitest that builds full GeneratorMetadata, invokes the template apply, writes repro_output.txt, and asserts presence/shape of generated table rows and function signatures.

Assessment against linked issues

Objective Addressed Explanation
Use Record<PropertyKey, never> instead of never for zero-arg function Args [#1035] Template generator now emits Record<PropertyKey, never> for zero-arg functions.
Include functions with single unnamed table/view parameters in filtering logic [#1035] Single-unnamed-arg handling was simplified to detect relation types via relationTypeByIds.
Add scalar computed fields to Row types [#1035] Generated Row shapes include computed fields (tested via the new Vitest).

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

@prem-2006 prem-2006 closed this Feb 18, 2026
@prem-2006 prem-2006 reopened this Feb 19, 2026
@prem-2006
Copy link
Copy Markdown
Author

Hi @avallete I think this code solves the issue ##1035 can you review it once and confirm if it needs any changes??

@avallete
Copy link
Copy Markdown
Member

As I answered already on this PR: #1035

This needs proper testing with the postgrest-js inference, until we have a better testing pipelines, we won't merge types changes contribution as they might easily create breaking changes to end users.

Once we have a better pipeline for testing between postgres-meta / postgrest-js we'll revisit.

Thank's for your contribution.

@avallete avallete closed this Feb 24, 2026
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.

2 participants