Skip to content

v0.25.0

Compare
Choose a tag to compare
@github-actions github-actions released this 13 Jul 06:30
· 307 commits to main since this release

This update introduces several enhancements and fixes.

  • The hero component now supports reversing the order of text and images, allowing more flexibility in design.
  • The datagrid component has been optimized for mobile displays by reducing the maximum item width.
  • Additionally, a new html component has been added for displaying raw HTML content, aimed at advanced users with a caution on potential security risks.
  • Error messages in the dynamic component and syntax errors have been improved for better clarity and troubleshooting.
  • The update also includes the addition of 54 new icons and the latest version of apexcharts.js for enhanced visual elements.

Several bug fixes have been implemented, such as

  • correct display of points with a latitude of 0 on the map component and
  • consistent behavior of the lower() function in SQLite.
  • along with better truncation of long page titles

The update enhances SQL capabilities

  • adding the ability to use arbitrary SQL expressions as arguments to SQLPage functions in most cases
  • supporting custom operators in postgres
  • The new sqlpage.link function simplifies creating links with parameters between pages, ensuring proper encoding of special characters.
  • Lastly, the update includes a new parameter in the run_sql function to pass variables to SQL files, promoting modular and reusable SQL code.
-- Example using sqlpage.link to create links with parameters
SELECT 'list' AS component;
SELECT
  product_name AS title,
  sqlpage.link('product.sql', json_object('product', product_name)) AS link
FROM products;

-- Before, you would manually build links like this:
-- CONCAT('/product.sql?product=', product_name)
-- but that would fail if product_name contained special characters like '&' or '%'
-- Example using run_sql with variables
-- The SQL file display_product.sql can be modular and reusable
-- It can accept parameters passed through json_object
-- This allows for dynamic and flexible SQL execution

SELECT 'dynamic' AS component, 
       sqlpage.run_sql('display_product.sql', json_object('product_id', product_id)) AS properties 
FROM products;

detailed notes: https://github.com/lovasoa/SQLpage/blob/main/CHANGELOG.md#0250-2024-07-13