
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)
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
What prisma-cli-db-execute says it does
Execute native commands (SQL) to your database
prisma migrate diff
npx skills add https://github.com/prisma/cursor-plugin --skill prisma-cli-db-executeAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 14 |
|---|---|
| repo stars | ★ 8 |
| Last updated | February 9, 2026 |
| Repository | prisma/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
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
| Option | Description |
|---|---|
--file | Path to a file containing the script to execute |
--stdin | Use terminal standard input as the script |
--url | Override the datasource URL from the Prisma config file |
--config | Custom path to your Prisma config file |
Examples
Execute from file
prisma db execute --file ./script.sqlExecute from stdin
echo "TRUNCATE TABLE User;" | prisma db execute --stdinExecute 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 --stdinConfiguration
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 diffscripts - 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 studioto view data. - SQL Only: Primarily for SQL databases.
{
"name": "prisma-cli-db-execute",
"version": "7.0.0",
"author": "prisma",
"license": "MIT"
}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.