Skip to main content

MySQL

DoubleDino Proxy supports native MySQL queries.

Developers can use normal MySQL SQL syntax, including:

  • SELECT queries.
  • Filters.
  • Joins.
  • Aggregations.
  • Complex queries.

Queries execute against the connected MySQL database, but returned data is transformed before being returned.

Endpoint

Use:

/query

Basic query

curl -G "http://localhost:8080/query" \
--data-urlencode "q=SELECT * FROM orders WHERE id=1" \
-H "x-api-key: your-api-key"

Example response:

{
"id": 1,
"order_uid": "HDK-G98KHBGTDS",
"status": "processing",
"total_amount": "460.29"
}

The response keeps the original structure while sensitive values are transformed.

Debugging production issues

A common workflow is starting with a known production identifier.

Example:

Order: KLP-X60SLVTFMK

Query:

curl -G "http://localhost:8080/query" \
--data-urlencode "q=SELECT * FROM orders WHERE order_uid='KLP-X60SLVTFMK'" \
-H "x-api-key: your-api-key"

The query uses the real production value.

The response contains transformed values:

{
"order_uid": "HDK-G98KHBGTDS",
"status": "processing"
}

This allows developers to investigate real issues without exposing original production data.

Joins

Normal MySQL joins work as expected.

Example:

SELECT
orders.id,
orders.order_uid,
users.email
FROM orders
JOIN users
ON users.id = orders.user_id
WHERE orders.id = 1;

The returned JSON follows the query result while sensitive values are transformed.

JSON fields

MySQL JSON fields are supported.

DoubleDino transforms nested JSON values while preserving:

  • Object structure.
  • Arrays.
  • Data types.

Example:

Before:

{
"customer": {
"name": "Alice",
"tags": [
"vip",
"priority"
]
}
}

After:

{
"customer": {
"name": "Eotrl",
"tags": [
"vip",
"priority"
]
}
}

Preserving known expressions

If enabled by your administrator, additional expressions can be preserved per request.

Header:

x-preserve-expressions

Example:

-H "x-preserve-expressions: tracking metadata"

This requires:

DD_ALLOW_DYNAMIC_EXPRESSIONS=true

Response format

All MySQL query responses are returned as JSON.

Single row:

{
"id": 1,
"name": "example"
}

Multiple rows:

[
{
"id": 1
},
{
"id": 2
}
]

Notes

  • DoubleDino does not modify MySQL data.
  • Queries execute against the connected source.
  • Returned values are always transformed.
  • The original database remains unchanged.

Next steps

Continue with:

  • MariaDB
  • MongoDB
  • Redis
  • Logs