2943 Commits

Author SHA1 Message Date
Prayag Bhakar f7ebba6230 fix(fetch_with_meta) :: document json bodies under json_body (#1393) 2026-08-23 17:42:39 +02:00
Ophir LOJKINE bca732e98f fix(ci): avoid rebuilding email example image (#1400) 2026-08-23 17:42:09 +02:00
Ophir Lojkine dface22adb chore: update git blame ignore revisions 2026-08-23 15:29:05 +00:00
Prayag Bhakar 9690e3cf23 fix(rust) :: format the files cargo fmt could not see (#1378)
* fix(functions) :: don't use macro to import and build SqlPageFunctionName

* fix(rust) :: format codebase
2026-08-23 17:23:56 +02:00
Ophir LOJKINE 0f7eba52e3 fix(config): support list options from environment variables (#1399)
* fix(config) :: support list options from environment variables

* test(config) :: remove list environment regression test
2026-08-23 17:22:50 +02:00
Ophir LOJKINE ae69528f5d Stop casting variables to TEXT on PostgreSQL, MySQL and SQL Server (#1397)
* feat(database) :: stop casting variables to TEXT on PostgreSQL, MySQL and SQL Server

SQLPage binds every variable as a string. The generated CAST(? AS TEXT)
forced the database to type the parameter as text, which is only needed
where parameter type inference is unpredictable (SQLite, ODBC). On the
natively supported databases the cast was redundant, and on SQL Server it
was harmful: the parameter is bound as NVARCHAR(MAX), and casting it to a
narrow VARCHAR mangled non-ASCII values before comparing them to nvarchar
columns. Generated SQL is now cleaner, e.g. WHERE id = $1 instead of
WHERE id = CAST($1 AS TEXT).

SQLite and ODBC-backed databases (Oracle, DuckDB, Snowflake, Generic)
keep the cast to preserve their comparison semantics.

Verified with the full test suite against SQLite, PostgreSQL, MySQL and
SQL Server, including new fixtures for integer-column comparisons,
numeric-literal comparisons, and unicode nvarchar comparisons on SQL
Server.

* fix(odbc) :: keep the text cast around variables on ODBC connections

The ODBC job in CI failed because the cast was removed based on the
database name behind the driver: PostgreSQL reached through psqlodbc no
longer received CAST(? AS TEXT), and the driver could not determine the
type of context-free parameters such as in 'WHERE ? <> ? OR ? IS NULL',
failing with 'could not determine data type of parameter'.

The cast decision now keys off the connection kind: native PostgreSQL,
MySQL and SQL Server connections keep no cast, while every ODBC
connection keeps the previous per-database cast, since ODBC drivers
provide no parameter type information.

Adds a fixture comparing variables without any surrounding type context,
which exercises exactly this scenario on every database.

* refine: drop the text cast on MySQL, SQL Server and DuckDB behind ODBC too

ODBC connections were conservatively keeping the cast for every database.
Testing against real ODBC drivers shows the cast is needed only where the
parameter type cannot be determined without it:

- psqlodbc -> PostgreSQL: needed. Without it, context-free parameters fail
  with 'could not determine data type of parameter' (the earlier CI failure).
- sqliteodbc -> SQLite: needed. Without it, '? = 1' compares text against an
  integer and silently returns false, like on native SQLite.
- duckdb-odbc: not needed. The full test suite passes without the cast, as
  DuckDB defaults untyped parameters to VARCHAR.

The cast is therefore dropped for MySQL, SQL Server and DuckDB behind ODBC,
mirroring their native behavior (MySQL and SQL Server convert the bound
string at execution time, which also fixes the unicode mangling for SQL
Server reached through ODBC), and kept for PostgreSQL, SQLite, Oracle,
Snowflake and unknown databases.

Verified with the full test suite on native SQLite, PostgreSQL, MySQL and
SQL Server, and through ODBC on PostgreSQL, SQLite and DuckDB. The only
ODBC failure is a pre-existing database-filesystem timestamp test that also
fails on main.

* docs(changelog): make variable cast entry concise and user-oriented

The previous entry described internal CAST(? AS TEXT) generation
and load-bearing type affinity details. Rephrase for users:
focus on the visible fix (MSSQL nvarchar Unicode mangling)
and the general simplification (no unnecessary text cast
where the database infers the type).

* docs(changelog): add issue references for variable cast fix

Fixes: #516 (CONTAINS with MSSQL variable fails due to CAST), #1154
(LIMIT/OFFSET with variables fails on MySQL/MariaDB).
See: #1317 (per-database logic still scattered, this is a step
toward the SqlDialect abstraction).

* test: simplify variable cast tests and add focused repros for #516 and #1154

- Replace verbose pattern-matching in sql.rs with helpers sql_for/
  odbc_sql_for and table-driven asserts; keep coverage but drop
  ceremony and duplicated error messages.
- Keep limit and mssql tests as one-liners checking the generated
  SQL string.
- Trim .sql fixtures to minimal scaffold and add GH issue links as
  comments. New fixtures:
  * variable_limit_offset (MySQL, fixes #1154) — LIMIT/OFFSET with SET
    variables must not be wrapped in CAST.
  * variable_mssql_contains (MSSQL, fixes #516) — EXEC sp_executesql
    with a variable must not be wrapped in CAST.
- Simplify existing variable fixtures and add issue links, keep them
  short and readable.

* test: make variable fixtures self-contained

Remove 'same root cause' and inaccurate GH links that referenced
other files. Each fixture now describes its own invariant without
assuming reader context from another file.

* fix: mssql test escaping and improve changelog

- Fix variable_mssql_contains test: avoid nested single quotes in
  sp_executesql string that caused 'Incorrect syntax near It' on
  CI. Use parameterised expected value instead of embedding
  'It works !' inside the inner N'...' string.

- Improve CHANGELOG: one main bullet about removing CAST with
  subpoints for PostgreSQL/MySQL/DuckDB, SQL Server nvarchar/
  CONTAINS/EXEC, MySQL LIMIT/OFFSET, and retained cast on SQLite/
  ODBC. Move fixes:/see: to PR description.

* Refactor SQL variable cast tests to use typed assertions

* clippy

* Move database-specific SQL tests into per-database subdirectories

Restructure tests so files that only work on a single database engine
are
organized under `database-specific/<engine>/` instead of using long
`_no...`
suffixes. Add a dedicated test that runs these files only when the
current
database matches, and simplify the generic test runner by extracting
shared
execution logic.

* rename mssql variable fixture to match its sp_executesql repro

The file reproduces issue #516 (CONTAINS rejects CAST expressions), but
the query itself uses sp_executesql, which has the same restriction
without needing a full-text index. Rename the fixture to reflect that
and add a comment explaining why CONTAINS is not used directly.
2026-08-23 16:55:00 +02:00
Ophir LOJKINE 217286f8a8 fix(datagrid): distinguish missing and empty descriptions (#1398) 2026-08-23 16:53:05 +02:00
Prayag Bhakar 29b1b12439 fix(config) :: document the real configuration defaults' (#1391)
* fix(config) :: document the real configuration defaults'

* rev2 (please squash + merge)

---------

Co-authored-by: Ophir LOJKINE <contact@ophir.dev>
2026-08-23 09:58:25 +02:00
Prayag Bhakar 2c2819f29e feat(chart) :: draw horizontal reference lines (#1375)
* feat(chart) :: draw horizontal reference lines

* rev 2 (please squash + merge)
2026-08-23 09:34:02 +02:00
Prayag Bhakar 6fb9a35336 fix(rust): enforce lint on all files + fix lint issues (#1394) 2026-08-21 07:38:45 +02:00
Prayag Bhakar 071d4df034 fix(docs) :: address documentation gaps (#1390) 2026-08-20 11:06:02 +02:00
Prayag Bhakar e99957bc93 fix(request_body) :: return NULL when the request has no body' (#1392) 2026-08-18 12:39:54 +02:00
Ophir LOJKINE 6859b560ee fix(form): close searchable single-select dropdown (#1381)
* fix(form) :: close searchable single-select dropdown

* fix and test properly
2026-08-17 14:41:57 +02:00
Prayag Bhakar 71609f2251 feat(typescript) :: typecheck browser JavaScript in CI (#1373) 2026-08-14 22:48:38 +02:00
Prayag Bhakar bfd6d33812 fix(npm) :: install dependencies only once at root level (#1372) 2026-08-13 10:29:29 +02:00
Prayag Bhakar e15b16d211 fix(chart) :: line series up on a category axis for every chart type (#1371) 2026-08-13 09:27:51 +02:00
Ophir LOJKINE f603aa88e5 thank you very much @81reap!
fix(chart) :: align stacked series on their X values
2026-08-12 15:55:18 +02:00
81reap 8b7eb16bd7 fix(chart) :: align stacked series on their X values 2026-08-11 20:02:59 -04:00
Prayag Bhakar b8f10adc7f feat(chart) :: render column charts as bar charts + filter malformed stack points (#1369) 2026-08-11 17:59:15 +02:00
Prayag Bhakar 98fc68a781 fix(map) :: ignore map coordinates that are not a pair of numbers (#1368) 2026-08-10 21:48:42 +02:00
Prayag Bhakar e44f993a20 fix(modal) :: give modal component an accessible name (#1367)
* fix(biome.js) :: fix remaining lint issues

* fix(modal) :: give modal component an accessible name
2026-08-10 17:14:47 +02:00
Prayag Bhakar fb519dc347 fix(biome.js) :: fix remaining lint issues (#1366) 2026-08-10 14:59:42 +02:00
Ophir LOJKINE 7457370b8d Add toast notification component with JS init, template, examples, migration, and tests (#1360)
* Support hash-triggered toasts

* Address toast review feedback

* Render toast positioning in template

* Avoid reopening initialized toasts

* Fix white toast foreground color

* Configure toasts declaratively

* Simplify toast template styling

* Address toast accessibility reviews
2026-08-03 15:50:18 +02:00
Ophir LOJKINE ae3c3c874f Update AWS Lambda runtime to Amazon Linux 2023 (#1361)
* Update AWS Lambda runtime to Amazon Linux 2023

* Fix AWS Lambda release packaging
2026-08-02 19:37:08 +02:00
Ophir LOJKINE a065bb8d0f Fix form options source query parameters (#1356) 2026-07-29 11:37:36 +02:00
lovasoa 217702550e update deps 2026-07-25 23:36:05 +02:00
lovasoa b12b85f5db improve docs 2026-07-25 23:28:30 +02:00
lovasoa 0e9673a6ff Add body_md parameter to sqlpage.send_mail
Renders Markdown to HTML and sends as multipart/alternative
with raw Markdown as the plain-text body. When body_md is
provided, body becomes optional. body_md cannot be combined
with body_html.
2026-07-25 00:12:28 +02:00
lovasoa e60fda48c0 update send mail docs 2026-07-24 23:57:13 +02:00
lovasoa c6554a213d Add HTML body alternative to send_mail
The optional `body_html` field sends a multipart/alternative
message alongside the plain-text `body`, which remains required.
2026-07-24 23:51:43 +02:00
Ophir LOJKINE dadb3228fe v0,45: update deps and changelog
deploy website / deploy_official_site (push) Has been cancelled
Create Release / Build sqlpage binaries (macOS & Windows) (.exe, , windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
Create Release / Build sqlpage binaries (macOS & Windows) (odbc-static, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
Create Release / Build sqlpage binaries (Linux) (push) Has been cancelled
Create Release / Build AWS Lambda Serverless zip image (push) Has been cancelled
Create Release / Create Github Release (push) Has been cancelled
Create Release / Publish to crates.io (push) Has been cancelled
CI / compile_and_lint (push) Has been cancelled
CI / test (, sqlite, sqlite::memory:) (push) Has been cancelled
CI / test (mssql, mssql, mssql://root:Password123!@127.0.0.1/sqlpage) (push) Has been cancelled
CI / test (mysql, mysql, mysql://root:Password123!@127.0.0.1/sqlpage) (push) Has been cancelled
CI / test (oracle, oracle, Driver=Oracle 21 ODBC driver;Dbq=//127.0.0.1:1521/FREEPDB1;Uid=root;Pwd=Password123!) (push) Has been cancelled
CI / test (postgres, odbc, Driver=PostgreSQL Unicode;Server=127.0.0.1;Port=5432;Database=sqlpage;UID=root;PWD=Password123!, true) (push) Has been cancelled
CI / test (postgres, postgres, postgres://root:Password123!@127.0.0.1/sqlpage) (push) Has been cancelled
CI / windows_test (push) Has been cancelled
CI / playwright (push) Has been cancelled
CI / docker_build (linux/amd64, -linux-amd64-duckdb, duckdb) (push) Has been cancelled
CI / docker_build (linux/arm/v7, -linux-arm-v7, minimal) (push) Has been cancelled
CI / docker_build (linux/arm64, -linux-arm64, minimal) (push) Has been cancelled
CI / docker_build (linux/arm64, -linux-arm64-duckdb, duckdb) (push) Has been cancelled
CI / docker_build (linux/amd64, minimal) (push) Has been cancelled
CI / hurl_examples (push) Has been cancelled
CI / hurl (${{ matrix.example }}) (push) Has been cancelled
CI / docker_push (duckdb) (push) Has been cancelled
CI / docker_push (minimal) (push) Has been cancelled
v0.45.0
2026-07-21 22:00:25 +02:00
Ophir LOJKINE 83cb41b4a7 Document dependency optimization results
Matched clean macOS arm64 release builds reduced the default executable from 43,037,040 to 42,850,608 bytes (-0.43%) and wall time from 390.23 to 384.16 seconds (-1.56%).
2026-07-18 00:15:30 +02:00
Ophir LOJKINE b113f3c213 Update frontend development dependencies
Update Biome to 2.5.4 and Playwright to 1.61.1, align type definitions with Node 24, and exclude SVG assets that the new Biome release starts parsing from the existing lint scope.
2026-07-18 00:07:30 +02:00
Ophir LOJKINE e6302767e8 Pin CI to Node 24
Use the same explicit LTS release for lint and Playwright jobs, cache the root npm install, and install only Chromium's headless shell in browser-test CI.
2026-07-18 00:05:43 +02:00
Ophir LOJKINE aa83898bf1 Disable unused CSV serde support
SQLPage reads CSV string records directly and never uses csv-async's serde deserializer, so disable that default feature and its itoa/ryu hooks.

macOS arm64 cargo build --release: 42,858,832 -> 42,850,608 bytes (-8,224 bytes, -0.02%).
2026-07-18 00:05:14 +02:00
Ophir LOJKINE 85fef09f8e Disable unused multipart derive support
Keep actix-multipart's tempfile field reader used by uploads without compiling its unused derive proc macro or bytesize helper.

macOS arm64 cargo build --release: 42,858,960 -> 42,858,832 bytes (-128 bytes).
2026-07-18 00:03:05 +02:00
Ophir LOJKINE f3f9085ba1 Remove unused async and build dependencies
Drop the unused async-recursion proc macro and the redundant build-only futures-util declaration. The build script accesses no futures-util APIs, and awc still brings the implementation it needs transitively.

macOS arm64 cargo build --release: 42,859,984 -> 42,858,960 bytes (-1,024 bytes).
2026-07-18 00:00:21 +02:00
Ophir LOJKINE e257d06c2b Limit configuration parsers to documented formats
Disable config's default INI, RON, async-source, and case-conversion features while retaining JSON, JSON5, TOML, and YAML. Document that previously accepted but unsupported INI and RON files must be migrated.

macOS arm64 cargo build --release: 43,020,288 -> 42,859,984 bytes (-160,304 bytes, -0.37%).
2026-07-17 23:57:54 +02:00
Ophir LOJKINE 91a28d1631 Remove unused SQLx macro facade
Depend directly on sqlx-core-oldapi and use its module-level runtime APIs. SQLPage uses no SQLx query or derive macros, so this removes sqlx-oldapi and sqlx-macros-oldapi from the resolved graph.

macOS arm64 cargo build --release: 43,037,040 -> 43,020,288 bytes (-16,752 bytes, -0.04%).
2026-07-17 23:54:40 +02:00
Ophir LOJKINE 69699b23cb Replace stale Lambda web adapter
Use AWS-maintained lambda_http for event and Runtime API handling, with a small channel-backed bridge to the non-Send Actix service. This adds maintained support for API Gateway v1/v2/WebSockets, ALB, Function URLs, and VPC Lattice while preserving duplicate headers and binary responses.

Stripped macOS arm64 release with --features lambda-web: 37,231,944 -> 36,657,200 bytes (-574,744 bytes, -1.5%).
2026-07-17 23:48:42 +02:00
Ophir LOJKINE 98f15b9566 v0.45 2026-07-17 22:43:03 +02:00
Ophir LOJKINE e704af902b Update dependencies 2026-07-17 22:40:37 +02:00
Ophir LOJKINE d3ea2a24db Merge pull request #1346 from sqlpage/add-documented-send_mail-function
Add SMTP `send_mail` SQL function with configuration and lettre integration
2026-07-17 22:39:10 +02:00
Ophir LOJKINE 889277f942 Support dev profile in Docker builds 2026-07-17 21:46:11 +02:00
Ophir LOJKINE 71d0837117 Link email results to Mailpit 2026-07-17 21:44:52 +02:00
Ophir LOJKINE e71fe455d3 build mail example from repo source 2026-07-17 21:14:34 +02:00
Ophir LOJKINE e8e590d340 Expand sending email example 2026-07-17 15:36:15 +02:00
Ophir LOJKINE 93afed919c Email sending improvement 2026-07-17 15:22:53 +02:00
Ophir LOJKINE 1839738f67 Merge branch 'main' into add-documented-send_mail-function 2026-07-17 13:53:51 +02:00
Ophir LOJKINE 214a986adf Merge remote-tracking branch 'origin/main' into add-documented-send_mail-function 2026-07-17 13:40:14 +02:00