Skip to content

Commit 054601e

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 62aa842 + 2281e1f commit 054601e

File tree

170 files changed

+12295
-5862
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+12295
-5862
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- uses: actions/checkout@v4
28+
- run: npm ci
29+
- run: npm test
2830
- name: Set up cargo cache
2931
uses: Swatinem/rust-cache@378c8285a4eaf12899d11bea686a763e906956af
3032
- run: cargo fmt --all -- --check

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77

88
name: Create Release
99

10+
permissions:
11+
contents: write
12+
1013
jobs:
1114
build:
1215
name: Build sqlpage binaries
@@ -61,7 +64,7 @@ jobs:
6164
zip -r sqlpage-windows.zip sqlpage.exe sqlpage/migrations sqlpage/templates sqlpage/sqlpage.json;
6265
- name: Create Release
6366
id: create_release
64-
uses: softprops/action-gh-release@v1
67+
uses: softprops/action-gh-release@v2
6568
with:
6669
name: ${{ github.ref_name }}
6770
tag_name: ${{ github.ref_name }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ docs/presentation-pgconf.html
66
examples/inrap_badass/
77
sqlpage/https/*
88
x.sql
9+
xbed.sql
910
**/sqlpage.bin
11+
node_modules/

.vscode/launch.json

Lines changed: 62 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,64 @@
11
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"type": "lldb",
9-
"request": "launch",
10-
"name": "Debug unit tests in library 'sqlpage'",
11-
"cargo": {
12-
"args": [
13-
"test",
14-
"--no-run",
15-
"--lib",
16-
"--package=sqlpage"
17-
],
18-
"filter": {
19-
"name": "sqlpage",
20-
"kind": "lib"
21-
}
22-
},
23-
"args": [],
24-
"cwd": "${workspaceFolder}"
25-
},
26-
{
27-
"type": "lldb",
28-
"request": "launch",
29-
"name": "Debug executable 'sqlpage'",
30-
"cargo": {
31-
"args": [
32-
"build",
33-
"--bin=sqlpage",
34-
"--package=sqlpage"
35-
],
36-
"filter": {
37-
"name": "sqlpage",
38-
"kind": "bin"
39-
}
40-
},
41-
"args": [],
42-
"cwd": "${workspaceFolder}"
43-
},
44-
{
45-
"type": "lldb",
46-
"request": "launch",
47-
"name": "Debug unit tests in executable 'sqlpage'",
48-
"cargo": {
49-
"args": [
50-
"test",
51-
"--no-run",
52-
"--bin=sqlpage",
53-
"--package=sqlpage"
54-
],
55-
"filter": {
56-
"name": "sqlpage",
57-
"kind": "bin"
58-
}
59-
},
60-
"args": [],
61-
"cwd": "${workspaceFolder}"
62-
},
63-
{
64-
"type": "lldb",
65-
"request": "launch",
66-
"name": "Debug integration test 'index'",
67-
"cargo": {
68-
"args": [
69-
"test",
70-
"--no-run",
71-
"--test=index",
72-
"--package=sqlpage"
73-
],
74-
"filter": {
75-
"name": "index",
76-
"kind": "test"
77-
}
78-
},
79-
"args": [],
80-
"cwd": "${workspaceFolder}"
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "lldb",
9+
"request": "launch",
10+
"name": "Debug unit tests in library 'sqlpage'",
11+
"cargo": {
12+
"args": ["test", "--no-run", "--lib", "--package=sqlpage"],
13+
"filter": {
14+
"name": "sqlpage",
15+
"kind": "lib"
8116
}
82-
]
83-
}
17+
},
18+
"args": [],
19+
"cwd": "${workspaceFolder}"
20+
},
21+
{
22+
"type": "lldb",
23+
"request": "launch",
24+
"name": "Debug executable 'sqlpage'",
25+
"cargo": {
26+
"args": ["build", "--bin=sqlpage", "--package=sqlpage"],
27+
"filter": {
28+
"name": "sqlpage",
29+
"kind": "bin"
30+
}
31+
},
32+
"args": [],
33+
"cwd": "${workspaceFolder}"
34+
},
35+
{
36+
"type": "lldb",
37+
"request": "launch",
38+
"name": "Debug unit tests in executable 'sqlpage'",
39+
"cargo": {
40+
"args": ["test", "--no-run", "--bin=sqlpage", "--package=sqlpage"],
41+
"filter": {
42+
"name": "sqlpage",
43+
"kind": "bin"
44+
}
45+
},
46+
"args": [],
47+
"cwd": "${workspaceFolder}"
48+
},
49+
{
50+
"type": "lldb",
51+
"request": "launch",
52+
"name": "Debug integration test 'index'",
53+
"cargo": {
54+
"args": ["test", "--no-run", "--test=index", "--package=sqlpage"],
55+
"filter": {
56+
"name": "index",
57+
"kind": "test"
58+
}
59+
},
60+
"args": [],
61+
"cwd": "${workspaceFolder}"
62+
}
63+
]
64+
}

.vscode/settings.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"rust-analyzer.linkedProjects": [
3-
"./Cargo.toml"
4-
]
5-
}
2+
"rust-analyzer.linkedProjects": ["./Cargo.toml"]
3+
}

CHANGELOG.md

Lines changed: 147 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,153 @@
11
# CHANGELOG.md
22

3-
## 0.30.0 (unreleased)
3+
## 0.31.0 (2024-11-24)
4+
5+
### 🚀 **New Features**
6+
7+
#### **Improved Components**
8+
- [**Columns Component**](https://sql.datapage.app/component.sql?component=columns)
9+
- Markdown-supported descriptions (`description_md`) allow richer formatting.
10+
- Add simple text items without needing JSON handling.
11+
- Optionally skip displaying items (`null as item`).
12+
- ![columns component screenshot](https://github.com/user-attachments/assets/dd5e1ba7-e12f-4119-a201-0583cf765000)
13+
14+
- [**Table Component**](https://sql.datapage.app/component.sql?component=table)
15+
- New **freeze headers and columns** feature improves usability with large tables.
16+
- Enhanced search logic ensures more precise matches (e.g., `"xy"` no longer matches separate `x` and `y` cells in adjacent columns).
17+
- Search box visibility is retained during horizontal scrolling.
18+
*Technical:* Adds `freeze_headers`, `freeze_columns`, and improves the internal search algorithm.
19+
- ![scroll table](https://github.com/user-attachments/assets/546f36fb-b590-487d-8817-47eeed8f1835)
20+
21+
- [**Form Component**](https://sql.datapage.app/component.sql?component=form)
22+
- Added an empty option (`empty_option`) to dropdowns, enabling placeholder-like behavior.
23+
- ![form](https://github.com/user-attachments/assets/40a230da-9b1b-49ed-9759-5e21fe812957)
24+
- Improved handling of large form submissions with configurable size limits (`max_uploaded_file_size`, default 5MB).
25+
*Technical:* There used to be a hardcoded limit to 16kB for all forms.
26+
---
27+
28+
29+
#### **Database Enhancements**
30+
- **Support for New Data Types**:
31+
- Microsoft SQL Server now supports `BIT` columns.
32+
- Improved handling of `DATETIMEOFFSET` in MSSQL and `TIMESTAMPTZ` in PostgreSQL, preserving their timezones instead of converting them to UTC.
33+
34+
- **Better JSON Handling**:
35+
- Accept nested JSON objects and arrays as function parameters.
36+
Useful for advanced usage like calling external APIs using `sqlpage.fetch` with complex data structures.
37+
38+
- **SQL Parser Update**:
39+
- Upgraded to [v0.52.0](https://github.com/apache/datafusion-sqlparser-rs/blob/main/changelog/0.52.0.md) with new features:
40+
- Added support for:
41+
- advanced `JSON_TABLE` usage in MySQL for working with JSON arrays.
42+
- `EXECUTE` statements with parameters in MSSQL for running stored procedures.
43+
- MSSQL’s `TRY_CONVERT` function for type conversion.
44+
- `ANY`, `ALL`, and `SOME` subqueries (e.g., `SELECT * FROM t WHERE a = ANY (SELECT b FROM t2)`).
45+
- `LIMIT max_rows, offset` syntax in SQLite.
46+
- Assigning column names aliases using `=` in MSSQL (e.g., `SELECT col_name = value`).
47+
- Fixes a bug where the parser would fail parse a `SET` clause for a variable named `role`.
48+
49+
---
50+
51+
#### **Security and Performance**
52+
- **Encrypted Login Support for MSSQL**:
53+
- Ensures secure connections with flexible encryption modes:
54+
- No encryption (`?encrypt=not_supported`): For legacy systems and environments where SSL is blocked
55+
- Partial encryption (`?encrypt=off`): Protects login credentials but not data packets.
56+
- Full encryption (`?encrypt=on`): Secures both login and data.
57+
*Technical:* Controlled using the `encrypt` parameter (`not_supported`, `off`, or `strict`) in mssql connection strings.
58+
59+
- **Chart Library Optimization**:
60+
- Updated ApexCharts to v4.0.0.
61+
- Fixed duplicate library loads, speeding up pages with multiple charts.
62+
- Fixed a bug where [timeline chart tooltips displayed the wrong labels](https://github.com/sqlpage/SQLPage/issues/659).
63+
64+
---
65+
66+
### 🛠 **Bug Fixes**
67+
#### Database and Compatibility Fixes
68+
- **Microsoft SQL Server**:
69+
- Fixed decoding issues for less common data types.
70+
- Resolved bugs in reading `VARCHAR` columns from non-European collations.
71+
- Correctly handles `REAL` values.
72+
73+
- **SQLite**:
74+
- Eliminated spurious warnings when using SQLPage functions with JSON arguments.
75+
*Technical:* Avoids warnings like `The column _sqlpage_f0_a1 is missing`.
76+
77+
#### Component Fixes
78+
- **Card Component**:
79+
- Fixed layout issues with embedded content (e.g., removed double borders).
80+
- ![Example Screenshot](https://github.com/user-attachments/assets/ea85438d-5fcb-4eed-b90b-a4385675355d)
81+
- Corrected misaligned loading spinners.
82+
83+
- **Form Dropdowns**:
84+
- Resolved state retention after form resets, ensuring dropdowns reset correctly.
85+
86+
#### Usability Enhancements
87+
- Removed unnecessary padding around tables for cleaner layouts.
88+
- Increased spacing between items in the columns component for improved readability.
89+
- Database errors are now consistently logged and displayed with more actionable details.
90+
- ![better errors](https://github.com/user-attachments/assets/f0d2f9ef-9a30-4ff2-af3c-b33a375f2e9b)
91+
*Technical:* Ensures warnings in the browser and console for faster debugging.
92+
93+
---
94+
95+
## 0.30.1 (2024-10-31)
96+
- fix a bug where table sorting would break if table search was not also enabled.
97+
98+
## 0.30.0 (2024-10-30)
99+
100+
### 🤖 Easy APIs
101+
- **Enhanced CSV Support**: The [CSV component](https://sql.datapage.app/component.sql?component=csv) can now create URLs that trigger a CSV download directly on page load.
102+
- This finally makes it possible to allow the download of large datasets as CSV
103+
- This makes it possible to create an API that returns data as CSV and can be easily exposed to other software for interoperabily.
104+
- **Easy [json](https://sql.datapage.app/component.sql?component=json) APIs**
105+
- The json component now accepts a second sql query, and will return the results as a json array in a very resource-efficient manner. This makes it easier and faster than ever to build REST APIs entirely in SQL.
106+
- ```sql
107+
select 'json' as component;
108+
select * from users;
109+
```
110+
- ```json
111+
[ { "id": 0, "name": "Jon Snow" }, { "id": 1, "name": "Tyrion Lannister" } ]
112+
```
113+
- **Ease of use** : the component can now be used to automatically format any query result as a json array, without manually using your database''s json functions.
114+
- **server-sent events** : the component can now be used to stream query results to the client in real-time using server-sent events.
115+
116+
### 🔒 Database Connectivity
117+
- **Encrypted Microsoft SQL Server Connections**: SQLPage now supports encrypted connections to SQL Server databases, enabling connections to secure databases (e.g., those hosted on Azure).
118+
- **Separate Database Password Setting**: Added `database_password` [configuration option](https://github.com/sqlpage/SQLPage/blob/main/configuration.md) to store passwords securely outside the connection string. This is useful for security purposes, to avoid accidentally leaking the password in logs. This also allows setting the database password as an environment variable directly, without having to URL-encode it inside the connection string.
119+
120+
### 😎 Developer experience improvements
121+
- **Improved JSON Handling**: SQLPage now automatically converts JSON strings to JSON objects in databases like SQLite and MariaDB, making it easier to use JSON-based components.
122+
- ```sql
123+
-- Now works out of the box in SQLite
124+
select 'big_number' as component;
125+
select 'Daily performance' as title, perf as value;
126+
json_object(
127+
'label', 'Monthly',
128+
'link', 'monthly.sql'
129+
) as dropdown_item
130+
from performance;
131+
```
132+
133+
### 📈 Table & Search Improvements
134+
- **Initial Search Value**: Pre-fill the search bar with a default value in tables with `initial_search_value`, making it easier to set starting filters.
135+
- **Faster Sorting and Searching**: Table filtering and sorting has been entirely rewritten.
136+
- filtering is much faster for large datasets
137+
- sorting columns that contain images and links now works as expected
138+
- Since the new code is smaller, initial page loads should be slightly faster, even on pages that do not use tables
139+
140+
### 🖼️ UI & UX Improvements
141+
142+
- **[Carousel](https://sql.datapage.app/component.sql?component=carousel) Updates**:
143+
- Autoplay works as expected when embedded in a card.
144+
- Set image width and height to prevent layout shifts due to varying image sizes.
145+
- **Improved Site SEO**: The site title in the shell component is no longer in `<h1>` tags, which should aid search engines in understanding content better, and avoid confusing between the site name and the page's title.
146+
147+
### 🛠️ Fixes and improvements
4148
5-
- **Fix**: the search feature in the shell component was not working when no menu item was defined.
6-
- Add support for encrypted Microsoft SQL Server connections. This finally allows connecting to databases that refuse clear-text connections, such as those hosted on Azure.
7-
- Easier json handling in databases without a native json type. SQLPage now detects when you use a json function in SQLite or MariaDB to generate a column, and automatically converts the resulting string to a json object. This allows easily using components that take json parameters (like the new columns component) in MariaDB and SQLite.
8-
- Add a new optional `database_password` configuration option to set the password for the database connection separately from the connection string. This allows to keep the password separate from the connection string, which can be useful for security purposes, logging, and avoids having to percent-encode the password in the connection string.
149+
- **Shell Component Search**: Fixed search feature when no menu item is defined.
150+
- **Updated Icons**: The Tabler icon set has been refreshed from 3.10 to 3.21, making many new icons available: https://tabler.io/changelog
9151
10152
## 0.29.0 (2024-09-25)
11153
- New columns component: `columns`. Useful to display a comparison between items, or large key figures to an user.

0 commit comments

Comments
 (0)