This example provisions a Prisma Postgres project, database, and connection string using Alchemy.
-
Create a Prisma Postgres workspace service token.
-
Export the token before running the example:
export PRISMA_SERVICE_TOKEN="sk_..."
-
Choose an Alchemy state password and export it (used to encrypt secrets locally):
export ALCHEMY_PASSWORD="dev-password"
bun i
ALCHEMY_PASSWORD=${ALCHEMY_PASSWORD:-dev-password} bun run alchemy.run.tsThe script prints the generated database connection string to stdout.
To tear down the resources:
bun run destroy