- Download and install pgAdmin
- Get your Supabase connection settings from the database settings page.
In pgAdmin:
- Right click the schema and choose 'CREATE script' to script the schema
- Right click the schema and choose 'BACKUP...' to script the tables
- For filename put in a FULL path ("C:/users/name/Downloads/export.sql")
- For Format choose 'Plain'
- In the 'Data Options' tab choose 'Only Schemas'
- In the 'Objects' tab select the object you want to export
Another option could be to use a Python script like the db-schema-extractor, which makes extraction a single command:
# Extract schema and save to output directory
python db_schema_extractor.py -c configs/my-database.ini -o output/my-schema.txt