This is a draft refactoring to avoid cloning large immutable data (headers,
cookies, body) when creating nested execution contexts in run_sql().
Changes:
- RequestInfo now contains only immutable request data
- ExecutionContext wraps Rc<RequestInfo> + mutable execution state
- Avoids cloning potentially large strings in nested run_sql() calls
Status: NOT COMPILING YET - this is work in progress
- URL and POST parameters are now immutable after request initialization
- SET command creates user-defined variables in separate namespace
- Variable lookup: SET variables shadow request parameters
- Added sqlpage.variables('set') to inspect user-defined variables
- Simplified API: most functions now use &RequestInfo instead of &mut
- All tests passing (151 total)
* Add support for PostgreSQL range types in SQL to JSON conversion
Co-authored-by: contact <contact@ophir.dev>
* add support for postgres range types
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
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
* wip: perf guide
* update guide
* Add materialized views section to performance guide
- Introduced a new section on materialized views, explaining their purpose and benefits for optimizing analytical queries.
- Added an example SQL statement for creating a materialized view to compute total sales per store.
- Provided guidance on refreshing materialized views manually or via external scripts.
* Document nginx streaming and compression for sqlpage (#1080)
* Docs: Add Nginx streaming and compression configuration
Co-authored-by: contact <contact@ophir.dev>
* Add NGINX streaming and compression configuration
Co-authored-by: contact <contact@ophir.dev>
* Refactor NGINX proxy settings documentation for clarity
Co-authored-by: contact <contact@ophir.dev>
* Refine NGINX proxy buffering recommendations for streaming
Co-authored-by: contact <contact@ophir.dev>
* Update NGINX proxy buffering settings for improved streaming performance
Revised the documentation to clarify the impact of enabling and disabling proxy buffering in NGINX for SQLPage. Added concise recommendations for handling slow SQL queries and emphasized the importance of adjusting `compress_responses` in `sqlpage.json` when using a reverse proxy.
Co-authored-by: contact <contact@ophir.dev>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Update dependencies and version for sqlpage to 0.39.1
- Bump versions of several dependencies including `aho-corasick`, `cc`, `clap`, `icu_collections`, and others to their latest releases.
- Update `Cargo.toml` to reflect the new version of sqlpage.
- Ensure compatibility with updated dependencies and improve overall project stability.
* fix handling of one-element arrays in doc code generator
see https://github.com/sqlpage/SQLPage/issues/1079
* In the table component, allow simple objects in custom_actions instead of requiring arrays of objects.
fix https://github.com/sqlpage/SQLPage/issues/1079
* Implement faster icon loading by inlining icons from the Tabler sprite. The previous method required downloading and parsing a large file, causing delays in icon rendering. Now, icons are generated and cached, improving page load times. Update the icon helper to utilize the new inline method.
* Update tabler icons to version 3.35 and refactor icon extraction logic for improved performance
* icon image helper: logging and error handling
- Changed debug logs to warning logs for invalid icon names and missing icons in the IconImgHelper.
- Updated the way icons are retrieved from the ICON_MAP for better clarity and performance.
* IconImgHelper: use raw string literals for SVG output
* Refactor icon extraction logic in build.rs to improve performance and memory usage. The download_tabler_icons function now directly processes sprite content in memory, eliminating the need for temporary file storage. Updated extract_icons_from_sprite to handle byte slices instead of strings, enhancing efficiency.
* build.rs: raise on missing icon id
* Simlplify icon generation in build.rs
* simplify icon _img helper
* update input field docs
fixes https://github.com/sqlpage/SQLPage/discussions/1081
* better form documentation
* fix ipv6 notation (#1084)
On Mac OS, when localhost:8080 is defined and sqlpage config file, the SocketAddr is resolved with ipv6 address if ip V6 is available on the internal network.
```json
{
"listen_on": "localhost:8080"
}
```
On the terminal we can Ctrl + Click, but the URL is incorrect (ipV6 notation use bracket)
Actually we have
```shell
View your website at:
🔗http://::1:8080
```
Instead of
```
View your website at:
🔗http://[::1]:8080
```
Regards,
* Update dependencies in Cargo.lock to latest versions
* Fix github pr ci cache warnings (#1086)
* feat: Add shared-key to cargo cache action
Co-authored-by: contact <contact@ophir.dev>
* Refactor: Use matrix-specific cache key in CI
Co-authored-by: contact <contact@ophir.dev>
* feat: Cache Rust build artifacts only on main branch
Co-authored-by: contact <contact@ophir.dev>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Enhance SQL performance guidance in migration script
- Added detailed recommendations for using primary and foreign keys, including examples for product and sales tables.
- Introduced best practices for indexing, query performance debugging, and database maintenance commands.
- Included advice on lazy loading and reducing the number of queries to optimize SQLPage applications.
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Christophe CHAUVET <christophe.chauvet@gmail.com>
On Mac OS, when localhost:8080 is defined and sqlpage config file, the SocketAddr is resolved with ipv6 address if ip V6 is available on the internal network.
```json
{
"listen_on": "localhost:8080"
}
```
On the terminal we can Ctrl + Click, but the URL is incorrect (ipV6 notation use bracket)
Actually we have
```shell
View your website at:
🔗http://::1:8080
```
Instead of
```
View your website at:
🔗http://[::1]:8080
```
Regards,
- Changed debug logs to warning logs for invalid icon names and missing icons in the IconImgHelper.
- Updated the way icons are retrieved from the ICON_MAP for better clarity and performance.
- Bump versions of several dependencies including `aho-corasick`, `cc`, `clap`, `icu_collections`, and others to their latest releases.
- Update `Cargo.toml` to reflect the new version of sqlpage.
- Ensure compatibility with updated dependencies and improve overall project stability.
* Docs: Add Nginx streaming and compression configuration
Co-authored-by: contact <contact@ophir.dev>
* Add NGINX streaming and compression configuration
Co-authored-by: contact <contact@ophir.dev>
* Refactor NGINX proxy settings documentation for clarity
Co-authored-by: contact <contact@ophir.dev>
* Refine NGINX proxy buffering recommendations for streaming
Co-authored-by: contact <contact@ophir.dev>
* Update NGINX proxy buffering settings for improved streaming performance
Revised the documentation to clarify the impact of enabling and disabling proxy buffering in NGINX for SQLPage. Added concise recommendations for handling slow SQL queries and emphasized the importance of adjusting `compress_responses` in `sqlpage.json` when using a reverse proxy.
Co-authored-by: contact <contact@ophir.dev>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
- Clarify the execution flow of SQL statements in SQLPage, detailing the decision-making process for handling statements.
- Expand on the role of `sqlpage.*` functions and their execution context.
- Improve explanations and examples to illustrate the differences between local handling and database execution.
- Update section titles for better readability and understanding.
- Refactor content for better clarity on how SQLPage processes SQL statements.
- Introduce sections on static simple selects, variable handling, and the execution of `sqlpage.*` functions.
- Improve examples to illustrate the differences between handled and sent queries.
- Enhance explanations regarding performance and data types in SQLPage.
- Recorded server timing for the parameter binding process in the query execution flow.
- Updated tests to verify the inclusion of the new timing event in the server timing header.
- Updated response handling to use a builder pattern for better clarity and consistency.
- Enhanced server timing format to include microseconds in the output.
- Added a new test for server timing in redirect responses to ensure proper header inclusion.
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
Add complete example with database schema, credential processing, and page protection. Update authentication migration to reference new login component. Enhance login template with default icons and autocomplete attributes. Make validate parameter optional with sensible default.