new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Drizzle ORM · all subjects

postgresql/setup

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

PostgreSQL Docker setup prerequisites

Docker Desktop must be installed and running before setting up PostgreSQL locally.

Pull PostgreSQL image from Docker Hub

Run `docker pull postgres` to pull the latest PostgreSQL image from Docker Hub. To pull a specific version, use `docker pull postgres:15` where 15 is the version tag.

Start PostgreSQL Docker container

Run `docker run --name drizzle-postgres -e POSTGRES_PASSWORD=mypassword -d -p 5432:5432 postgres` to start a PostgreSQL container. The `--name` option assigns the container name. The `-e POSTGRES_PASSWORD=` sets the password. The `-d` flag runs in detached mode. The `-p 5432:5432` maps the container port 5432 to host port 5432.

PostgreSQL Docker environment variables

The `-e POSTGRES_USER=` option sets the POSTGRES_USER environment variable; defaults to `postgres` if empty. The `-e POSTGRES_DB=` option sets the POSTGRES_DB environment variable; defaults to the POSTGRES_USER value if empty.

PostgreSQL database URL format

The database URL format for PostgreSQL is `postgres://<user>:<pa••••••d>@<host>:<port>/<database>`. For a Docker container started with the default settings and password 'mypassword', the URL would be `postgres://postgres:myp••••••rd@localhost:5432/postgres`.

Check PostgreSQL container status

Run `docker ps` to verify if the PostgreSQL container is running. The output shows the container ID, image, creation time, status, port mappings, and container name.

Give your agent this brain