- Switched from ngx_log_error_core() to ngx_log_error! macro
- Changed error_log level from debug to info (cleaner output)
- Formatting cleanup across all modules (cargo fmt)
- Removed trailing newlines and fixed indentation
Logging now properly uses nginx's macro system for better
integration with nginx's log handling.
- New sqlite_serve.conf: all features on single port 8080
- New zenburn.css: hex color palette, all styles in one cacheable file
- New Zenburn templates: header/footer/card partials
- New start.sh: unified launcher with all endpoint docs
- Removed 3 separate example configs and start scripts
15 files changed, 980 insertions(+), 258 deletions(-)
New Feature: Named SQL Parameters
- Supports both positional (?) and named (:name) parameters
- Named parameters are order-independent and more readable
- Syntax: sqlite_param :param_name $variable
Implementation:
- Updated sqlite_param directive to accept 1 or 2 arguments
- ModuleConfig.query_params now stores (name, variable) pairs
- execute_query() detects named vs positional parameters
- Extracted row_to_map closure to avoid type conflicts
- Named params use rusqlite named parameter binding
Examples (Port 8082):
- Book detail: WHERE id = :book_id
- Genre filter: WHERE genre = :genre_name
- Year range: WHERE year >= :min_year AND year <= :max_year
- Title search: WHERE title LIKE '%' || :search_term || '%'
- Rating filter: WHERE rating >= :min_rating
Benefits of Named Parameters:
- Order-independent: params can be in any order in config
- Self-documenting: :book_id is clearer than first ?
- Maintainable: can add/remove params without reordering
- Recommended for all but simplest queries
Configuration:
- conf/book_named_params.conf: Complete named params example
- start_named_params.sh: Quick start script for port 8082
Documentation:
- Added named vs positional comparison in README_PARAMETERS.md
- Updated README.md with named parameter examples
- Documented both syntaxes in directive reference
All examples tested and working with both parameter styles.
- Updated package name in Cargo.toml: nginx-test → sqlite-serve
- Updated library name: libnginx_test.dylib → libsqlite_serve.dylib
- Updated all load_module directives in nginx configs
- Updated build checks in start scripts
- Updated branding in footer template
- Updated project name in all README files
The name 'sqlite-serve' better reflects the module's purpose:
serving dynamic content from SQLite databases via NGINX.
- Update HttpModule trait implementation to match ngx 0.5.0 API
- Implement HttpModuleLocationConf as separate unsafe trait
- Fix configuration access using Module::location_conf()
- Replace ngx_null_command macro with explicit null command
- Update imports to use correct constant names
- Suppress C FFI naming convention warnings