February 22, 2024

Introducing Platform Environments

🎉 We're thrilled to introduce Platform Environments and a new Early Access feature that enables accessing the Prisma Data Platform from the Prisma CLI!

Introducing Platform Environments

Design intuitive workflows with Platform Environments

Each Environment serves as an isolated space, enabling teams to build, test, and grow their projects across different stages of the development lifecycle. From initial experimentation to production, environments facilitate a seamless progression of application development.

Ever thought how seamless your development could be with dedicated environments for your Prisma Data Platform projects? You're in good company!

User requesting Environments

At Prisma, we're constantly striving to make your development journey smoother and more efficient. That's why we're excited to introduce Platform Environments 🎉.

So what’s changed?

Before Environments:

Before Environments

With Platform Environments, you can now create multiple environments within a single project, making it easier to manage various stages of your development lifecycle:

After Environments

This not only saves you time but also allows you to get more out of your existing projects. See the gains across all our plans:

PlanBefore Platform EnvironmentsWith Platform Environments
Starter5 projects5 projects, 2 environments per project
Pro10 projects10 projects, 6 environments per project
Business15 projects15 projects, 12 environments per project
EnterpriseCustomCustom

For more information on pricing, visit our pricing page.

Streamlining management of Prisma Data Platform projects from Prisma CLI ( Early Access )

We're also excited to announce that the Prisma Data Platform is now accessible through the Prisma CLI, available in Early Access, offering programmatic access for streamlined management of platform resources and improved workflow efficiency.

Prisma CLI x Prisma Data Platform

You can leverage the Prisma CLI to manage your databases for Prisma Accelerate and Prisma Pulse. e.g. This works really well with workflows using branch-based databases.

What is Database branching? Database branching lets you quickly create independent copies of your database for testing, development, data recovery, and other scenarios.

Some popular database providers that allow you to add database branching in your workflows are PlanetScale, Neon, and Railway:

Database branching

Now let’s look at a simple example below.

Enabling Prisma Accelerate for an environment using Prisma CLI

Let’s say you’re exploring caching to speed up your queries with Prisma Accelerate on a fresh feature branch. You want to ensure everything runs smoothly before rolling it out to production.

Let's explore how to activate Prisma Accelerate for an Environment and tidy up resources effortlessly, all using the Prisma CLI.

Pre-requisites

Before diving in, ensure that you’ve installed the Prisma Accelerate client extension on the feature branch and meet all the pre-requisites for using Prisma Accelerate. You also need to have Prisma CLI version 5.10.0 or later installed.

You should also have a .env containing the DATABASE_URL :

Access Prisma Data Platform

Let’s get started by authenticating into the Platform Console:

Note: The --early-access flag is essential until the feature is generally available.

A browser window should pop-up prompting you to log in or create an account. Once authenticated, you will be instructed to head back to the CLI:

Login pop-up

You can also check your login status by running:

And the CLI should output:

Managing workspaces

With authentication complete, retrieve your workspace information:

You will get a list of all your workspaces:

Let’s use the workspace id for test-workspace for the demo. Store the $TEST_WORKSPACE_ID for the next step.

Exploring projects

View all projects within a workspace:

The CLI will output the list of projects in the specified workspace ( test-workspace ):

Now let’s set up a temporary environment in the Gift shop project. Store the project id ($PROJECT_ID_5), as we’ll also need that when creating a new environment.

Creating environments

To create an environment to test Prisma Accelerate, run:

And we should have an output confirming the successfully creation of the environment:

Then copy the $ENVIRONMENT_ID, and then enable Prisma Accelerate for the TEST PRISMA ACCELERATE environment:

Setting the apikey to yes generates a new API key when Prisma Accelerate is enabled.

The output should provide us with a Prisma Accelerate connection string.

Testing Prisma Accelerate

Update the .env file with the Prisma Accelerate connection string:

And then run your project and it should be working as expected!

Cleaning up

Once testing is complete, let’s delete the TEST PRISMA ACCELERATE environment, as deleting the environment removes associated resources. To tidy up resources, all you have to do is run:

Mission accomplished ✅!

You can see that it was a breeze creating a new environment, enabling Prisma Accelerate and also cleaning up the resources.

Explore and share your feedback!

To explore the comprehensive command list of the latest Prisma CLI integration, please refer to our documentation available here.

Integrate the enhanced Prisma CLI into your workflow and share your experience with us via a tweet, and if you encounter any challenges, don't hesitate to reach out in our Discord and let us know!

Don’t miss the next post!

Sign up for the Prisma Newsletter