# Client-side SQL Taboo?

### The Problem We Are Solving

Writing **SQL in client-side code** is traditionally **taboo**. Outside of local or hobby projects, it exposes query logic, introduces security risks, and forces developers to separate frontend intent from backend execution.

To compensate, teams build **custom payload shapes**, **validation layers**, and **query adapters** that translate frontend requests into backend SQL. This pattern is reliable—but repetitive. Frontends repeatedly shape data, backends repeatedly undo that shaping, and the final result is still the same: **a SQL query returning JSON**.

![Traditional](https://unpkg.com/@compilers/s2client@0.0.3/Traditional.png)

This system **short-circuits that loop**. See how: [Technical Summary](README2.md)

Instead of inventing new interfaces, it **preserves SQL as the contract**. Frontend developers write queries directly, which are **encrypted and compiled at build time** into safe runtime code. **No executable SQL exists in client runtime**, and execution remains **server-side**.

![New](https://unpkg.com/@compilers/s2client@0.0.3/New.png)

The model is **declarative**, **reactive**, and **compiler-driven**, eliminating boilerplate while keeping execution clear and secure.
