Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
prisma avatar

Prisma Cli Db Execute

  • 14 installs
  • 8 repo stars
  • Updated February 9, 2026
  • prisma/cursor-plugin

prisma-cli-db-execute runs raw SQL scripts against the Prisma datasource.

About

The prisma-cli-db-execute skill documents prisma db execute for running native SQL against the configured datasource from prisma.config.ts. Scripts load from --file or --stdin, with optional --url and --config overrides. Use for manual migrations, maintenance such as truncates, applying migrate diff output piped on stdin, or ad hoc DDL. The command reports success or failure only, not query rows, so inspection belongs in Prisma Client or Studio. MongoDB is unsupported. Examples show piping migrate diff --script into db execute for schema synchronization. Configuration reads datasource.url from defineConfig with env DATABASE_URL. Runs SQL from --file or --stdin against datasource. Pipes migrate diff scripts directly to the database. Supports --url and --config overrides. Reports success without returning SELECT rows. Not supported on MongoDB datasources. SQL script applied with success or failure reported. User needs prisma db execute for SQL files or stdin scripts.

  • Runs SQL from --file or --stdin against datasource.
  • Pipes migrate diff scripts directly to the database.
  • Supports --url and --config overrides.
  • Reports success without returning SELECT rows.
  • Not supported on MongoDB datasources.

Prisma Cli Db Execute by the numbers

  • 14 all-time installs (skills.sh)
  • Ranked #604 of 911 Databases skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
At a glance

prisma-cli-db-execute capabilities & compatibility

Capabilities
file and stdin execution options · migrate diff pipe workflow · datasource config from prisma.config.ts
Works with
postgres · mysql
Use cases
database · devops
From the docs

What prisma-cli-db-execute says it does

Execute native commands (SQL) to your database
SKILL.md
prisma migrate diff
SKILL.md
npx skills add https://github.com/prisma/cursor-plugin --skill prisma-cli-db-execute

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs14
repo stars8
Last updatedFebruary 9, 2026
Repositoryprisma/cursor-plugin

How do I execute raw SQL with Prisma CLI?

Execute raw SQL against the configured Prisma datasource via file or stdin without returning result rows.

Who is it for?

Developers applying maintenance SQL or migrate diff scripts.

Skip if: Skip when typed Prisma Client queries suffice for reads.

When should I use this skill?

User needs prisma db execute for SQL files or stdin scripts.

What you get

SQL script applied with success or failure reported.

Files

SKILL.mdMarkdownGitHub ↗

prisma db execute

Execute native commands (SQL) to your database.

Command

prisma db execute [options]

What It Does

  • Connects to your database using the configured datasource
  • Executes a script provided via file (--file) or stdin (--stdin)
  • Useful for running raw SQL, maintenance tasks, or applying diffs from migrate diff
  • Not supported on MongoDB

Options

OptionDescription
--filePath to a file containing the script to execute
--stdinUse terminal standard input as the script
--urlOverride the datasource URL from the Prisma config file
--configCustom path to your Prisma config file

Examples

Execute from file

prisma db execute --file ./script.sql

Execute from stdin

echo "TRUNCATE TABLE User;" | prisma db execute --stdin

Execute migrate diff output

Pipe the output of migrate diff directly to the database:

prisma migrate diff \
  --from-empty \
  --to-schema-datamodel prisma/schema.prisma \
  --script \
| prisma db execute --stdin

Configuration

Uses datasource from prisma.config.ts:

export default defineConfig({
  datasource: {
    url: env('DATABASE_URL'),
  },
})

Use Cases

  • Manual Migrations: Applying raw SQL changes
  • Data Maintenance: Truncating tables, cleaning up data
  • Schema Synchronization: Applying migrate diff scripts
  • Debugging: Running test queries (though typically not for fetching data)

Limitations

  • No Data Return: The command reports success/failure, not query results (rows). Use Prisma Client or prisma studio to view data.
  • SQL Only: Primarily for SQL databases.

Related skills

FAQ

What does prisma-cli-db-execute do?

prisma-cli-db-execute runs raw SQL scripts against the Prisma datasource.

When should I use prisma-cli-db-execute?

User needs prisma db execute for SQL files or stdin scripts.

Is this skill safe to install?

Review the Security Audits panel on this page before installing in production.

Databasesdatabases

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.