Skip to content

Commit

Permalink
chore: add test for selecting on an rpc call
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Oct 16, 2024
1 parent 05419fb commit e7b35e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/select-query-parser/rpc.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ import { TypeEqual } from 'ts-expect'
let expected: Database['public']['Functions']['get_username_and_status']['Returns'][number]
expectType<TypeEqual<typeof result, typeof expected>>(true)
}

// select on an rpc call
{
const { data, error } = await postgrest.rpc('get_username_and_status').select('username')
if (error) throw error
expectType<{ username: string }[]>(data)
}

0 comments on commit e7b35e9

Please sign in to comment.