Cloudflare D1 icon

Cloudflare D1

Execute operations against Cloudflare D1 serverless databases. Supports structured operations (Insert, Select, Update, Delete), raw SQL queries, and can be used as a tool by AI Agents.

Table → Delete

AI-generated

Summary

Delete rows from a Cloudflare D1 table matching specified conditions.

Inputs

  • databaseId (required) — The unique identifier of the Cloudflare D1 database.
  • table (required) — The table to operate on; can be selected from a list or entered as a name.
  • whereDelete — Fixed collection of condition objects defining which rows to delete.
  • deleteLimit — Maximum number of rows to delete (optional safety limit).

Output shape

An object containing success flag, results array, meta information, rowsWritten and changes counts.

RowsDeleted is reported via rowsWritten and changes; errors may throw NodeOperationError.

Examples

Example 1: Delete inactive users

databaseId: "12345", table: "users", whereDelete: [{column:"status",operator:"=",value:"inactive"}], deleteLimit: 100

Example 2: Delete logs older than a date

databaseId: "98765", table: "logs", whereDelete: [{column:"timestamp",operator:"<",value:"2023-01-01"}], deleteLimit: 500

Example 3: Delete all rows up to a limit

databaseId: "54321", table: "session", whereDelete: [], deleteLimit: 1000

Discussion