Skip to content

Commit

Permalink
Fix the default index page in MySQL
Browse files Browse the repository at this point in the history
Fixes #23
  • Loading branch information
lovasoa committed Jul 11, 2023
1 parent 94b7229 commit bde09ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- querying CSV data from SQLPage with [vsv](https://github.com/nalgeon/sqlean/blob/main/docs/vsv.md),
- or building a search engine for your data with [FTS5](https://www.sqlite.org/fts5.html).
- Breaking: change the order of priority for loading configuration parameters: the environment variables have priority over the configuration file. This makes it easier to tweak the configuration of a SQLPage website when deploying it.
- Fix the default index page in MySQL. Fixes [#23](https://github.com/lovasoa/SQLpage/issues/23).

## 0.7.2 (2023-07-10)

Expand Down
6 changes: 3 additions & 3 deletions index.sql
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ select 'chart' as component,
'Collatz conjecture' as title,
'area' as type;
WITH RECURSIVE cnt(x, y) AS (
VALUES(0, 15)
SELECT 0, 15
UNION ALL
SELECT x + 1,
CASE
Expand Down Expand Up @@ -99,7 +99,7 @@ select 'card' as component,
5 as columns;
WITH RECURSIVE cnt(x) AS (
-- cnt is a table that contains the numbers from 1 to 10
VALUES(1)
SELECT 1
UNION ALL
SELECT x + 1
FROM cnt
Expand All @@ -121,7 +121,7 @@ FROM cnt as a,
WHERE -- The powerful thing is here
$x IS NULL
OR -- The syntax $x allows us to extract the value 'a' when the URL ends with '?x=a'. It will be null if the URL does not contain '?x='
b.x = $x::INTEGER;
b.x = $x::DECIMAL;
-- So when we click the card for "a times b", we will reload the page, and display only the multiplication table of a
---------------------------
-- FORMS --
Expand Down

0 comments on commit bde09ea

Please sign in to comment.