Would you like to use TypeScript with this project? … No Would you like to use ESLint with this project? … No Would you like to use Tailwind CSS with this project? … Yes Would you like to use src/ directory with this project? … No Use App Router (recommended)? … Yes Would you like to customize the default import alias? … No 【Supabase×React】サーバレスアプリ開発入門 11
ック 以下の内容を貼り付けてRUNをクリック create table todos ( id bigint generated by default as identity primary key, user_id uuid references auth.users not null, task text not null, is_complete boolean default false, inserted_at timestamp with time zone default timezone('utc'::text, now()) not null ); 【Supabase×React】サーバレスアプリ開発入門 17
create policy "Individuals can view their own todos." on todos for select using ( auth.uid() = user_id ); データ取得(slect)の度に、次のように変換される select * from todos where auth.uid() = todos.user_id; -- Policy is implicitly added. 【Supabase×React】サーバレスアプリ開発入門 35
挿入(insert)、更新(update)、削除 (delete)についてはSQL Editorから同様 に作成する 以下の内容を貼り付けてRUNをクリック create policy "Individuals can create todos." on todos for insert with check (auth.uid() = user_id); create policy "Individuals can update their own todos." on todos for update using (auth.uid() = user_id); create policy "Individuals can delete their own todos." on todos for delete using (auth.uid() = user_id); 【Supabase×React】サーバレスアプリ開発入門 44