© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
14 replies
Nisthar

How do you use the types mentioned in the docs?

import supabase from '~/lib/supabase'
import type { Database } from '~/lib/database.types'

async function getMovies() {
  return await supabase.from('movies').select('id, title, actors(*)')
}

type Actors = Database['public']['Tables']['actors']['Row']
type MoviesResponse = Awaited<ReturnType<typeof getMovies>>
type MoviesResponseSuccess = MoviesResponse['data'] & {
  actors: Actors[]
}
import supabase from '~/lib/supabase'
import type { Database } from '~/lib/database.types'

async function getMovies() {
  return await supabase.from('movies').select('id, title, actors(*)')
}

type Actors = Database['public']['Tables']['actors']['Row']
type MoviesResponse = Awaited<ReturnType<typeof getMovies>>
type MoviesResponseSuccess = MoviesResponse['data'] & {
  actors: Actors[]
}

How do you use this when calling the function?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,729Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How do you use the editor for the database functions?
SupabaseSSupabase / help-and-questions
4y ago
Cannot use the API docs page.
SupabaseSSupabase / help-and-questions
2mo ago
How do you use an Alias with JS select?
SupabaseSSupabase / help-and-questions
4y ago
Mistake In the offical docs
SupabaseSSupabase / help-and-questions
3y ago