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

Export more postgrest-js types #1316

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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

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