lovasoa / SQLpage

SQL-only webapp builder, empowering data analysts to build websites and applications quickly
https://sql.ophir.dev
MIT License
896 stars 63 forks source link

v0.16 regression: numeric variables are set to null instead of being converted to text #138

Closed lovasoa closed 7 months ago

lovasoa commented 7 months ago

reported by @DSMejantel .

The code below worked in v0.15 and is broken by 0.16 :

set x = 2;
select 'text' as component, $x as contents;
DSMejantel commented 7 months ago

Capture_v015 Capture_v016

Cela peut être lié à :

select 
    CASE WHEN $NB_eleve > 1 
    THEN $NB_eleve ||' élèves' 
    ELSE $NB_eleve ||' élève' 
    END as title,
           'cyan' as color,
           TRUE as space_after
           where $tab='Tableau de bord'; 
--Carte   
SET AVG_Lat = (SELECT AVG(Lat) FROM etab);
SET AVG_Lon = (SELECT AVG(Lon) FROM etab);

SELECT 
    'map' as component,
    12 as zoom,
    400 as height,
    $AVG_Lat as latitude,
    $AVG_Lon as longitude
    where $tab='Carte';
lovasoa commented 7 months ago

v0.16.1 should fix the problem