Comparison examples

Each example below is the same pair the home page loads with one click. The snippets are short planning samples, not production files and not a recommendation of a vendor or a stack.

JSON config

A checkout API config. The modified side raises the rate limit, flips feature flags, and adds a CORS origin.

Original

{
  "service": "checkout-api",
  "version": "1.4.0",
  "rateLimit": {
    "windowSeconds": 60,
    "maxRequests": 120
  },
  "featureFlags": {
    "newCheckout": false,
    "legacyCart": true,
    "auditLog": true
  },
  "cors": {
    "origins": [
      "shop.example.com",
      "admin.example.com"
    ],
    "allowCredentials": true
  }
}

Modified

{
  "service": "checkout-api",
  "version": "1.5.0",
  "rateLimit": {
    "windowSeconds": 60,
    "maxRequests": 200
  },
  "featureFlags": {
    "newCheckout": true,
    "legacyCart": false,
    "auditLog": true,
    "expressPay": true
  },
  "cors": {
    "origins": [
      "shop.example.com",
      "admin.example.com",
      "preview.example.com"
    ],
    "allowCredentials": true
  }
}

Nginx server block

A virtual host. The modified side enables HTTP/2 and gzip, lengthens the proxy timeout, and tightens cache headers on static assets.

Original

upstream shop_app {
    server 127.0.0.1:8080;
}

server {
    listen 80;
    server_name shop.example.com;
    root /var/www/shop;
    index index.html;

    location / {
        proxy_pass shop_app;
        proxy_set_header Host $host;
        proxy_read_timeout 30s;
    }

    location /assets/ {
        expires 1h;
        add_header Cache-Control "public";
    }
}

Modified

upstream shop_app {
    server 127.0.0.1:8080;
}

server {
    listen 443 ssl http2;
    server_name shop.example.com;
    root /var/www/shop;
    index index.html;

    gzip on;
    gzip_types text/css application/javascript application/json;

    location / {
        proxy_pass shop_app;
        proxy_set_header Host $host;
        proxy_read_timeout 90s;
        proxy_http_version 1.1;
    }

    location /assets/ {
        expires 30d;
        add_header Cache-Control "public, immutable";
        add_header X-Content-Type-Options nosniff;
    }
}

SQL migration

An orders report query. The modified side adds an index, changes a join, and tightens the date and status filters.

Original

SELECT
  o.id,
  o.created_at,
  c.email,
  SUM(i.qty * i.unit_price) AS total
FROM orders o
INNER JOIN customers c ON c.id = o.customer_id
INNER JOIN order_items i ON i.order_id = o.id
WHERE o.created_at >= '2024-01-01'
  AND o.status <> 'cancelled'
GROUP BY o.id, o.created_at, c.email
ORDER BY o.created_at DESC;

Modified

CREATE INDEX idx_orders_created_status
  ON orders (created_at, status);

SELECT
  o.id,
  o.created_at,
  c.email,
  SUM(i.qty * i.unit_price) AS total
FROM orders o
LEFT JOIN customers c ON c.id = o.customer_id
INNER JOIN order_items i ON i.order_id = o.id
WHERE o.created_at >= '2025-01-01'
  AND o.status IN ('paid', 'shipped')
GROUP BY o.id, o.created_at, c.email
ORDER BY o.created_at DESC;

Markdown notes

A short changelog. The modified side bumps the version, documents a new --dry-run flag, and updates the usage line.

Original

# Release notes

## 1.2.0

- Format and minify a query in the browser.
- Add a --watch flag for local previews.
- Document the default port in the README.

Usage:

    desk format --file query.sql

Modified

# Release notes

## 1.3.0

- Format and minify a query in the browser.
- Add a --dry-run flag before writing a file.
- Add a --watch flag for local previews.
- Document the default port and locale prefix in the README.

Usage:

    desk format --file query.sql --dry-run

Back to the checker

Questions

Can I edit a sample on this page?

This page is a static reading copy. Open the home checker and use the one-click sample buttons to load the same pairs into the editors.