Just a simple prompt aplication to test some functions of python and psychopg2
- Python 3.10
- Psychopg2 2.9.6
- PostgreSQL 15.3
- Docker 24.0.2
- Docker Compose 2.18.1
- Clone this repository
$ git clone [email protected]:davi-marangoni/prompt-diary.git
- Install the psycopg2 library
$ pip install psycopg2
- Install Docker and Docker Compose
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
$ sudo apt-get install docker-compose-plugin
- Create the docker.compose.yml file and run
version: '3'
services:
postgres:
image: postgres:latest
restart: always
ports:
- '5432:5432'
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
volumes:
- ./data:/var/lib/postgresql/data
$ docker compose up -d
- Create the database and table's
CREATE DATABASE diary;
CREATE TABLE public.events (
event_id serial4 NOT NULL,
event_description text NULL,
event_date timestamp NULL,
CONSTRAINT events_pkey PRIMARY KEY (event_id)
);