Skip to content

Commit a8d14ba

Browse files
committed
slight tweaks
1 parent 3badcbb commit a8d14ba

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ Applications store JSON in SQLite. Querying and transforming that data requires
1717

1818
## The Solution
1919

20+
```sql
21+
.load ./gnata_jsonata sqlite3_jsonata_init
22+
23+
-- Per-row: extract, transform, filter
24+
SELECT jsonata('items[price > 100].name', data) FROM orders;
25+
26+
-- Aggregate: build a full report in one expression
27+
SELECT jsonata_query('{
28+
"revenue": $sum($filter($, function($v){ $v.status = "shipped" }).total),
29+
"orders": $count($),
30+
"avg": $round($average(total), 2)
31+
}', data) FROM orders;
32+
```
33+
2034
gnata-sqlite makes SQLite JSON data queryable with [JSONata](https://jsonata.org) — a lightweight, expressive language end users can learn — and provides everything needed to embed an expression editor in any app:
2135

2236
1. **Load the SQLite extension** → JSON columns become queryable with JSONata
@@ -31,19 +45,6 @@ A loadable extension that brings JSONata into SQL queries. Install once, use fro
3145

3246
<img src="assets/playground-sqlite-dashboard.png" alt="SQLite dashboard query" width="720" />
3347

34-
```sql
35-
.load ./gnata_jsonata sqlite3_jsonata_init
36-
37-
-- Per-row: extract, transform, filter
38-
SELECT jsonata('items[price > 100].name', data) FROM orders;
39-
40-
-- Aggregate: build a full report in one expression
41-
SELECT jsonata_query('{
42-
"revenue": $sum($filter($, function($v){ $v.status = "shipped" }).total),
43-
"orders": $count($),
44-
"avg": $round($average(total), 2)
45-
}', data) FROM orders;
46-
```
4748

4849
The query planner decomposes complex expressions into streaming accumulators — matching hand-tuned SQL performance on 100K+ rows. See [sqlite/OPTIMIZATION.md](sqlite/OPTIMIZATION.md).
4950

@@ -116,7 +117,7 @@ Backend Frontend
116117
│ SQLite + gnata │ │ @gnata-sqlite/react │
117118
│ extension │ schema → │ CodeMirror 6 editor │
118119
│ │ │ + 85KB WASM LSP │
119-
│ Runs expressions │ ← expr │ Autocomplete, hover, │
120+
│ Runs expressions │ ← expr │ Autocomplete, hover, │
120121
│ against JSON data│ │ diagnostics │
121122
└──────────────────┘ └──────────────────────────┘
122123
```

website/src/app/global.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,11 @@ html:has(body[data-scroll-locked]) {
466466
background: conic-gradient(
467467
from var(--shimmer-angle, 0deg),
468468
transparent 0%,
469-
rgba(255,255,255,0.8) 10%,
470-
#fff 12%,
469+
#ff6b4a44 4%,
470+
#ff9e64cc 7%,
471+
#d0ff47cc 10%,
472+
#fff74b 12%,
473+
#ffffffee 14%,
471474
transparent 20%
472475
);
473476
animation: shimmer-spin 5s linear infinite;

0 commit comments

Comments
 (0)