Browse Source

fix recursive call

Pi 4 months ago
parent
commit
2d17ad9141
3 changed files with 11 additions and 11 deletions
  1. 1 1
      home-sqlpage.json
  2. 9 1
      home-sqlpage/sqlpage/Link.sql
  3. 1 9
      home-sqlpage/sqlpage/link.sql

+ 1 - 1
home-sqlpage.json

@@ -1,4 +1,4 @@
 {
 {
-  "max_database_pool_connections": 4,
+  "max_database_pool_connections": 16,
   "database_url": "sqlite://:memory:"
   "database_url": "sqlite://:memory:"
 }
 }

+ 9 - 1
home-sqlpage/sqlpage/Link.sql

@@ -7,4 +7,12 @@ SELECT 'text' AS component
     </div>
     </div>
   </div>
   </div>
 </div>' AS html
 </div>' AS html
-;
+;
+SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/QR.sql') AS properties;
+
+SET content = NULL;
+SET inner = CASE $hash IS NULL
+  WHEN TRUE THEN $tool||'/form.sql'
+  ELSE 'sqlpage/validate.sql'
+END;
+SELECT 'dynamic' AS component, sqlpage.run_sql($inner) AS properties;

+ 1 - 9
home-sqlpage/sqlpage/link.sql

@@ -2,12 +2,4 @@ SET url = 'https://shandan.one/normalize?hash=' || sqlpage.url_encode($hash);
 SET api_results = sqlpage.fetch($url);
 SET api_results = sqlpage.fetch($url);
 SET hash = $api_results->>'o';
 SET hash = $api_results->>'o';
 SET link = COALESCE('https://shandan.one/'||$tool||'/'||$hash, NULL);
 SET link = COALESCE('https://shandan.one/'||$tool||'/'||$hash, NULL);
-SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/Link.sql') AS properties;
-SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/QR.sql') AS properties;
-
-SET content = NULL;
-SET inner = CASE $hash IS NULL
-  WHEN TRUE THEN $tool||'/form.sql'
-  ELSE 'sqlpage/validate.sql'
-END;
-SELECT 'dynamic' AS component, sqlpage.run_sql($inner) AS properties;
+SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/Link.sql') AS properties;