Launch your app with an injected DATABASE_URL

connect & shell

// what it does

Starts the tunnel, injects the resulting connection string into the child process's environment (as DATABASE_URL by default), runs your command, and tears the tunnel down when it exits. Your dev server gets a real branch connection with zero secrets committed anywhere.

// shell

$ pscale connect mydb dev-branch --execute 'pnpm dev'
$ pscale connect mydb dev-branch --execute 'npm start' --execute-protocol mysql

// gotcha

Rename the variable with --execute-env-url if your app expects something else, and set --execute-protocol (default mysql2, a Rails-ism) to match your driver — a Node app using mysql2 works out of the box, but Prisma wants mysql://.

// resources