-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
34 lines (18 loc) · 1.06 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { createClient } from '@supabase/supabase-js';
import type { Database } from './database.types';
const supabase = createClient<Database>('url', 'key');
// works as expected (array)
const test1 = await supabase.from('posts').select('*, comments(*)');
// works as expected (array)
const test2 = await supabase.from('users').select('*, posts(*)');
// DOES NOT WORK, is empty array
const test5 = await supabase.from('posts').select('*, user:user_id(*)')
// DOES NOT WORK, is possibly null
const test6 = await supabase.from('posts').select('*, user:users(*)');
// DOES NOT WORK, is array instead of single
const test7 = await supabase.from('posts').select('*, user:users!user_id(*)');
// DOES NOT WORK, is array instead of single
const test8 = await supabase.from('posts').select('*, user:users!inner(*)');
const test9 = await supabase.from('posts').select('*, user:user_id!inner(*)')
const test10 = await supabase.from('user_projects').select("id, project:projects!inner(*)");
const test11 = await supabase.from('projects').select('id, user_projects!inner(*)');