# execute (Prisma CLI v7) (/docs/cli/v7/db/execute) > For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL. Execute native commands to your database Location: CLI > v7 > db > execute The `prisma db execute` command applies a SQL script to the database without interacting with the Prisma migrations table. > [!WARNING] > This command is currently not supported on [MongoDB](https://www.prisma.io/docs/orm/v7/core-concepts/supported-databases/mongodb). ## Usage [#usage] ```bash prisma db execute [options] ``` The datasource URL configuration is read from the Prisma config file (e.g., `prisma.config.ts`). The script input must be provided using either `--file` or `--stdin`. The whole script is sent as a single command to the database. The output is connector-specific and reports success or failure only. It is not meant for returning data. ## Prerequisites [#prerequisites] Configure your database connection in `prisma.config.ts`: ```prisma file=schema.prisma generator client { provider = "prisma-client" output = "../generated/prisma" } datasource db { provider = "sqlite" } ``` ```typescript file=prisma.config.ts import { defineConfig, env } from "prisma/config"; export default defineConfig({ schema: "prisma/schema.prisma", migrations: { path: "prisma/migrations", }, datasource: { url: env("DATABASE_URL"), }, }); ``` ## Options [#options] | Option | Description | | -------------- | ----------------------------------------------- | | `-h`, `--help` | Display help message | | `--config` | Custom path to your Prisma config file | | `--file` | Path to a file containing the script to execute | ## Flags [#flags] | Flag | Description | | --------- | ---------------------------------------------------- | | `--stdin` | Use terminal standard input as the script to execute | Either `--file` or `--stdin` is required. > [!NOTE] > **Prisma v7 breaking change**: The `--schema` and `--url` options have been removed. Configure your database connection in `prisma.config.ts` instead. ## Examples [#examples] ### Execute a SQL file [#execute-a-sql-file] #### bun ```bash bunx prisma db execute --file ./script.sql ``` #### pnpm ```bash pnpm prisma db execute --file ./script.sql ``` #### yarn ```bash yarn prisma db execute --file ./script.sql ``` #### npm ```bash npx prisma db execute --file ./script.sql ``` ### Execute SQL from stdin [#execute-sql-from-stdin] ```bash echo 'TRUNCATE TABLE dev;' | prisma db execute --stdin ``` ## See also [#see-also] * [Migration troubleshooting in production](https://www.prisma.io/docs/orm/v7/prisma-migrate/workflows/patching-and-hotfixing#fixing-failed-migrations-with-migrate-diff-and-db-execute) ## Related pages - [`pull`](https://www.prisma.io/docs/cli/v7/db/pull): Pull the state from the database to the Prisma schema using introspection - [`push`](https://www.prisma.io/docs/cli/v7/db/push): Push the state from your Prisma schema to your database - [`seed`](https://www.prisma.io/docs/cli/v7/db/seed): Seed your database with test or initial data using custom scripts