Prisma Raw API

Raw SQL query execution

Operations 2

POST /raw/query Prisma Execute a raw SQL query #
POST /raw/execute Prisma Execute a raw SQL statement #

Documentation

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/prisma-raw-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

prisma-raw-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Prisma Client Raw API
  description: Auto-generated, type-safe query builder for Node.js and TypeScript that provides programmatic database access. Prisma Client exposes CRUD operations (findUnique, findMany, create, update, delete, upsert), aggregation functions (count, aggregate, groupBy), and advanced query features including filtering, pagination, sorting, relation loading, and transactions. This specification documents the REST-equivalent operations that Prisma Client generates for database models, supporting PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, and CockroachDB.
  version: 1.0.0
  contact:
    name: Prisma Support
    email: support@prisma.io
    url: https://www.prisma.io/support
  license:
    name: Apache-2.0
    url: https://opensource.org/licenses/Apache-2.0
  termsOfService: https://www.prisma.io/terms
servers:
- url: https://localhost:3000/api
  description: Local development server. Prisma Client is typically used as a library, not a REST API. This specification documents the operations available when exposed via a REST layer.
tags:
- name: Raw
  description: Raw SQL query execution
paths:
  /raw/query:
    post:
      operationId: queryRaw
      summary: Prisma Execute a raw SQL query
      description: Executes a raw SQL SELECT query against the database and returns the result set. Use parameterized queries to prevent SQL injection.
      tags:
      - Raw
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RawQueryInput'
      responses:
        '200':
          description: Successfully executed query
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /raw/execute:
    post:
      operationId: executeRaw
      summary: Prisma Execute a raw SQL statement
      description: Executes a raw SQL statement (INSERT, UPDATE, DELETE, DDL) against the database and returns the number of affected rows.
      tags:
      - Raw
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RawQueryInput'
      responses:
        '200':
          description: Successfully executed statement
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    description: Number of rows affected
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    BadRequest:
      description: The request was invalid or malformed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PrismaError'
    InternalServerError:
      description: An unexpected error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PrismaError'
  schemas:
    RawQueryInput:
      type: object
      description: Input for raw SQL query execution
      properties:
        query:
          type: string
          description: The SQL query string with $1, $2 parameter placeholders
          examples:
          - SELECT * FROM "User" WHERE email = $1
        parameters:
          type: array
          description: Parameter values for the query placeholders
          items: {}
      required:
      - query
    PrismaError:
      type: object
      description: Error response from Prisma Client. Error codes follow the Pxxxx format documented at https://www.prisma.io/docs/orm/reference/error-reference
      properties:
        code:
          type: string
          description: Prisma error code (e.g., P2002 for unique constraint violation)
          pattern: ^P[0-9]{4}$
          examples:
          - P2002
          - P2025
        message:
          type: string
          description: Human-readable error description
        meta:
          type: object
          description: Additional error context
          additionalProperties: true
      required:
      - code
      - message
externalDocs:
  description: Prisma Client API Reference
  url: https://www.prisma.io/docs/orm/reference/prisma-client-reference