How to upload data to Supabase using Postgres and Docker
Автор: communityDev
Загружено: 2026-02-22
Просмотров: 30
Описание:
Supabase is a postgres development platform, with very good options for user authentication, replacement for a backend, automated router documentation, and the framework I'm currently using for the Pokemon Trading Website.
In order to submit data to the database, we need to access it using docker. It works to our next tutorial , where we will install all necessary containers to create tables and submit data to our online Postgres database.
Install postgres
```
docker pull postgres:17
```
```
docker run --mount type=bind,src=C:/Users/Migue/Documents/community_dev/docker,dst=/root/data/projects/pokeTrade --name postgres-db-local -e POSTGRES_PASSWORD=dogsarecool -e POSTGRES_USER=miguel -e POSTGRES_DB=mydatabase -p 5434:5434 -d postgres:17
```
```
$env:PGSSLMODE="require" docker exec -it postgres-db-local psql -d postgres -h host -p 5432 -U username
```
host is in
connect button on top of supabase website
click on method
session pooler
view parameters
copy host and username
if you know your database password, then grab it
otherwise go to database - settings - reset password, and store it somewhere safe
\ - backlash
Error
```
At line:1 char:26
$env:PGSSLMODE="require" docker exec -it postgres-db-local psql ` -d ...
Unexpected token 'docker' in expression or statement.
CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
FullyQualifiedErrorId : UnexpectedToken
```
Solution - remove $env:PGSSLMODE="require"
CREATE TABLE card (
card_idUUID DEFAULT uuid_generate_v4() UNIQUE NOT NULL,
card_name text,
card_image,
card_local_id,
);
ALTER TABLE card ENABLE ROW LEVEL SECURITY;
make sure you have a cards.csv structured like this inside your directory
card_name,card_image,card_local_id
name1, image1,id1
name2,image2,id2
\copy set ("official_card_count","total_card_count","set_code","set_name") FROM 'root/data/projects/pokeTrade' WITH (FORMAT CSV, NULL 'NULL', HEADER);
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: