dbtrail

Query

Search indexed binlog changes by server, table, event type, and time range

Search the indexed binlog changes for a specific server. Requires the query:execute permission.

Endpoint

MethodEndpointPermissionDescription
POST/queryquery:executeSearch indexed binlog changes

Request body

{
  "server_id": "uuid",
  "schema": "mydb",
  "table": "orders",
  "event_type": "DELETE",
  "since": "2026-03-01T00:00:00Z",
  "until": "2026-03-02T00:00:00Z",
  "limit": 100
}
FieldRequiredDescription
server_idyesServer to query
schemayesDatabase schema name
tableyesTable name
event_typenoINSERT, UPDATE, or DELETE
since / untilnoTime range (ISO 8601)
limitnoMax results (1–1000, default: 100)

Response

{
  "success": true,
  "events": [
    {
      "event_id": "12345",
      "binlog_file": "mysql-bin.000042",
      "timestamp": "2026-03-01 13:15:42",
      "event_type": "DELETE",
      "schema": "mydb",
      "table": "orders",
      "primary_key": {"id": 12345},
      "before": {"id": 12345, "status": "active", "amount": 99.99},
      "after": null
    }
  ],
  "total_count": 1,
  "has_more": false
}

Access rule redaction

Query results are subject to access rules. If the requesting user's role has column restrictions for the queried table, unauthorized columns are stripped from before and after images. If the role has no access to the table, the request returns 403.

Before/after images

Before/after row images are captured by the bintrail CLI as it parses MySQL binary log row events in real-time.

Event typebeforeafter
INSERTnullInserted row
UPDATEOld valuesNew values
DELETEDeleted rownull

On this page