We use Prisma purely for the migration tools, but ...
# prisma-migrate
b
We use Prisma purely for the migration tools, but our stack is Golang. Currently we can't easily switch to using a scratch image (empty OS without any of the tools) because we need to install Node.js to execute
prisma migrate deploy
before the app starts up - is there a way to just grab the Rust binary directly and execute that?
y
an approach you can take is to have a container that runs before the application just for DB migration and potentially other pre tasks.. ie, in k8s there is the concept of [init containers](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) for this exact same purpose
j
Technically you could “grab the Rust binary directly and execute that” but you would be on your own here The best alternative at the moment I think, would be to use https://github.com/vercel/pkg So you can package the CLI as an executable:
Copy code
npx pkg node_modules/prisma -t node14-linux
./prisma --version
Though you have a good point here that it’s something that is not currently mentioned anywhere and I think creating a feature request for this would be amazing if you have a minute 😃
A more elaborate example here https://github.com/prisma/prisma-client-go/blob/main/binaries/publish.sh the Prisma Client Go project is not maintained anymore but used to package the CLI for this exact use case (Node.js not installed)
b
ah okay, these all seem a bit too over-engineered for our simple setup, we'll keep the Node process in our image for now
the Go support is the main reason we're likely going to drop Prisma, but we still use the migration tools as they're so good
👍🏾 1
👍 1