Skip to content

Conversation

@maximilian-hammerl
Copy link
Contributor

What kind of change does this PR introduce?

Export more postgrest-js types

Additional context

If possible, we want to export some additional postgrest-js types, because

  1. we have to have postgrest-js as a dependency only because of the PostgrestBuilder, PostgrestQueryBuilder, ... types
  2. we have a compatibility problem between the PostgrestBuilder returned from our query and the PostgrestBuilder imported from postgrest-js:
Type 'import(".../node_modules/@supabase/supabase-js/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder").default<...' is not assignable to type 'import(".../node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder").default<...'.
Property 'method' is protected but type 'PostgrestBuilder<Result>' is not a class derived from 'PostgrestBuilder<Result>'.

Simple example:

import type { PostgrestBuilder } from '@supabase/postgrest-js'
import type { SupabaseClient } from '@supabase/supabase-js'
import type { Database } from './types.ts'

export function selectData(
  supabaseClient: SupabaseClient<Database>,
  id: string,
): PostgrestBuilder<SomeType> {
  return supabaseClient
    .from('some_table')
    .select('some_column')
    .eq('id', id)
    .single()
}

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11896082595

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 66.038%

Totals Coverage Status
Change from base Build 11589005961: 0.0%
Covered Lines: 99
Relevant Lines: 129

💛 - Coveralls

@maximilian-hammerl maximilian-hammerl closed this by deleting the head repository Jan 17, 2025
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