Skip to content

Commit 29f4ff7

Browse files
authored
Update CHANGELOG.md
1 parent 60183b1 commit 29f4ff7

File tree

1 file changed

+123
-58
lines changed

1 file changed

+123
-58
lines changed

CHANGELOG.md

Lines changed: 123 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,129 @@
11
# CHANGELOG.md
22

3-
## 0.33.0 (2025-02-14)
4-
5-
- Add support for HTTP Basic Authentication in the [fetch](https://sql-page.com/documentation.sql?component=fetch#component) function.
6-
- Fix a bug where the table component would not add the right css classes to table cells.
7-
- Better error messages when a CSV import fails (using a `copy` statement and a file upload).
8-
- Fix a bug where subsequent requests would fail after a failed CSV import on postgres (https://github.com/sqlpage/SQLPage/issues/788)
9-
- Complete rewrite of the request routing system.
10-
- Add support for *"clean URLs"*: Access the file `page.sql` using `https://example.com/page` instead of `https://example.com/page.sql`.
11-
- The previous behavior is preserved (the `.sql` suffix is now optional), so this is a new feature, not a breaking change.
12-
- Big thanks to @guspower who made big contributions to this feature.
13-
- Update ApexCharts to [v4.4.0](https://github.com/apexcharts/apexcharts.js/releases/tag/v4.4.0): fixes multiple small bugs in the chart component.
14-
- Add a new `auto_submit` parameter to the form component. When set to true, the form will be automatically submitted when the user changes any of its fields, and the page will be reloaded with the new value. The validation button is removed.
15-
- This is useful to quickly create filters at the top of a dashboard or report page, that will be automatically applied when the user changes them.
16-
- New `options_source` parameter in the form component. This allows to dynamically load options for dropdowns from a different SQL file.
17-
- This allows easily implementing autocomplete for form fields with a large number of possible options.
18-
- In the map component, add support for map pins with a description but no title.
19-
- Improved error messages when a parameter of a sqlpage function is invalid. Error traces used to be truncated, and made it hard to understand the exact cause of the error in some cases. In particular, calls to `sqlpage.fetch` would display an unhelpful error message when the HTTP request definition was invalid. `sqlpage.fetch` now also throws an error if the HTTP request definition contains unknown fields.
20-
- Make the `headers` field of the `sqlpage.fetch` function parameter optional. It defaults to sending a User-Agent header containing the SQLPage version.
21-
- Make custom layout creations with the `card` component easier and less error-prone:
22-
- The `embed` property now automatically adds the `_sqlpage_embed` parameter to the embedded page URL to render it as an embeddable fragment.
23-
- When an embedded page is rendered, the `shell` component is automatically replaced by a `shell-empty` component, to avoid displaying a duplicate shell and creating invalid duplicated page metadata in the response.
24-
- Update Tabler Icons to version [3.30.0](https://tabler.io/changelog#/changelog/tabler-icons-3.30), with many new icons.
25-
- Update the CSS framework to [Tabler 1.0.0](https://github.com/tabler/tabler/releases/tag/v1.0.0), with many small UI consistency improvements.
26-
- Add native number formatting to the table component. Numeric values in tables are now formatted in the visitor's locale by default, using country-specific thousands separators and decimal points.
27-
- This is better than formatting numbers inside the database, because
28-
- columns are sorted correctly in the numeric order by default, instead of being sorted in the alphabetic order of the formatted string.
29-
- the formatted numbers are more readable for the user by default, without requiring any additional code.
30-
- it adapts to the visitor's preferred locale, for instance using `.` as a decimal point and a space as a thousands separator if the visitor is in France.
31-
- less data is sent from the database to sqlpage, and from sqlpage to the client, because the numbers are not formatted directly in the database.
32-
- Add new customization properties to the table component:
33-
- Switch back to displaying raw numbers without formatting using the `raw_numbers` property.
34-
- Format monetary values using the `money` property to specify columns and `currency` to set the currency.
35-
- Control decimal places with `number_format_digits` property.
36-
- Add a new `description_md` row-level property to the form component to allow displaying markdown in a form field description.
37-
- Improve the error message when a header component (e.g. status_code, json, cookie) is used in the wrong place (after data has already been sent to the client).
38-
- New function: [`sqlpage.headers`](https://sql-page.com/functions.sql?function=headers).
39-
- Updated sqlparser to [v0.54](https://github.com/apache/datafusion-sqlparser-rs/blob/main/changelog/0.54.0.md) which fixes parse errors when using some advanced SQL syntax
40-
- Add support for `INSERT INTO ... SELECT ... RETURNING` statements, like
41-
```sql
42-
INSERT INTO table1(x, y)
43-
SELECT :x, :y
44-
WHERE :x IS NOT NULL
45-
RETURNING
46-
'redirect' as component,
47-
'inserted.sql?id=' || id as link;
48-
```
49-
- Add support for PostgreSQL's `overlaps` operator, like
50-
```sql
51-
select 'card' as component;
52-
select event_name as title, start_time || ' - ' || end_time as description
53-
from events
54-
where (start_time, end_time) overlaps ($start_filter::timestamp, $end_filter::timestamp);
55-
```
56-
- Add support for MySQL's `INSERT INTO ... SET` syntax, like
57-
```sql
58-
insert into users
59-
set name = :name, email = :email
60-
```
3+
## 0.33.0 (2025-02-15)
4+
5+
### Routing & URL Enhancements
6+
7+
#### **Clean URLs:**
8+
9+
Now, you can access your pages without the extra “.sql” suffix. For example, if you’ve got a file called `page.sql`, simply use:
10+
```
11+
-- old
12+
https://example.com/page.sql
13+
14+
-- new
15+
https://example.com/page
16+
```
17+
The previous behavior is preserved, so adding “.sql” still works. A big shout‑out to [@guspower](https://github.com/guspower) for their contributions!
18+
19+
#### **Complete Routing Rewrite**
20+
We’ve reworked our request routing system from top to bottom to make things smoother and more predictable for every request.
21+
22+
### SQLPage functions
23+
24+
#### sqlpage.fetch (call external services from SQLPage)
25+
26+
**HTTP Basic Authentication**
27+
SQLPage’s `sqlpage.fetch(request)` function now supports HTTP Basic Authentication. Quickly call external APIs that require a username and password. For example, in PostgreSQL:
28+
```sql
29+
SELECT sqlpage.fetch(
30+
'https://api.example.com/data',
31+
JSON_OBJECT(
32+
'auth', JSON_OBJECT('username', 'user', 'password', 'pass')
33+
)
34+
);
35+
```
36+
Learn more in the [fetch documentation](https://sql-page.com/documentation.sql?component=fetch#component).
37+
38+
**Smarter fetch errors & Headers Defaults:**
39+
When your HTTP request definition is off, you’ll now get clearer error messages — especially if there are unknown fields.
40+
Plus, the `headers` parameter is now optional: if omitted, SQLPage sends a default User‑Agent header that includes the SQLPage version.
41+
42+
**New Function: sqlpage.headers**
43+
Easily manage and inspect HTTP headers with the brand‑new [`sqlpage.headers`](https://sql-page.com/functions.sql?function=headers) function.
44+
45+
### UI Component Enhancements
46+
47+
#### Table & Card Components
48+
49+
- **Table CSS Fixes:**
50+
We fixed a bug that prevented proper CSS classes from being added to table cells. This fixes alignment in tables.
51+
52+
- **Native Number Formatting:**
53+
Numeric values in tables are automatically formatted to your visitor’s locale. That means thousands separators, correct decimal points, and sorting that respects numeric order—without any extra work from you.
54+
![image](https://github.com/user-attachments/assets/ba51a63f-b9ce-4ab2-a6dd-dfa8e22396de)
55+
56+
Not a formatted string in the database—just pure, locale‑sensitive output.
6157

58+
- **Enhanced Card Layouts:**
59+
Creating custom layouts with the `card` component is now easier:
60+
- The `embed` property automatically appends the `_sqlpage_embed` parameter to render your page as an embeddable fragment.
61+
- When an embedded page is rendered, the `shell` component is replaced by `shell-empty` to avoid duplicate headers and metadata.
62+
- ![screen](https://github.com/user-attachments/assets/c5b58402-178a-441e-8966-fd8e341b02bc)
63+
64+
#### Form Component Boosts
65+
66+
- **Auto‑Submit Forms:**
67+
Add the new `auto_submit` parameter to your forms, and watch them auto‑submit on any field change—perfect for instant filters on dashboards.
68+
*Example:*
69+
```sql
70+
SELECT 'form' AS component, 'Filter Results' AS title, true AS auto_submit;
71+
SELECT 'date' AS name;
72+
```
73+
- **Dynamic Options for Dropdowns:**
74+
Use the new `options_source` parameter to load dropdown options dynamically from another SQL file. Great for autocomplete on huge option lists!
75+
*Example:*
76+
```sql
77+
SELECT 'form' AS component, 'Select Country' AS title, 'countries.sql' AS options_source;
78+
SELECT 'country' AS name;
79+
```
80+
- **Markdown in Field Descriptions:**
81+
With the new `description_md` property, you can now render markdown in form field descriptions to better guide your users.
82+
83+
- **Improved Header Error Messages:**
84+
If you accidentally use a header component (like `json` or `cookie`) after sending data, you’ll now see a more helpful error message.
85+
86+
### Chart, Icons & CSS Updates
87+
88+
- **ApexCharts Upgrade:**
89+
We’ve updated ApexCharts to [v4.4.0](https://github.com/apexcharts/apexcharts.js/releases/tag/v4.4.0). Expect smoother charts with bug fixes for your visualizations.
90+
91+
- **Tabler Icons & CSS:**
92+
Enjoy a refreshed look with Tabler Icons updated to [v3.30.0](https://tabler.io/changelog#/changelog/tabler-icons-3.30) and the CSS framework upgraded to [Tabler 1.0.0](https://github.com/tabler/tabler/releases/tag/v1.0.0). More icons, better consistency, and a sleeker interface.
93+
94+
### 5. CSV Import & Error Handling
95+
96+
- **Enhanced CSV Error Messages:**
97+
We improved error messages when a CSV import fails (using a `copy` statement and file upload).
98+
- **Postgres CSV Bug Fix**
99+
A pesky bug causing subsequent requests to fail after a CSV import error on PostgreSQL is now fixed. (See [Issue #788](https://github.com/sqlpage/SQLPage/issues/788) for details.)
100+
101+
### 6. SQL Parser & Advanced SQL Support
102+
103+
**Upgraded SQL Parser (v0.54):**
104+
Our sqlparser is now at [v0.54](https://github.com/apache/datafusion-sqlparser-rs/blob/main/changelog/0.54.0.md), offering enhanced support for advanced SQL syntax. New additions include:
105+
106+
- **INSERT...SELECT...RETURNING:**
107+
```sql
108+
INSERT INTO users (name, email)
109+
SELECT :name, :email
110+
WHERE :name IS NOT NULL
111+
RETURNING 'redirect' AS component, 'user.sql?id=' || id AS link;
112+
```
113+
- **PostgreSQL’s overlaps operator:**
114+
```sql
115+
SELECT 'card' AS component;
116+
SELECT event_name AS title, start_time || ' - ' || end_time AS description
117+
FROM events
118+
WHERE (start_time, end_time) overlaps ($start_filter::timestamp, $end_filter::timestamp);
119+
```
120+
- **MySQL’s INSERT...SET syntax:**
121+
```sql
122+
INSERT INTO users
123+
SET name = :name, email = :email;
124+
```
125+
126+
---
62127

63128
## 0.32.1 (2025-01-03)
64129

0 commit comments

Comments
 (0)