Craticula

AG Grid server-side row model, compiled

AG Grid requests in.
Safe queries out.

Craticula compiles AG Grid requests into native SQL, MongoDB and OpenSearch queries. It never runs them, and every value is a bound parameter.

Apache-2.0 · .NET 10

AG Grid request
{
  "startRow": 0, "endRow": 50,
  "filterModel": {
    "customer": { "type": "contains", "filter": "acme" },
    "amount": { "type": "greaterThan", "filter": 100 }
  },
  "sortModel": [ { "colId": "amount", "sort": "desc" } ]
}
Compiled statement and parameters
SELECT * FROM "orders"
WHERE ("customer" ILIKE '%' || $1 || '%' ESCAPE '\'
   AND "amount" > $2::numeric)
ORDER BY "amount" DESC NULLS FIRST, "id" ASC NULLS LAST
LIMIT $3 OFFSET $4

-- parameters: 'acme', '100', 50, 0

Find your way in

From install to your first query

  1. Step 1

    Install

    Build the library from source and reference the project for your engine.

  2. Step 2

    Declare a GridSchema

    List the fields a grid may touch, because anything else is refused.

  3. Step 3

    Compile a request

    Pass the AG Grid request in and get a statement and its parameters out.

  4. Step 4

    Run it

    Execute with your own connection, or let an adapter do it.

Who maintains it

Craticula is open source under Apache-2.0 and maintained by Christian Stephan (cstephan.dev, LinkedIn, GitHub). The source is at github.com/pluries/craticula.

Measured compile time #

The time Craticula takes to compile one grid request into a query, without running it. The figures are taken from the per-shape means of the report and are measurements on one machine, not promises.

What is measuredThis run: lowest to highestRepeat run: lowest to highest
Schema prepared once, then each request compiled against it7.0 µs (search, plain-page) to 26.8 µs (mongo, deep-filter); 0 of 12 at or above the 50 µs target7.4 µs to 26.5 µs
Schema parsed from JSON on every call17.0 µs (search, plain-page) to 53.1 µs (mongo, group-aggregate); 3 of 12 at or above the 50 µs target16.9 µs to 62.4 µs

Measured on bench-vm-10c-34g on 2026-11-16, run folder 2026-11-16-p. Every figure links to the BenchmarkDotNet report it was read from. The full tables, the load results and the method are on the performance page.

All pages #