From 5993ea8f6fd4316aee313e1e6fdae2dc7fbab5df Mon Sep 17 00:00:00 2001
From: Akshay Nair <phenax5@gmail.com>
Date: Wed, 3 Jun 2026 12:49:35 +0530
Subject: Add circle example

---
 examples/gradient.sql | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'examples/gradient.sql')

diff --git a/examples/gradient.sql b/examples/gradient.sql
index 9aa9010..f04cdad 100644
--- a/examples/gradient.sql
+++ b/examples/gradient.sql
@@ -1,12 +1,12 @@
+DELETE FROM images WHERE id = 'gradient';
 INSERT INTO images (id, width, height) VALUES ('gradient', 200, 200) RETURNING id;
 
 WITH RECURSIVE
-  width AS (SELECT width FROM images WHERE id = 'gradient'),
-  height AS (SELECT height FROM images WHERE id = 'gradient'),
+  image AS (SELECT * FROM images WHERE id = 'gradient'),
   horizontal(x) AS
-    (SELECT * FROM width UNION ALL SELECT x - 1 FROM horizontal WHERE x > 1),
+    (SELECT width FROM image UNION ALL SELECT x - 1 FROM horizontal WHERE x > 1),
   vertical(y) AS
-    (SELECT * FROM height UNION ALL SELECT y - 1 FROM vertical WHERE y > 1),
+    (SELECT height FROM image UNION ALL SELECT y - 1 FROM vertical WHERE y > 1),
   _pixels(x, y, r, g, b) AS
     (SELECT x, y, mod(x, 255), mod(y, 255), 100 FROM vertical, horizontal)
 INSERT INTO pixels (image_id, x, y, r, g, b) SELECT 'gradient', x, y, r, g, b FROM _pixels;
-- 
cgit v1.3.1

