Skip to content

Commit 80da414

Browse files
committed
Make CHANGELOG more explicit about breaking changes with examples
1 parent 4476977 commit 80da414

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

CHANGELOG.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@
22

33
## unrelease
44
- **Variable System Improvements**: URL and POST parameters are now immutable, preventing accidental modification. User-defined variables created with `SET` remain mutable.
5-
- `$variable` now looks up SET variables first, then URL parameters. This ensures SET variables always take precedence.
6-
- `:variable` looks up SET variables first, then POST parameters.
7-
- `sqlpage.variables('get')` returns only URL parameters as JSON
8-
- `sqlpage.variables('post')` returns only POST parameters as JSON
9-
- `sqlpage.variables('set')` returns only user-defined variables as JSON
10-
- `sqlpage.variables()` returns all variables merged together, with SET variables taking precedence
11-
- Deprecation warnings added for ambiguous cases where both URL and POST parameters exist with the same name
5+
- **BREAKING**: `$variable` no longer accesses POST parameters. Use `:variable` instead.
6+
- **What changed**: Previously, `$x` would return a POST parameter value if no GET parameter named `x` existed.
7+
- **Fix**: Replace `$x` with `:x` when you need to access form field values.
8+
- **Example**: Change `SELECT $username` to `SELECT :username` when reading form submissions.
9+
- **BREAKING**: `SET $name` no longer overwrites POST parameters when a POST parameter with the same name exists.
10+
- **What changed**: `SET $name = 'value'` would previously overwrite the POST parameter `:name`. Now it creates an independent SET variable that shadows the POST parameter.
11+
- **Fix**: Either rename your SET variable, or use `:name` to access the original POST value if needed.
12+
- **Example**: If your form has a field named `name`, and you do `SET $name = 'modified'`, then `$name` will be 'modified' but `:name` will still contain the form value.
13+
- **New behavior**: Variable lookup now follows this precedence:
14+
- `$variable` checks SET variables first, then URL parameters
15+
- `:variable` checks SET variables first, then POST parameters
16+
- SET variables always shadow URL/POST parameters with the same name
17+
- **New sqlpage.variables() filters**:
18+
- `sqlpage.variables('get')` returns only URL parameters as JSON
19+
- `sqlpage.variables('post')` returns only POST parameters as JSON
20+
- `sqlpage.variables('set')` returns only user-defined SET variables as JSON
21+
- `sqlpage.variables()` returns all variables merged together, with SET variables taking precedence
22+
- **Deprecation warnings**: Using `$var` when both a URL parameter and POST parameter exist with the same name now shows a warning. In a future version, you'll need to explicitly choose between `$var` (URL) and `:var` (POST).
1223
- add support for postgres range types
1324

1425
## v0.39.1 (2025-11-08)

0 commit comments

Comments
 (0)