Skip to content

Add Prisma Postgres Actions for Database Provisioning, Management & Cleanup via Prisma Management API #18092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

nurul3101
Copy link

@nurul3101 nurul3101 commented Aug 18, 2025

Hi Pipedream team! 👋

I'm from the Prisma team. This PR adds actions that allows users to automate Prisma Postgres database provisioning, management, and cleanup directly within their Pipedream workflows.

Here are the actions:
Screenshot 2025-08-18 at 6 36 44 PM

All actions have been tested and documented following Pipedream's component guidelines.

Please let me know if any changes are needed from our end.

Thank you!

Summary by CodeRabbit

  • New Features
    • Added Prisma Management API integration with actions to:
      • Create/delete database projects
      • Create/delete/list database connection strings (including create connection string)
      • Create a database in an existing project
      • Create a standalone database/project
      • List databases in a project
      • Get project and database details
      • List workspace projects
      • Fetch available Prisma Postgres regions (dynamic region selector)
  • Documentation
    • New README with setup, API token auth, supported regions, action parameters, and example workflows
  • Chores
    • Added @pipedream/platform dependency

@adolfo-pd adolfo-pd added the User submitted Submitted by a user label Aug 18, 2025
Copy link

vercel bot commented Aug 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored Aug 19, 2025 9:01am

Copy link

vercel bot commented Aug 18, 2025

@nurul3101 is attempting to deploy a commit to the Pipedreamers Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Aug 18, 2025

Walkthrough

Adds a new Prisma Management API app client with authenticated HTTP helpers and dynamic region prop, a README, package dependency, and multiple new actions to create/list/get/delete projects, databases, and connection strings, plus a regions listing action.

Changes

Cohort / File(s) Summary
Documentation
components/prisma_management_api/README.md
New README describing the Prisma Management API integration, authentication, actions, parameters, example workflows, and links to docs.
Package Config
components/prisma_management_api/package.json
Adds dependency: @pipedream/platform ^1.5.1.
App Client Core
components/prisma_management_api/prisma_management_api.app.mjs
New app client: replaces authKeys with an axios-based HTTP client; adds _baseUrl, _makeRequest, dynamic propDefinitions.region (options from listRegions), and methods: createProject, deleteProject, listProjects, getProject, createDatabase, listDatabases, getDatabase, deleteDatabase, listConnectionStrings, createConnectionString, deleteConnectionString, listRegions. Removes authKeys().
Project Actions
components/prisma_management_api/actions/create-database/create-database.mjs, components/prisma_management_api/actions/delete-database/delete-database.mjs, components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs, components/prisma_management_api/actions/get-project-details/get-project-details.mjs
New actions to create a project+database, delete a project, list workspace projects, and get project details; each calls corresponding app methods, exports summaries, and returns API responses or success payloads.
Database Actions
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs, components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs, components/prisma_management_api/actions/get-database-details/get-database-details.mjs, components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs
New actions to create, list, get, and delete databases within projects; create-new-database validates region, build payload (including isDefault), calls app.createDatabase, and emits summaries; others call app methods and emit summaries or success payloads.
Connection String Actions
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs, components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs, components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs
New actions to create, list, and delete database connection strings; call app.createConnectionString/listConnectionStrings/deleteConnectionString, export count or success summaries, and return responses or success payloads.
Regions Action
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs
New action to list Prisma Postgres regions via app.listRegions and export a pluralized count summary.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as Pipedream Action
  participant App as Prisma Mgmt App Client
  participant API as Prisma Management API

  User->>Action: Provide inputs (e.g., projectId, region, databaseId)
  Action->>App: Call method (e.g., createDatabase, listProjects)
  App->>API: HTTPS request (Bearer token) via _makeRequest
  API-->>App: JSON / status
  App-->>Action: Response object
  Action-->>User: Summary + raw response

  rect rgba(180,235,180,0.15)
    note over App: _makeRequest centralizes auth and base URL
  end
Loading
sequenceDiagram
  autonumber
  actor User
  participant Action as Create New DB in Existing Project
  participant App as App.createDatabase
  participant API as POST /projects/{projectId}/databases

  User->>Action: projectId, region, isDefault?
  Action->>Action: Validate region (throws if missing)
  Action->>App: createDatabase({ projectId, data:{ region, default? } })
  App->>API: POST with Bearer token
  API-->>App: 201 Created (db id)
  App-->>Action: Response
  Action-->>User: $summary "Successfully created database..."
Loading
sequenceDiagram
  autonumber
  actor User
  participant Action as Connection String Actions
  participant App as App.*ConnectionString
  participant API as /databases/{id}/connections

  User->>Action: databaseId / connectionId
  alt Create
    Action->>App: createConnectionString({ databaseId, data:{ name } })
    App->>API: POST /databases/{id}/connections
  else List
    Action->>App: listConnectionStrings({ databaseId })
    App->>API: GET /databases/{id}/connections
  else Delete
    Action->>App: deleteConnectionString({ connectionId })
    App->>API: DELETE /connections/{connectionId}
  end
  API-->>App: JSON / null
  App-->>Action: Response
  Action-->>User: $summary + return
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I hopped through endpoints, swift and spry,
I fetched regions from the clouded sky.
Projects, DBs, and strings new-sown,
I left bright summaries when I hopped home.
A carrot cheer — integrations grown! 🥕

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ee8d69e and 8897867.

📒 Files selected for processing (1)
  • components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pipedream-component-development
Copy link
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development
Copy link
Collaborator

Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (33)
components/prisma_management_api/README.md (3)

25-31: Tighten wording and avoid hard-coding region list

Small grammar fix and suggest referencing the regions action instead of a static list to prevent drift.

-#### Create Postgres Database
-Creates a new Postgres database project via Prisma Management API. This action creates a complete project with database and provides connection string details in the response for immediate use.
+#### Create Postgres Database
+Creates a new Prisma Postgres project via the Management API. This creates a complete project with a database and provides connection-string details in the response for immediate use.
@@
-**Available regions:** us-east-1, us-west-1, eu-west-3, eu-central-1, ap-northeast-1, ap-southeast-1
+Tip: Regions evolve over time. Use the "Get Prisma Postgres Regions" action at runtime to retrieve the latest supported regions.

104-111: Align terminology: “Service Token” vs “API Token” and add minor punctuation

Use a single term throughout (Prisma docs use “Service Token”) and add periods for readability.

-This integration uses API Token authentication. You'll need to provide your Prisma Management API Service token when configuring the connection in Pipedream.
+This integration uses Service Token authentication. You'll need to provide your Prisma Management API service token when configuring the connection in Pipedream.
@@
-To obtain your API token:
-1. Log in to your Prisma account
-2. Navigate to your workspace settings
-3. Generate a new Service Token 
-4. Copy the token for use in Pipedream
+To obtain your service token:
+1. Log in to your Prisma account.
+2. Navigate to your workspace settings.
+3. Generate a new service token.
+4. Copy the token for use in Pipedream.

118-126: Minor copy edits in Example Workflows

Add punctuation and consistent phrasing.

-Trigger a workflow when a new project is created in your system, automatically provision a Prisma Postgres database, and store the connection details in your configuration management system.
+Trigger a workflow when a new project is created in your system, automatically provision a Prisma Postgres database, and store the connection details in your configuration management system.
@@
-Schedule periodic cleanup of unused databases and connection strings to maintain security and reduce costs.
+Schedule periodic cleanup of unused databases and connection strings to maintain security and reduce costs.
@@
-Create databases across multiple regions for improved performance and redundancy based on your application's geographic distribution.
+Create databases across multiple regions for improved performance and redundancy, based on your application's geographic distribution.
components/prisma_management_api/prisma_management_api.app.mjs (3)

12-21: Avoid defaulting $ to this in _makeRequest

Defaulting $ to this is unconventional and could produce confusing logs/metrics. Prefer requiring $ explicitly; callers already pass it.

-    _makeRequest({
-      $ = this, path, ...args
-    }) {
-      return axios($, {
-        url: `${this._baseUrl()}${path}`,
+    _makeRequest({
+      $, path, ...args
+    }) {
+      return axios($, {
+        url: `${this._baseUrl()}${path}`,
         headers: {
           Authorization: `Bearer ${this.$auth.api_token}`,
           "Content-Type": "application/json",
         },
         ...args,
       });
     },

23-125: URL-encode path parameters to guard against unsafe characters

Defensive encoding prevents accidental breakage if IDs ever contain reserved URL characters.

     _baseUrl() {
       return "https://api.prisma.io/v1";
     },
+    _segment(v) {
+      return encodeURIComponent(String(v));
+    },
@@
     async deleteProject({
       projectId, ...args
     }) {
       return this._makeRequest({
-        path: `/projects/${projectId}`,
+        path: `/projects/${this._segment(projectId)}`,
         method: "delete",
         ...args,
       });
     },
@@
     async getProject({
       projectId, ...args
     }) {
       return this._makeRequest({
-        path: `/projects/${projectId}`,
+        path: `/projects/${this._segment(projectId)}`,
         method: "get",
         ...args,
       });
     },
@@
     async createDatabase({
       projectId, ...args
     }) {
       return this._makeRequest({
-        path: `/projects/${projectId}/databases`,
+        path: `/projects/${this._segment(projectId)}/databases`,
         method: "post",
         ...args,
       });
     },
@@
     async listDatabases({
       projectId, ...args
     }) {
       return this._makeRequest({
-        path: `/projects/${projectId}/databases`,
+        path: `/projects/${this._segment(projectId)}/databases`,
         method: "get",
         ...args,
       });
     },
@@
     async getDatabase({
       databaseId, ...args
     }) {
       return this._makeRequest({
-        path: `/databases/${databaseId}`,
+        path: `/databases/${this._segment(databaseId)}`,
         method: "get",
         ...args,
       });
     },
@@
     async deleteDatabase({
       databaseId, ...args
     }) {
       return this._makeRequest({
-        path: `/databases/${databaseId}`,
+        path: `/databases/${this._segment(databaseId)}`,
         method: "delete",
         ...args,
       });
     },
@@
     async listConnectionStrings({
       databaseId, ...args
     }) {
       return this._makeRequest({
-        path: `/databases/${databaseId}/connections`,
+        path: `/databases/${this._segment(databaseId)}/connections`,
         method: "get",
         ...args,
       });
     },
@@
     async createConnectionString({
       databaseId, data, ...args
     }) {
       return this._makeRequest({
-        path: `/databases/${databaseId}/connections`,
+        path: `/databases/${this._segment(databaseId)}/connections`,
         method: "post",
         data: data || {},
         ...args,
       });
     },
@@
     async deleteConnectionString({
       connectionId, ...args
     }) {
       return this._makeRequest({
-        path: `/connections/${connectionId}`,
+        path: `/connections/${this._segment(connectionId)}`,
         method: "delete",
         ...args,
       });
     },

6-6: Optional: centralize common propDefinitions for reuse across actions

To reduce duplication and ensure consistent labels/descriptions across actions, consider defining shared props on the app for projectId, databaseId, and connectionId, then reference them in actions via props: { projectId: app.propDefinitions.projectId, ... }.

Example addition to prisma_management_api.app.mjs (outside current changed lines):

propDefinitions: {
  projectId: {
    type: "string",
    label: "Project ID",
    description: "The Prisma project ID.",
  },
  databaseId: {
    type: "string",
    label: "Database ID",
    description: "The Prisma Postgres database ID.",
  },
  connectionId: {
    type: "string",
    label: "Connection ID",
    description: "The connection string ID.",
  },
},
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)

17-23: Be resilient to response shape and return the payload, not the raw response

APIs sometimes return arrays directly or nest them (e.g., { regions: [] }). Compute the list defensively and return it to keep step output clean.

-    if (response) {
-      const count = response.data?.length || 0;
-      $.export("$summary", `Successfully retrieved ${count} available Postgres region${count !== 1 ? "s" : ""}`);
-    }
-
-    return response;
+    if (response) {
+      const items = Array.isArray(response.data)
+        ? response.data
+        : (response.data?.regions || []);
+      const count = Array.isArray(items) ? items.length : 0;
+      $.export("$summary", `Successfully retrieved ${count} available Postgres region${count !== 1 ? "s" : ""}`);
+      return items;
+    }
+    return response;
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (2)

4-8: Polish name/description for consistency and clarity

Title-case “Details” and tighten the description.

-  name: "Get Database details",
+  name: "Get Database Details",
@@
-  description: "Get database details of a particular Prisma Postgres database via Prisma Management API. [See docs here](https://www.prisma.io/docs/postgres/introduction/management-api)",
+  description: "Retrieve details for a Prisma Postgres database via the Prisma Management API. [See docs here](https://www.prisma.io/docs/postgres/introduction/management-api)",

23-28: Return response payload instead of the entire HTTP response

Returning response.data keeps step output clean and consistent.

-    return response;
+    return response?.data ?? response;
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (2)

23-25: Export summary unconditionally after a successful await.

If the HTTP client throws on non-2xx, this code path won’t run anyway. The extra condition can hide success summaries if the client returns undefined for 204 responses. Simplify by exporting the summary after the await.

Apply this diff:

-    if (response || response === null) {
-      $.export("$summary", `Successfully deleted database with ID ${this.databaseId}`);
-    }
+    $.export("$summary", `Successfully deleted database with ID ${this.databaseId}`);

27-31: Consider standardizing return shapes across actions.

Some actions return the raw API response, others return a { success, id, message } object. Standardizing improves DX for workflows that chain multiple actions.

components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)

7-7: Description claims pagination support but no pagination is exposed.

Currently there are no pagination props or logic passed to listProjects. Either add pagination props (e.g., cursor/page, limit) and wire them through, or adjust the description to avoid implying pagination.

Apply this minimal description fix if you prefer not to add props now:

-  description: "List Projects in a Prisma Workspace via Prisma Management API. Supports pagination for large result sets. [See docs here](https://www.prisma.io/docs/postgres/introduction/management-api)",
+  description: "List Projects in a Prisma Workspace via Prisma Management API. [See docs here](https://www.prisma.io/docs/postgres/introduction/management-api)",
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (2)

23-25: Export summary unconditionally after a successful await.

Same reasoning as other delete actions: if the API call fails it will throw. Exporting the summary unconditionally avoids edge cases where clients return undefined for 204 responses.

Apply this diff:

-    if (response || response === null) {
-      $.export("$summary", `Successfully deleted database connection with ID ${this.connectionId}`);
-    }
+    $.export("$summary", `Successfully deleted database connection with ID ${this.connectionId}`);

27-31: Tighten message wording to “connection string” for clarity.

Minor copy nit to match the action name and avoid ambiguity with other connection objects.

Apply this diff:

-      message: "Database connection deleted successfully",
+      message: "Database connection string deleted successfully",
components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (2)

20-29: Consider dynamic region options sourced from the API.

Hardcoding regions can drift from reality. Prefer populating options from listRegions to ensure accuracy and better UX.

Two approaches:

  • Define a propDefinition in the app with dynamic options and reference it here.
  • Or implement a dynamic options function that queries this.app.listRegions and returns { label, value } pairs.

Happy to provide a concrete snippet if you share the app’s propDefinition patterns.


55-56: Align return shape with other actions for consistency.

This action returns the raw response, while delete actions return a { success, id, message } object. Consider standardizing across the suite (either always raw response or always a normalized object plus raw under a key).

components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (2)

23-25: Export summary unconditionally after a successful await.

Mirror the simplification suggested for the other delete actions to avoid missing summaries on 204/empty responses.

Apply this diff:

-    if (response || response === null) {
-      $.export("$summary", `Successfully deleted Postgres database project with ID ${this.projectId}`);
-    }
+    $.export("$summary", `Successfully deleted Postgres database project with ID ${this.projectId}`);

11-15: Optional: Provide dynamic options for selecting a project.

To reduce copy/paste of IDs, consider a dynamic options prop that lists projects (via listProjects) so users can pick a project by name in the UI.

components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)

11-16: Consider dynamic projectId via propDefinition for UX

Leverage a propDefinition (backed by listProjects) so users can pick a project from a dropdown instead of pasting IDs.

Apply this diff if projectId propDefinition exists in the app:

-    projectId: {
-      type: "string",
-      label: "Project ID",
-      description: "The ID of the project to list databases from",
-    },
+    projectId: {
+      propDefinition: [app, "projectId"],
+      description: "Select the project to list databases from",
+    },

If you don't have it yet, add to prisma_management_api.app.mjs:

// Inside export default { ... app ... }
propDefinitions: {
  projectId: {
    type: "string",
    label: "Project",
    description: "Select a Prisma project",
    async options({ $ }) {
      const res = await this.listProjects({ $ });
      const items = res?.data ?? [];
      return items.map((p) => ({ label: `${p.name} (${p.id})`, value: p.id }));
    },
  },
},

23-26: Make summary resilient to varied response shapes

If your app client ever returns arrays at the top level (vs under data), count can be wrong.

Apply:

-      const count = response.data?.length || 0;
+      const items = Array.isArray(response?.data) ? response.data : (Array.isArray(response) ? response : []);
+      const count = items.length;
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (3)

11-16: Enable databaseId selection via propDefinition

Improve DX by letting users select a database from a list (backed by listDatabases).

-    databaseId: {
-      type: "string",
-      label: "Database ID",
-      description: "The ID of the database to create a connection string for",
-    },
+    databaseId: {
+      propDefinition: [app, "databaseId"],
+      description: "Select the database to create a connection string for",
+    },

Add to prisma_management_api.app.mjs if missing:

propDefinitions: {
  // ...projectId as shown earlier...
  databaseId: {
    type: "string",
    label: "Database",
    description: "Select a database within a project",
    async options({ $ }) {
      // Optionally gate by selected projectId from other props
      // e.g. const { projectId } = this;
      // const res = await this.listDatabases({ $, projectId });
      // If no projectId context, fetch recently used or all (if API supports).
      return [];
    },
  },
},

31-33: Use robust ID fallback in summary

The ID may come as response.id or response.data.id depending on the app client shape.

-      $.export("$summary", `Successfully created connection string for database ${this.databaseId}${response.id ? ` with connection ID ${response.id}` : ""}`);
+      const id = response?.id ?? response?.data?.id;
+      $.export("$summary", `Successfully created connection string for database ${this.databaseId}${id ? ` with connection ID ${id}` : ""}`);

35-36: Be mindful of returning secrets in step output

Creating a connection string may return the raw DSN with credentials. Returning the full response is often desired, but it can expose secrets in step results. Consider a boolean prop to control whether to return the raw string or to return only metadata by default.

I can draft a small change to add a returnConnectionString boolean (default false) and conditionally filter the returned payload.

components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (3)

11-15: Tighten copy and enable dynamic selection

  • Wording: use “connection strings” for clarity.
  • Prefer propDefinition for databaseId to enable dropdown selection.
-    databaseId: {
-      type: "string",
-      label: "Database ID",
-      description: "The ID of the database to list connections for",
-    },
+    databaseId: {
+      propDefinition: [app, "databaseId"],
+      description: "The database to list connection strings for",
+    },

23-26: Defensive count calc across response shapes

Mirror the pattern suggested in the other list action for resilience.

-      const count = response.data?.length || 0;
+      const items = Array.isArray(response?.data) ? response.data : (Array.isArray(response) ? response : []);
+      const count = items.length;

17-21: Implement pagination for listConnectionStrings

The listConnectionStrings helper in
components/prisma_management_api/prisma_management_api.app.mjs (around lines 91–94)
currently just calls _makeRequest with no loop over a nextLink, so it will only return the first page of results. Likewise, the action in
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (lines 17–21)
simply forwards that call, without handling pagination.

Please update the wrapper (or the action) to:

  • Detect and follow a nextLink (or equivalent pagination token) in the response, aggregating all pages before returning.
  • Or expose standard paging controls (e.g., top, skipToken) so callers can request subsequent pages as needed.
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (3)

4-4: Title case the action name for consistency

Minor naming nit.

-  name: "Get Project details",
+  name: "Get Project Details",

11-16: Use propDefinition for project selection

Improves UX by letting users select a project from a list.

-    projectId: {
-      type: "string",
-      label: "Project ID",
-      description: "The ID of the project to retrieve information for",
-    },
+    projectId: {
+      propDefinition: [app, "projectId"],
+      description: "Select the project to retrieve information for",
+    },

23-25: Enrich summary with project name when available

Small UX win.

-      $.export("$summary", `Successfully retrieved project information for ID ${this.projectId}`);
+      const name = response?.name ?? response?.data?.name;
+      $.export("$summary", `Successfully retrieved project ${name ? `"${name}"` : `ID ${this.projectId}`}`);
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (4)

10-16: Adopt propDefinition for projectId

Facilitates selection from workspace projects.

-    projectId: {
-      type: "string",
-      label: "Project ID",
-      description: "The ID of the project where the database should be created",
-    },
+    projectId: {
+      propDefinition: [app, "projectId"],
+      description: "Select the project where the database should be created",
+    },

16-29: Prefer dynamic region options from API instead of hardcoding

Regions can change; fetch dynamically via listRegions. If you have a region propDefinition in the app, use that; otherwise add an async options function.

Option A (propDefinition):

-    region: {
-      type: "string",
-      label: "Region",
-      description: "The AWS region where the database should be created",
-      options: [
-        "us-east-1",
-        "us-west-1",
-        "eu-west-3",
-        "eu-central-1",
-        "ap-northeast-1",
-        "ap-southeast-1",
-      ],
-      optional: true,
-    },
+    region: {
+      propDefinition: [app, "region"],
+      optional: true,
+      description: "Select the region for the new database",
+    },

Add to prisma_management_api.app.mjs if missing:

propDefinitions: {
  // ...
  region: {
    type: "string",
    label: "Region",
    description: "Select a Prisma Postgres region",
    async options({ $ }) {
      const res = await this.listRegions({ $ });
      const items = res?.data ?? [];
      return items.map((r) => ({ label: `${r.name} (${r.id})`, value: r.id }));
    },
  },
},

Option B (inline async options if you prefer not to touch the app yet):

-    region: {
-      type: "string",
-      label: "Region",
-      description: "The AWS region where the database should be created",
-      options: [
-        "us-east-1",
-        "us-west-1",
-        "eu-west-3",
-        "eu-central-1",
-        "ap-northeast-1",
-        "ap-southeast-1",
-      ],
-      optional: true,
-    },
+    region: {
+      type: "string",
+      label: "Region",
+      description: "Select the region for the new database",
+      optional: true,
+      async options({ $ }) {
+        const res = await app.listRegions({ $ });
+        const items = res?.data ?? [];
+        return items.map((r) => ({ label: `${r.name} (${r.id})`, value: r.id }));
+      },
+    },

39-42: Slightly cleaner payload construction

Minor readability improvement using object spread.

-    const data = {};
-    if (this.region) data.region = this.region;
-    if (this.isDefault !== undefined) data.default = this.isDefault;
+    const data = {
+      ...(this.region && { region: this.region }),
+      ...(this.isDefault !== undefined && { default: this.isDefault }),
+    };

49-51: Use robust ID fallback in summary

Mirror the ID fallback used elsewhere.

-      $.export("$summary", `Successfully created database in project ${this.projectId}${response.id ? ` with ID ${response.id}` : ""}`);
+      const id = response?.id ?? response?.data?.id;
+      $.export("$summary", `Successfully created database in project ${this.projectId}${id ? ` with ID ${id}` : ""}`);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 84fa60f and c17df92.

📒 Files selected for processing (15)
  • components/prisma_management_api/README.md (1 hunks)
  • components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1 hunks)
  • components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1 hunks)
  • components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1 hunks)
  • components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1 hunks)
  • components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1 hunks)
  • components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1 hunks)
  • components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1 hunks)
  • components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1 hunks)
  • components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1 hunks)
  • components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1 hunks)
  • components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1 hunks)
  • components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1 hunks)
  • components/prisma_management_api/package.json (1 hunks)
  • components/prisma_management_api/prisma_management_api.app.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/prisma_management_api/package.json
🧬 Code Graph Analysis (13)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (10)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
  • response (23-29)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • response (43-47)
components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
  • response (32-38)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (11)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
  • response (23-29)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • response (43-47)
components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (4)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • response (43-47)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
  • response (18-21)
components/prisma_management_api/prisma_management_api.app.mjs (2)
components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (2)
  • projectId (41-41)
  • databaseId (42-42)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • data (39-39)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (11)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
  • response (23-29)
components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
  • response (32-38)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (11)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
  • response (23-29)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • response (43-47)
components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
  • response (32-38)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (2)
  • response (18-21)
  • count (24-24)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)
  • response (18-21)
  • count (24-24)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (2)
  • response (13-15)
  • count (18-18)
components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (9)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • response (43-47)
components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
  • response (32-38)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (4)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • response (43-47)
components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (8)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • response (43-47)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
  • response (32-38)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (2)
  • response (13-15)
  • count (18-18)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (2)
  • response (18-21)
  • count (24-24)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (2)
  • response (13-15)
  • count (18-18)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (11)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
  • response (23-29)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • response (43-47)
components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
  • response (32-38)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (2)
  • response (13-15)
  • count (18-18)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)
  • response (18-21)
  • count (24-24)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (2)
  • response (13-15)
  • count (18-18)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (5)
components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (5)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
  • response (23-29)
components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)
  • response (18-21)
  • count (24-24)
🪛 LanguageTool
components/prisma_management_api/README.md

[grammar] ~25-~25: There might be a mistake here.
Context: ... This action creates a complete project with database and provides connection string...

(QB_NEW_EN)


[grammar] ~33-~33: There might be a mistake here.
Context: ... #### List Projects in Prisma Workspace Retrieves all projects within your Prism...

(QB_NEW_EN)


[grammar] ~36-~36: There might be a mistake here.
Context: ...sma workspace. #### Get Project Details Retrieves detailed information about a s...

(QB_NEW_EN)


[grammar] ~42-~42: There might be a mistake here.
Context: ... retrieve #### Delete Postgres Database Removes an entire Postgres database proj...

(QB_NEW_EN)


[grammar] ~50-~50: There might be a mistake here.
Context: ... Create New Database in Existing Project Adds a new database to an existing Prism...

(QB_NEW_EN)


[grammar] ~58-~58: There might be a mistake here.
Context: ...roject #### List Databases from Project Retrieves all databases within a specifi...

(QB_NEW_EN)


[grammar] ~64-~64: There might be a mistake here.
Context: ...f the project #### Get Database Details Retrieves detailed information about a s...

(QB_NEW_EN)


[grammar] ~70-~70: There might be a mistake here.
Context: ...ase #### Delete Database by Database ID Removes a specific database by its ID. ...

(QB_NEW_EN)


[grammar] ~78-~78: There might be a mistake here.
Context: ... #### Create Database Connection String Generates a new connection string for da...

(QB_NEW_EN)


[grammar] ~85-~85: There might be a mistake here.
Context: ...n #### List Database Connection Strings Retrieves all connection strings for a s...

(QB_NEW_EN)


[grammar] ~91-~91: There might be a mistake here.
Context: ... #### Delete Database Connection String Removes a specific connection string. *...

(QB_NEW_EN)


[grammar] ~99-~99: There might be a mistake here.
Context: ...lities #### Get Prisma Postgres Regions Retrieves the list of available regions ...

(QB_NEW_EN)


[grammar] ~106-~106: There might be a mistake here.
Context: ...in Pipedream. To obtain your API token: 1. Log in to your Prisma account 2. Navigat...

(QB_NEW_EN)


[grammar] ~118-~118: There might be a mistake here.
Context: ...utomated Database Setup for New Projects Trigger a workflow when a new project is...

(QB_NEW_EN)


[grammar] ~121-~121: There might be a mistake here.
Context: ...system. ### Database Cleanup Automation Schedule periodic cleanup of unused data...

(QB_NEW_EN)


[grammar] ~124-~124: There might be a mistake here.
Context: ...s. ### Multi-Region Database Deployment Create databases across multiple regions...

(QB_NEW_EN)

🔇 Additional comments (15)
components/prisma_management_api/package.json (2)

15-17: Dependency addition looks good

Adding "@pipedream/platform": "^1.5.1" is appropriate for Pipedream actions, and you avoided adding Node built-ins as deps (per our past guidance). JSON structure is valid with the trailing comma after publishConfig.


15-17: Confirm Pipedream Platform Version Alignment

I scanned every package.json and found that:

  • components/prisma_management_api/package.json and the repo root use ^1.5.1
  • The majority of components have migrated to ^3.x
  • Several others are still on ^2.x, ^0.x or various patch versions

Such a spread of major versions can lead to subtle runtime and API differences. Please review whether this package should stay on v1, or be bumped to align with the current stable major across the repo—and then update its "@pipedream/platform" range accordingly.

components/prisma_management_api/README.md (1)

31-31: Region list verified
The explicit list in components/prisma_management_api/README.md (line 31) matches the Prisma Postgres regions documented as of August 18, 2025.

(Optional) For future-proofing, consider calling the Management API endpoint GET /regions/postgres to retrieve this list programmatically.

components/prisma_management_api/prisma_management_api.app.mjs (1)

8-11: Confirmed Prisma Management API Base URL

The base URL and version (https://api.prisma.io/v1) are correct for endpoints like /projects, /databases, /connections, and /regions/postgres. No changes required.

components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)

1-16: Solid action metadata and props.

Name, key, description, and props follow Pipedream conventions and clearly convey the destructive nature of the operation.

components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)

12-16: LGTM: clear run flow and concise summary.

The call to this.app.listProjects and the summary export are consistent with other actions. Returning the raw response is appropriate if callers need full metadata.

Also applies to: 22-23

components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (2)

3-16: Well-defined destructive action and props.

Naming, description, and the connectionId prop are clear and consistent with the rest of the suite.


17-21: Parameter name verified
The deleteConnectionString method in prisma_management_api.app.mjs is declared as:

async deleteConnectionString({ connectionId, ...args }) {  }

so passing connectionId: this.connectionId is correct. No changes needed.

components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)

40-53: Nice summary assembly with conditional IDs.

Building a clear $summary that includes discovered IDs is helpful for users scanning step results.

components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)

1-16: Clear destructive action with accurate labeling.

Action metadata, prop definition, and description align with the create/list/get counterparts.

components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)

3-16: Solid action scaffold and consistent metadata

Naming, key, description, and props structure align well with other actions in this suite.


17-21: Verify cursor-based pagination for listDatabases

I didn’t see any pagination logic in the listDatabases implementation—it simply forwards projectId (and any extra args) to _makeRequest. If the Management API paginates, this action will return only the first page. Please:

  • Confirm whether this.app.listDatabases supports pagination parameters (e.g. cursor, limit, page, etc.).
  • If it does, update the action to loop through all pages (e.g. calling listDatabases with the returned cursor until no more pages).
  • If it doesn’t paginate (all results are returned at once), add a note in the docs or code comment to affirm no pagination is needed.

Also applies to the similar calls in lines 28–29 of the same file.

components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)

3-21: Good, follows the established action pattern

Clear props and description; run implementation matches the app method contract used elsewhere.

components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)

3-16: Consistent list action implementation

Structure, metadata, and call pattern are consistent with the rest of the actions.

components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)

3-9: Well-structured action and clear description

The action follows the established pattern and is easy to follow.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🧹 Nitpick comments (15)
components/prisma_management_api/README.md (2)

99-101: Reference dynamic regions instead of listing them elsewhere

You already have a “Get Prisma Postgres Regions” utility. Consider adding a sentence here that these regions are fetched dynamically and may change, to avoid drift.

 #### Get Prisma Postgres Regions
-Retrieves the list of available regions for Prisma Postgres deployment.
+Retrieves the list of available regions for Prisma Postgres deployment. This list is dynamic and may change over time.

104-111: Minor authentication wording cleanup

Small grammar tweak and consistent capitalization.

-This integration uses API Token authentication. You'll need to provide your Prisma Management API Service token when configuring the connection in Pipedream.
+This integration uses API token authentication. You'll need to provide your Prisma Management API service token when configuring the connection in Pipedream.

-To obtain your API token:
-1. Log in to your Prisma account
-2. Navigate to your workspace settings
-3. Generate a new Service Token 
-4. Copy the token for use in Pipedream
+To obtain your API token:
+1. Log in to your Prisma account.
+2. Navigate to your workspace settings.
+3. Generate a new service token.
+4. Copy the token for use in Pipedream.
components/prisma_management_api/prisma_management_api.app.mjs (3)

11-21: Pass context into listRegions for consistency and better instrumentation

While _makeRequest defaults to this as context, it’s safer and more consistent to pass a context explicitly.

-      async options() {
-        const response = await this.listRegions();
+      async options() {
+        const response = await this.listRegions({ $: this });
         const regions = response?.data || [];
         return regions

24-38: Avoid default param referencing this in destructuring; refactor _makeRequest

Defaulting $ = this inside the parameter destructuring is brittle. Prefer extracting inside the function and computing a context variable. This also simplifies call sites.

-    _makeRequest({
-      $ = this, path, ...args
-    }) {
-      return axios($, {
+    _makeRequest(params = {}) {
+      const { $, path, ...args } = params;
+      const ctx = $ || this;
+      return axios(ctx, {
         url: `${this._baseUrl()}${path}`,
         headers: {
           Authorization: `Bearer ${this.$auth.api_token}`,
           "Content-Type": "application/json",
         },
         ...args,
       });
     },

39-141: Consider pagination helpers for list endpoints

listProjects, listDatabases, listConnectionStrings, and listRegions may return paginated results. If the API paginates, expose page/cursor props in actions and/or provide a helper to iterate pages.

I can add a generic paginate method and wire optional props (limit, cursor) into the list actions if the API supports them.

components/prisma_management_api/actions/create-database/create-database.mjs (1)

33-49: Expose IDs in the action output for easier downstream use

Returning only the raw response forces users to traverse nested data. Exporting the IDs alongside the response improves UX.

-    return response;
+    return {
+      projectId: response?.data?.id,
+      databaseId: response?.data?.database?.id,
+      raw: response,
+    };
components/prisma_management_api/actions/delete-database/delete-database.mjs (1)

23-31: Adjust summary and return message to reflect project deletion

Update wording to avoid referring to database deletion.

-      $.export("$summary", `Successfully deleted Postgres database project with ID ${this.projectId}`);
+      $.export("$summary", `Successfully deleted Prisma Postgres project with ID ${this.projectId}`);
-      message: "Database project deleted successfully",
+      message: "Project deleted successfully",
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)

23-26: Be defensive about response shape and consider pagination

If the API returns an object (e.g., { data: [...] } or { connections: [...] }), counting response.data?.length may be incorrect. Also, if the endpoint paginates, consider optional cursor/limit props.

-      const count = response.data?.length || 0;
-      $.export("$summary", `Successfully retrieved ${count} connection${count !== 1 ? "s" : ""} for database ${this.databaseId}`);
+      const connections =
+        Array.isArray(response?.data) ? response.data
+        : Array.isArray(response?.data?.connections) ? response.data.connections
+        : Array.isArray(response?.connections) ? response.connections
+        : [];
+      const count = connections.length;
+      $.export("$summary", `Successfully retrieved ${count} connection string${count !== 1 ? "s" : ""} for database ${this.databaseId}`);

I can also add optional props (cursor, limit) and wire them into the request if the API supports pagination.

components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (2)

27-27: Optionally return a stable shape with items + raw response

Returning a consistent { items, raw } payload can improve downstream ergonomics while preserving access to the original response.

Apply this diff if you want to return both:

-    return response;
+    return {
+      items,
+      raw: response,
+    };

17-25: Normalize count logic across Prisma Management API actions

Several actions still calculate their counts using response.data?.length || 0, which will undercount if the API returns the array directly. To keep them in line with list-projects-in-prisma-workspace, consider updating these actions to first normalize into an items array, then derive count:

• components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs
– Replace
js const count = response.data?.length || 0;
– With
js const items = Array.isArray(response) ? response : Array.isArray(response?.data) ? response.data : []; const count = items.length;

• components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs
– Same replacement at the count assignment (line 24).

• components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs
– Same replacement at the count assignment (line 18).

(Optional) You can also collapse into a one-liner:

const count = Array.isArray(response)
  ? response.length
  : Array.isArray(response?.data)
    ? response.data.length
    : 0;
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (2)

23-25: Export summary unconditionally after a successful call

If the API returns 204/empty body, response may be undefined, skipping the summary. Since the call didn’t throw, it’s a success—export the summary unconditionally.

Apply this diff:

-    if (response || response === null) {
-      $.export("$summary", `Successfully deleted database with ID ${this.databaseId}`);
-    }
+    $.export("$summary", `Successfully deleted database with ID ${this.databaseId}`);

27-31: Consider returning the API response for consistency

Most actions return the API response. Returning a custom object here is okay, but it’s inconsistent. If you want consistency, return response (falling back to a minimal success object on 204).

Apply this diff:

-    return {
-      success: true,
-      databaseId: this.databaseId,
-      message: "Database deleted successfully",
-    };
+    return response ?? { success: true, databaseId: this.databaseId };
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)

11-15: Optional UX Improvement: Add async project picker
To streamline the “Project ID” input and let users pick from existing projects, you can expose a projectId propDefinition that uses the existing listProjects method:

• In components/prisma_management_api/prisma_management_api.app.mjs, extend propDefinitions:

 propDefinitions: {
   region: {
     type: "string",
     label: "Region",
   },
+  projectId: {
+    type: "string",
+    label: "Project ID",
+    async options() {
+      const projects = await this.listProjects();
+      return projects.map(p => ({
+        label: p.name || p.id,
+        value: p.id,
+      }));
+    },
+  },
 },

• Then in your action (get-project-details.mjs), swap the manual field for a propDefinition reference:

- projectId: {
-   type: "string",
-   label: "Project ID",
-   description: "The ID of the project to retrieve information for",
- },
+ projectId: {
+   propDefinition: [ "app", "projectId" ],
+ },

This aligns with Pipedream’s patterns and lets users select a project by name.

components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (2)

11-15: Add async options for Project ID selection

The prisma_management_api.app.mjs defines a listProjects method and a propDefinitions section (which currently only includes region), but there’s no projectId propDefinition leveraging it. To improve UX and align with guidelines, add an async propDefinition for projectId that pulls its options from listProjects.

• File: components/prisma_management_api/prisma_management_api.app.mjs
– Inside the propDefinitions block alongside region, add:

   propDefinitions: {
     region: {
       type: "string",
       label: "Region",
       /* … */
     },
+    projectId: {
+      propDefinition: [this.app, "projectId"],
+    },
   },

This will enable the projectId field in your action to show a dropdown populated by listProjects.


31-33: Ensure region prop is required in the UI
The region prop uses a propDefinition but isn’t marked required, so users can still submit the form without selecting one. Add required: true in the action’s props:

// components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs
   region: {
     propDefinition: [app, "region"],
+    required: true,
   },

The runtime guard (if (!this.region)) is a good fallback, but marking the prop required prevents users from running the action without a region.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c17df92 and ee8d69e.

📒 Files selected for processing (14)
  • components/prisma_management_api/README.md (1 hunks)
  • components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1 hunks)
  • components/prisma_management_api/actions/create-database/create-database.mjs (1 hunks)
  • components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1 hunks)
  • components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1 hunks)
  • components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1 hunks)
  • components/prisma_management_api/actions/delete-database/delete-database.mjs (1 hunks)
  • components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1 hunks)
  • components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1 hunks)
  • components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1 hunks)
  • components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1 hunks)
  • components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1 hunks)
  • components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1 hunks)
  • components/prisma_management_api/prisma_management_api.app.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs
  • components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs
  • components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs
  • components/prisma_management_api/actions/get-database-details/get-database-details.mjs
  • components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs
🧰 Additional context used
🧬 Code Graph Analysis (7)
components/prisma_management_api/actions/delete-database/delete-database.mjs (10)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
  • response (23-29)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • response (40-44)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/create-database/create-database.mjs (12)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
  • response (23-29)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • response (40-44)
components/prisma_management_api/actions/delete-database/delete-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
  • response (13-15)
components/prisma_management_api/prisma_management_api.app.mjs (1)
  • response (12-12)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (11)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
  • response (23-29)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • response (40-44)
components/prisma_management_api/actions/create-database/create-database.mjs (1)
  • response (25-31)
components/prisma_management_api/actions/delete-database/delete-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
  • response (13-15)
components/prisma_management_api/prisma_management_api.app.mjs (1)
  • response (12-12)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (3)
components/prisma_management_api/actions/delete-database/delete-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/prisma_management_api.app.mjs (1)
  • response (12-12)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (8)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
  • response (23-29)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)
  • response (18-21)
  • count (24-24)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (2)
  • response (13-15)
  • count (23-23)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (2)
  • response (13-15)
  • count (18-18)
components/prisma_management_api/prisma_management_api.app.mjs (1)
  • response (12-12)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (12)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
  • response (23-29)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-database/create-database.mjs (1)
  • response (25-31)
components/prisma_management_api/actions/delete-database/delete-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
  • response (13-15)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
  • response (13-15)
components/prisma_management_api/prisma_management_api.app.mjs (1)
  • response (12-12)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (11)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
  • response (23-29)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
  • response (40-44)
components/prisma_management_api/actions/delete-database/delete-database.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
  • response (18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)
  • response (18-21)
  • count (24-24)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (2)
  • response (18-21)
  • count (24-24)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (2)
  • response (13-15)
  • count (18-18)
components/prisma_management_api/prisma_management_api.app.mjs (1)
  • response (12-12)
🪛 LanguageTool
components/prisma_management_api/README.md

[grammar] ~25-~25: There might be a mistake here.
Context: ... This action creates a complete project with database and provides connection string...

(QB_NEW_EN)


[grammar] ~33-~33: There might be a mistake here.
Context: ... #### List Projects in Prisma Workspace Retrieves all projects within your Prism...

(QB_NEW_EN)


[grammar] ~36-~36: There might be a mistake here.
Context: ...sma workspace. #### Get Project Details Retrieves detailed information about a s...

(QB_NEW_EN)


[grammar] ~42-~42: There might be a mistake here.
Context: ...roject to retrieve #### Delete Database Removes an entire Postgres database proj...

(QB_NEW_EN)


[grammar] ~50-~50: There might be a mistake here.
Context: ... Create New Database in Existing Project Adds a new database to an existing Prism...

(QB_NEW_EN)


[grammar] ~58-~58: There might be a mistake here.
Context: ...roject #### List Databases from Project Retrieves all databases within a specifi...

(QB_NEW_EN)


[grammar] ~64-~64: There might be a mistake here.
Context: ...f the project #### Get Database Details Retrieves detailed information about a s...

(QB_NEW_EN)


[grammar] ~70-~70: There might be a mistake here.
Context: ...ase #### Delete Database by Database ID Removes a specific database by its ID. ...

(QB_NEW_EN)


[grammar] ~78-~78: There might be a mistake here.
Context: ... #### Create Database Connection String Generates a new connection string for da...

(QB_NEW_EN)


[grammar] ~85-~85: There might be a mistake here.
Context: ...n #### List Database Connection Strings Retrieves all connection strings for a s...

(QB_NEW_EN)


[grammar] ~91-~91: There might be a mistake here.
Context: ... #### Delete Database Connection String Removes a specific connection string. *...

(QB_NEW_EN)


[grammar] ~99-~99: There might be a mistake here.
Context: ...lities #### Get Prisma Postgres Regions Retrieves the list of available regions ...

(QB_NEW_EN)


[grammar] ~106-~106: There might be a mistake here.
Context: ...in Pipedream. To obtain your API token: 1. Log in to your Prisma account 2. Navigat...

(QB_NEW_EN)


[grammar] ~118-~118: There might be a mistake here.
Context: ...utomated Database Setup for New Projects Trigger a workflow when a new project is...

(QB_NEW_EN)


[grammar] ~121-~121: There might be a mistake here.
Context: ...system. ### Database Cleanup Automation Schedule periodic cleanup of unused data...

(QB_NEW_EN)


[grammar] ~124-~124: There might be a mistake here.
Context: ...s. ### Multi-Region Database Deployment Create databases across multiple regions...

(QB_NEW_EN)

🔇 Additional comments (5)
components/prisma_management_api/actions/create-database/create-database.mjs (1)

24-31: Confirm request payload shape matches API contract

You’re sending data: { name, region } to createProject. Ensure the endpoint expects these fields at the top level (vs nested under e.g. { project: { name, region } }).

Would you like me to adjust the payload once we confirm the exact schema?

components/prisma_management_api/actions/delete-database/delete-database.mjs (1)

12-15: Prop label/description are correct for project deletion—keep these as-is

Good alignment: the prop is projectId and clearly documents deleting a project.

components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)

17-25: Good fix: normalize API response shape before counting items

The normalization handles both array and { data: [] } shapes and fixes the earlier incorrect response.data?.length assumption.

components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)

17-27: LGTM: straightforward get-by-id with summary

Implementation is clear and consistent with the app client pattern. No issues spotted.

components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)

46-48: Nice touch: conditional ID in summary

Including the newly created database ID in the summary when available is helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
User submitted Submitted by a user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants