Skip to content
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

Missing CompositeTypes when generating locally #811

Closed
jason-yolabs opened this issue Oct 17, 2024 · 2 comments
Closed

Missing CompositeTypes when generating locally #811

jason-yolabs opened this issue Oct 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jason-yolabs
Copy link

jason-yolabs commented Oct 17, 2024

When I generate the types locally export type CompositeTypes is not included in the generated output. This is tripping me up because everything else is identical and I see it's in the expected template as of #798

supabase gen types typescript --local --schema public,graphql_public
export type Enums<
  PublicEnumNameOrOptions extends keyof PublicSchema['Enums'] | { schema: keyof Database },
  EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
    ? keyof Database[PublicEnumNameOrOptions['schema']]['Enums']
    : never = never,
> = PublicEnumNameOrOptions extends { schema: keyof Database }
  ? Database[PublicEnumNameOrOptions['schema']]['Enums'][EnumName]
  : PublicEnumNameOrOptions extends keyof PublicSchema['Enums']
    ? PublicSchema['Enums'][PublicEnumNameOrOptions]
    : never;

// EOF

When I generate the types remotely then I see export type CompositeTypes in the generated output.

supabase gen types typescript --project-id <id> --schema public,graphql_public
export type Enums<
  PublicEnumNameOrOptions extends keyof PublicSchema['Enums'] | { schema: keyof Database },
  EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
    ? keyof Database[PublicEnumNameOrOptions['schema']]['Enums']
    : never = never,
> = PublicEnumNameOrOptions extends { schema: keyof Database }
  ? Database[PublicEnumNameOrOptions['schema']]['Enums'][EnumName]
  : PublicEnumNameOrOptions extends keyof PublicSchema['Enums']
    ? PublicSchema['Enums'][PublicEnumNameOrOptions]
    : never;

export type CompositeTypes<
  PublicCompositeTypeNameOrOptions extends
    | keyof PublicSchema['CompositeTypes']
    | { schema: keyof Database },
  CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
    schema: keyof Database;
  }
    ? keyof Database[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes']
    : never = never,
> = PublicCompositeTypeNameOrOptions extends { schema: keyof Database }
  ? Database[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes'][CompositeTypeName]
  : PublicCompositeTypeNameOrOptions extends keyof PublicSchema['CompositeTypes']
    ? PublicSchema['CompositeTypes'][PublicCompositeTypeNameOrOptions]
    : never;
@jason-yolabs jason-yolabs added the bug Something isn't working label Oct 17, 2024
@jason-yolabs
Copy link
Author

I realized this is likely a matter of supbase-cli updating its reference to this projects latest version in docker compose. I'm going to close since this no longer feels like a bug in this package and instead is an upstream problem.

@soedirgo
Copy link
Member

@jason-yolabs thanks for reporting! This should resolve it I believe supabase/cli#2779

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
Development

No branches or pull requests

2 participants