<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[JoyTools]]></title><description><![CDATA[Changelogs and dev notes for JoyTools (https://tools.joydii.com) — free browser utilities for formatting, converting, and processing data locally. No ads, no lo]]></description><link>https://joytools.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6ae018ac1fbd25e2c7fea386/ffde6d59-0bd8-4f13-a792-1a5ed24b81c5.png</url><title>JoyTools</title><link>https://joytools.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 30 Oct 2026 13:04:57 GMT</lastBuildDate><atom:link href="https://joytools.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Formatting Complex BigQuery & PostgreSQL CTEs Directly in the Browser (With Zero Data Leakage)]]></title><description><![CDATA[Learn how to format complex BigQuery, PostgreSQL & PL/SQL queries and convert cURL commands 100% client-side in your browser without leaking private data.]]></description><link>https://joytools.hashnode.dev/formatting-complex-bigquery-postgresql-ctes-directly-in-the-browser-with-zero-data-leakage</link><guid isPermaLink="true">https://joytools.hashnode.dev/formatting-complex-bigquery-postgresql-ctes-directly-in-the-browser-with-zero-data-leakage</guid><category><![CDATA[SQL]]></category><category><![CDATA[PostgreSQL]]></category><category><![CDATA[bigquery]]></category><category><![CDATA[webdev]]></category><category><![CDATA[devtools]]></category><dc:creator><![CDATA[vinhtoan9xdn]]></dc:creator><pubDate>Tue, 27 Oct 2026 03:45:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae018ac1fbd25e2c7fea386/226052fc-8c13-4e4c-bf7f-9ae725ba0043.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every backend and data engineer has been there: you pull a massive, unformatted 200-line SQL query out of a production log, an ORM debug trace, or a legacy stored procedure. It is a single-line wall of text packed with nested Common Table Expressions (CTEs), window functions, and JSON path extractions.</p>
<p>Your first instinct is to open a new tab, search for an "online SQL formatter," and paste the query in.</p>
<p>Wait a second. <strong>Where did that query just go?</strong></p>
<h2>The Silent Security Risk of Server-Side Developer Utilities</h2>
<p>When you paste a raw SQL query, a <code>cURL</code> command from Chrome DevTools, or a JSON payload into a traditional online utility, that string is often sent via a <code>POST</code> request to a remote backend server for parsing.</p>
<p>Even if the query doesn't contain raw customer passwords, production queries routinely leak sensitive intellectual property and compliance-restricted metadata:</p>
<ol>
<li><strong>Internal Database Schemas:</strong> Table names, proprietary financial ledger structures, and partitioning strategies.</li>
<li><strong>PII in</strong> <code>WHERE</code> <strong>and</strong> <code>HAVING</code> <strong>Clauses:</strong> Hardcoded customer emails, UUIDs, national IDs, or transaction references used during debugging.</li>
<li><strong>Authentication Headers in</strong> <code>cURL</code> <strong>Commands:</strong> Bearer tokens, session cookies, and internal microservice endpoints.</li>
</ol>
<p>Under strict data governance frameworks (SOC2, ISO 27001, GDPR), transmitting production query strings or API headers to an unverified third-party server is a direct compliance violation.</p>
<h2>Moving the Parser to the Edge: 100% Client-Side Execution</h2>
<p>To eliminate server round-trips entirely, modern browser engines allow us to execute heavy lexical analysis and Abstract Syntax Tree (AST) formatting directly inside the user's browser memory using <strong>Web Workers</strong> and client-side JavaScript/WebAssembly.</p>
<p>This is the core engineering philosophy behind <a href="https://tools.joydii.com"><strong>JoyTools</strong></a> — a suite of over 100 developer, data, and media utilities built to run <strong>100% client-side with zero server uploads</strong>.</p>
<p>When you format a query or convert an API request on <a href="https://tools.joydii.com/tools">tools.joydii.com</a>, you can literally turn off your Wi-Fi after loading the page, and the tools will continue to work at native speed. Your data never leaves your machine's RAM.</p>
<hr />
<h2>Case Study 1: Dialect-Specific SQL Formatting (PostgreSQL, BigQuery &amp; Oracle PL/SQL)</h2>
<p>Generic SQL beautifiers often choke on modern dialect-specific syntax. A standard ANSI SQL parser will break when encountering Google BigQuery's <code>STRUCT</code> and <code>ARRAY</code> syntax, or PostgreSQL's <code>JSONB</code> operators (<code>-&gt;</code>, <code>-&gt;&gt;</code>, <code>@&gt;</code>).</p>
<p>Let's look at a typical unformatted PostgreSQL analytics query pulled from an application log:</p>
<pre><code class="language-sql">WITH regional_sales AS (SELECT region, SUM(amount) AS total_sales FROM orders WHERE created_at &gt;= '2026-01-01' AND metadata-&gt;&gt;'channel' = 'enterprise' GROUP BY region), top_regions AS (SELECT region FROM regional_sales WHERE total_sales &gt; (SELECT SUM(total_sales)/10 FROM regional_sales)) SELECT o.region, o.product_id, SUM(o.quantity) AS product_units, SUM(o.amount) AS product_sales, RANK() OVER (PARTITION BY o.region ORDER BY SUM(o.amount) DESC) as sales_rank FROM orders o WHERE o.region IN (SELECT region FROM top_regions) GROUP BY o.region, o.product_id;
</code></pre>
<p>By running this through the <a href="https://tools.joydii.com/tools/sql-formatter"><strong>JoyTools Online SQL Formatter</strong></a> (which provides dedicated AST rules for standard SQL, PostgreSQL, BigQuery, and Oracle PL/SQL), the lexical parser tokenizes the dialect-specific operators locally in under 15 milliseconds:</p>
<pre><code class="language-sql">WITH regional_sales AS (
  SELECT
    region,
    SUM(amount) AS total_sales
  FROM
    orders
  WHERE
    created_at &gt;= '2026-01-01'
    AND metadata -&gt;&gt; 'channel' = 'enterprise'
  GROUP BY
    region
),
top_regions AS (
  SELECT
    region
  FROM
    regional_sales
  WHERE
    total_sales &gt; (
      SELECT
        SUM(total_sales) / 10
      FROM
        regional_sales
    )
)
SELECT
  o.region,
  o.product_id,
  SUM(o.quantity) AS product_units,
  SUM(o.amount) AS product_sales,
  RANK() OVER (
    PARTITION BY o.region
    ORDER BY
      SUM(o.amount) DESC
  ) AS sales_rank
FROM
  orders o
WHERE
  o.region IN (
    SELECT
      region
    FROM
      top_regions
  )
GROUP BY
  o.region,
  o.product_id;
</code></pre>
<h3>Why Dialect Separation Matters (Direct Browser Tools):</h3>
<ul>
<li><a href="https://tools.joydii.com/tools/bigquery-formatter"><strong>BigQuery SQL Formatter</strong></a><strong>:</strong> Properly handles backtick-quoted project/dataset identifiers, <code>UNNEST()</code> arrays, <code>STRUCT</code> types, and trailing commas in <code>SELECT</code> lists.</li>
<li><a href="https://tools.joydii.com/tools/postgresql-formatter"><strong>PostgreSQL Formatter</strong></a><strong>:</strong> Preserves type casting (<code>::varchar</code>), JSONB containment operators (<code>-&gt;</code>, <code>-&gt;&gt;</code>, <code>@&gt;</code>), and <code>LATERAL</code> joins without throwing syntax errors.</li>
<li><a href="https://tools.joydii.com/tools/plsql-formatter"><strong>Oracle PL/SQL Formatter</strong></a><strong>:</strong> Maintains clean indentation for <code>DECLARE ... BEGIN ... EXCEPTION ... END;</code> blocks, cursors, and package bodies.</li>
<li><a href="https://tools.joydii.com/tools/sql-formatter"><strong>Standard SQL Formatter &amp; Beautifier</strong></a><strong>:</strong> Cleanly indents complex <code>JOIN</code> chains, subqueries, and window functions across MySQL, MariaDB, SQLite, and SQL Server (T-SQL).</li>
</ul>
<hr />
<h2>Case Study 2: Converting DevTools <code>cURL</code> Commands Without Leaking Bearer Tokens</h2>
<p>Another daily workflow bottleneck is copying a network request from Chrome DevTools ("Copy as cURL") and translating it into production-ready code for Python (<code>requests</code>), modern JavaScript (<code>fetch</code>), or <code>axios</code>.</p>
<p>Because <code>cURL</code> commands copied from browser sessions almost always contain live <code>Authorization: Bearer &lt;token&gt;</code> or <code>Cookie</code> headers, parsing them in the browser is mandatory for security.</p>
<p>Using the <a href="https://tools.joydii.com/tools/curl-converter"><strong>Client-Side cURL Converter utilities</strong></a> on JoyTools, the string is parsed locally into structured headers, query parameters, and JSON body payloads:</p>
<p><strong>Input (</strong><code>cURL</code><strong>):</strong></p>
<pre><code class="language-bash">curl '[https://api.internal-service.io/v2/ledger/query](https://api.internal-service.io/v2/ledger/query)' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIs...' \
  -H 'Content-Type: application/json' \
  --data-raw '{"account_id":"acc_99281","include_pending":true}'
</code></pre>
<p><strong>Instant Client-Side Output (JavaScript</strong> <code>fetch</code> <strong>/</strong> <code>axios</code> <strong>/ Python):</strong></p>
<pre><code class="language-javascript">const response = await fetch('[https://api.internal-service.io/v2/ledger/query](https://api.internal-service.io/v2/ledger/query)', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIs...',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    account_id: 'acc_99281',
    include_pending: true
  })
});
const data = await response.json();
</code></pre>
<hr />
<h2>Generating Realistic SQL Test Data Locally (50+ Field Types)</h2>
<p>Once your SQL queries and API clients are structured, you need synthetic datasets to benchmark query execution plans (<code>EXPLAIN ANALYZE</code>) without touching production customer tables.</p>
<p>Instead of writing boilerplate Faker scripts from scratch, you can use the browser-based <a href="https://tools.joydii.com/tools/mock-data-generator"><strong>Mock Data Generator</strong></a> on JoyTools to generate thousands of realistic rows across 50+ data types (UUIDs, ISO timestamps, financial currencies, IPv4/IPv6 addresses, localized names) and export them directly as multi-row <strong>SQL</strong> <code>INSERT</code> <strong>statements</strong>, CSV, or JSON.</p>
<h2>Conclusion &amp; Direct Tool Links</h2>
<p>Developer productivity shouldn't come at the cost of data privacy. By shifting everyday utilities—from SQL formatting and <code>cURL</code> transpilation to PDF compression and EXIF metadata stripping—into client-side Web Workers, we get zero-latency execution and absolute data isolation.</p>
<h3>Try the Client-Side SQL &amp; Developer Suite:</h3>
<ul>
<li><strong>Main Application Portal:</strong> <a href="https://tools.joydii.com">JoyTools — 100+ Free Client-Side Utilities</a></li>
<li><strong>Standard SQL Formatter:</strong> <a href="https://tools.joydii.com/tools/sql-formatter">https://tools.joydii.com/tools/sql-formatter</a></li>
<li><strong>PostgreSQL Query Formatter:</strong> <a href="https://tools.joydii.com/tools/postgresql-formatter">https://tools.joydii.com/tools/postgresql-formatter</a></li>
<li><strong>Google BigQuery SQL Formatter:</strong> <a href="https://tools.joydii.com/tools/bigquery-formatter">https://tools.joydii.com/tools/bigquery-formatter</a></li>
<li><strong>Oracle PL/SQL Formatter:</strong> <a href="https://tools.joydii.com/tools/plsql-formatter">https://tools.joydii.com/tools/plsql-formatter</a></li>
<li><strong>Browse All 104+ Developer, PDF &amp; Media Tools:</strong> <a href="https://tools.joydii.com/tools">https://tools.joydii.com/tools</a></li>
<li><strong>Security &amp; Privacy Architecture:</strong> <a href="https://tools.joydii.com/security">How Zero-Upload Browser Processing Works</a></li>
</ul>
]]></content:encoded></item></channel></rss>