Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: not working with local running postgres #1183

Open
princejoogie opened this issue Sep 13, 2024 · 1 comment
Open

bug: not working with local running postgres #1183

princejoogie opened this issue Sep 13, 2024 · 1 comment

Comments

@princejoogie
Copy link

princejoogie commented Sep 13, 2024

Provide environment information

System:
  OS: macOS 14.6.1
  CPU: (8) arm64 Apple M1
  Memory: 159.75 MB / 16.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 20.17.0 - ~/.local/state/fnm_multishells/28536_1726247644124/bin/node
  npm: 10.8.2 - ~/.local/state/fnm_multishells/28536_1726247644124/bin/npm
  pnpm: 9.7.1 - ~/.local/state/fnm_multishells/28536_1726247644124/bin/pnpm
  bun: 1.1.27 - /opt/homebrew/bin/bun

Describe the bug

I wanted to run a local db for development so I created a docker-compose.yml to quickly spin up a postgres instance

services:
  postgres:
    image: postgres
    container_name: bazaarkit
    environment:
      POSTGRES_DB: bazaar
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "2345:5432"

volumes:
  postgres_data:

then I have my .env point to this local db

POSTGRES_URL="postgres://postgres:postgres@localhost:2345/bazaar"

Link to reproduction

https://github.com/princejoogie/t3-turbo-local-postgres-reproduction

To reproduce

git clone https://github.com/princejoogie/t3-turbo-local-postgres-reproduction.git
pnpm i

cp .env.example .env # fill in discord oauth fields

docker compose up # run the local db
pnpm run db:push

pnpm run dev

Additional information

No response

@OopsOverflow
Copy link

I see that you are using @vercel/postgres which is not compatible with the regular postgres driver. You should replace that with a different client, say for example postgres.js.

After that you need to configure drizzle to use that client and you should be good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants