/kaguya-database

Kaguya database (supabase) setup instruction.

Primary LanguagePLpgSQL

Setup

1. Create new project

Sign up Supabase, create a new project. Wait for your database is up running.

2. Create tables and functions

Go to SQL Editor in the left sidebar.

SQL Editor

Create a new query, paste in this schema and hit run.

New Query

This will create tables and functions that Kaguya needed for running.

3. Copy URL and Keys

Go to the Project Settings (the cog icon), open the API tab, and find your API URL and anon key. You will need these later.

URL and Keys

The anon key is your client-side key. Which anyone can use it to access your database, but will be restricted by row level security

The service_role key has full access your data, it will bypass all row level securities. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser.

Notes

Don't blame me if the structure is bad, I had no experience while making these structure, and it will take a lot of effort to change.

If you are an experience sql developer, feel free to contribute.

Thank you :)