aboutsummaryrefslogtreecommitdiff
path: root/examples/circle.sql
diff options
context:
space:
mode:
Diffstat (limited to 'examples/circle.sql')
-rw-r--r--examples/circle.sql25
1 files changed, 0 insertions, 25 deletions
diff --git a/examples/circle.sql b/examples/circle.sql
deleted file mode 100644
index 73e7118..0000000
--- a/examples/circle.sql
+++ /dev/null
@@ -1,25 +0,0 @@
-CREATE TEMP TABLE variables(name TEXT PRIMARY KEY, value Text);
-
-INSERT INTO images (width, height) VALUES (6, 6) RETURNING id;
-INSERT INTO variables VALUES ('image_id', last_insert_rowid());
-
-WITH RECURSIVE
- image_id AS (SELECT value FROM variables WHERE name = 'image_id'),
- horizontal(x) AS (
- SELECT width FROM images WHERE id = (SELECT * FROM image_id)
- UNION ALL
- SELECT x - 1 FROM horizontal
- WHERE x > 1
- ),
- vertical(y) AS (
- SELECT height FROM images WHERE id = (SELECT * FROM image_id)
- UNION ALL
- SELECT y - 1 FROM vertical
- WHERE y > 1
- ),
- pixels_temp(x, y, r, g, b) AS (
- SELECT x, y, 255, 0, 0 FROM vertical, horizontal
- )
-INSERT INTO pixels (image_id, x, y, r, g, b) SELECT (SELECT * FROM image_id), x, y, r, g, b FROM pixels_temp;
-
-DROP TABLE variables;