Skip to content
GitHubXDiscordRSS

Project

Learn how to create and manage Prisma Postgres projects using Alchemy.

The Project resource lets you create and manage Prisma Postgres projects, which serve as containers for your databases and their configurations. Projects belong to a workspace and can contain multiple databases.

Create a basic project with default settings:

import { Project } from "alchemy/prisma-postgres";
const project = await Project("my-app");
console.log(`Project ID: ${project.id}`);
console.log(`Project Name: ${project.name}`);
console.log(`Workspace: ${project.workspace.name}`);

By default, projects are not deleted when the Alchemy resource is destroyed in order to prevent accidental data loss. Enable deletion if you want the project to be removed:

import { Project } from "alchemy/prisma-postgres";
const ephemeralProject = await Project("test-project", {
name: "test-project",
delete: true
});

Create a project and add databases to it:

import { Project, Database } from "alchemy/prisma-postgres";
const project = await Project("my-app", {
name: "my-app"
});
const productionDb = await Database("production", {
project: project,
region: "us-east-1"
});
console.log(`Production DB: ${productionDb.name}`);
  • Database - Create databases within a project
  • Connection - Create connection strings for databases
  • Workspace - Learn about Prisma workspaces