how do I run postgres locally?

I copied this hono/bun/postgres/drizzle template locally https://railway.app/template/hIiRi5 and renamed and cloned the repo locally. How do I run the db migrations/seeding locally using railway up commands?

railway up bun run db:generate does not work but if I copy the public db url to a .env file, I'm able to connect to the db via my CLI.

0 Replies

projectID: a2ca1487-d15e-47b9-9817-8cf2ec0824f7


a year ago

you have to use railway run not railway up, railway up deploys

For example
railway run npm start


yep still running into an error.

railway run bun run dev
$ bun run --watch src/index.ts
Started server http://localhost:3000
40 |     res = resolve
41 |     rej = reject
42 |   }).catch((err) => {
43 |     // replace the stack trace that leads to `TCP.onStreamRead` with one that leads back to the
44 |     // application that created the query
45 |     Error.captureStackTrace(err)
               ^
ECONNREFUSED: Failed to connect
   errno: 8
 syscall: "connect"

      at /Users/artivilla/Documents/figma-extensions/print-shop-server/node_modules/pg-pool/index.js:45:11
      at processTicksAndRejections (native:1:1)

im 'not sure how to make my server service connect to the db service.


if the server is running locally i can still make it point to the same public postgres db yeah?


a year ago

you would indeed need to use the public database URL when developing locally


so my guess is you have to create a .env file and set to DATABASEURL manually to DATABASEPUBLIC_URL. you can't do railway run here


a year ago

correct


ty! getting a hang of this thing. already getting my friends on it.


a year ago

love to hear that!


Loading...