Skip to content

Configuring User Synchronizable Database

Bagus Nur Listiyono edited this page Oct 20, 2024 · 1 revision
  1. Create account in Turso https://app.turso.tech/
  2. Create database group, name it how you like.

Fly.io is the most free one available, so we'd recommend choosing that.

Also select the database location to wherever closest to you for the best connection latency.

image

  1. Create database

Name it however you like and pick the group you just made in the earlier step

Do NOT enable "Schema Only"

image

  1. Copy the database URL by clicking on it. Paste it on the database URL field in Collapse settings

Do not worry about the URL protocol automatically changed from libsql:// to https://. It is done automatically by Collapse due to limitation in the library we used to connect to the database

image

  1. Press the three dots menu next to the database you created, then press Create Token

Set the expiration to No expiration and the access to be Read & Write

Note that sharing Database URL and its token to anyone else will give them FULL access to the database, including modifying and deleting your entire database. Be careful with it.

image

Paste the created token into Collapse setting field

  1. Create User ID

This user ID field is primarily used for those who wants to share their database with someone else but still have the data separated.

You can use any string combination or press the Generate UID to automatically generate it for you.

Do not ever lose this ID as you will not be able to access your data again without complicated database table moving.

  1. Validate the Settings

By pressing Validate and Save button, Collapse will try to verify the connection to the database and see if everything is good. If there is an error, it will be shown in a pop-up dialog and the settings won't be saved.