8000 CompositeTypes incorrectly handles unkown types. · Issue #478 · supabase/postgres-meta · GitHub
[go: up one dir, main page]

Skip to content

CompositeTypes incorrectly handles unkown types. #478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BarnabyShearer opened this issue Jan 20, 2023 · 0 comments
Closed

CompositeTypes incorrectly handles unkown types. #478

BarnabyShearer opened this issue Jan 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@BarnabyShearer
Copy link
BarnabyShearer commented Jan 20, 2023

Bug report

Describe the bug

We love the new CompositeTypes however if you have a property which is an unknown type it is output as unknown; rather then myfield: unknown;. I.e. it says the should be a property called "unknown" rater then typed as unknown.

To Reproduce

If you DB has something like:

CREATE TYPE public.example AS
(
    id text,
    foo text[]
);

And you generate types you get:

        CompositeTypes: {
            example: {
                id: string
                unknown
            };

Note I would also love a feature-request so that arrays preserve their type rather then being marked as unkown.

Expected behavior

A property with the correct name typed unknown; in-place of a property called "unknown" and implicitly typed any.

I believe the fix is to change line:

to return `${JSON.stringify(name)}: unknown`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet 3882
Development

No branches or pull requests

2 participants
0