Rename project from nginx-test to sqlite-serve

- 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.
This commit is contained in:
Edward Langley
2025-11-15 15:11:44 -08:00
parent 7a169e34d5
commit 775467da51
12 changed files with 24 additions and 26 deletions

22
Cargo.lock generated
View File

@ -373,17 +373,6 @@ dependencies = [
"shlex", "shlex",
] ]
[[package]]
name = "nginx-test"
version = "0.1.0"
dependencies = [
"handlebars",
"ngx",
"rusqlite",
"serde",
"serde_json",
]
[[package]] [[package]]
name = "ngx" name = "ngx"
version = "0.5.0" version = "0.5.0"
@ -624,6 +613,17 @@ version = "1.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
[[package]]
name = "sqlite-serve"
version = "0.1.0"
dependencies = [
"handlebars",
"ngx",
"rusqlite",
"serde",
"serde_json",
]
[[package]] [[package]]
name = "strsim" name = "strsim"
version = "0.11.1" version = "0.11.1"

View File

@ -1,5 +1,5 @@
[package] [package]
name = "nginx-test" name = "sqlite-serve"
version = "0.1.0" version = "0.1.0"
edition = "2024" edition = "2024"

View File

@ -1,4 +1,4 @@
# nginx-test - SQLite Module for NGINX # sqlite-serve - SQLite Module for NGINX
A dynamic NGINX module written in Rust that integrates SQLite databases with Handlebars templating, enabling data-driven web applications directly from NGINX configuration. A dynamic NGINX module written in Rust that integrates SQLite databases with Handlebars templating, enabling data-driven web applications directly from NGINX configuration.
@ -251,7 +251,7 @@ Request → NGINX → Module Handler → SQLite Query
## Project Structure ## Project Structure
``` ```
nginx-test/ sqlite-serve/
├── src/ ├── src/
│ └── lib.rs # Module implementation │ └── lib.rs # Module implementation
├── conf/ ├── conf/

View File

@ -1,6 +1,6 @@
# Book Catalog Example # Book Catalog Example
A complete example demonstrating the nginx-test SQLite module with a read-only book catalog. A complete example demonstrating the sqlite-serve module with a read-only book catalog.
## Features ## Features
@ -54,7 +54,7 @@ Open your browser to:
## Directory Structure ## Directory Structure
``` ```
nginx-test/ sqlite-serve/
├── book_catalog.db # SQLite database ├── book_catalog.db # SQLite database
├── setup_book_catalog.sh # Database setup script ├── setup_book_catalog.sh # Database setup script
├── conf/ ├── conf/

View File

@ -1,6 +1,6 @@
# Path Parameters Feature # Path Parameters Feature
The nginx-test SQLite module supports parameterized SQL queries using nginx variables. This allows you to pass dynamic values from the request (query parameters, path captures, headers, etc.) as safe SQL prepared statement parameters. The sqlite-serve module supports parameterized SQL queries using nginx variables. This allows you to pass dynamic values from the request (query parameters, path captures, headers, etc.) as safe SQL prepared statement parameters.
## New Directive ## New Directive

View File

@ -1,7 +1,7 @@
# Book Catalog Configuration # Book Catalog Configuration
# Demonstrates the nginx-test SQLite module with multiple locations and template inheritance # Demonstrates the sqlite-serve module with multiple locations and template inheritance
load_module target/debug/libnginx_test.dylib; load_module target/debug/libsqlite_serve.dylib;
worker_processes 1; worker_processes 1;
events {} events {}

View File

@ -1,7 +1,7 @@
# Book Detail Configuration # Book Detail Configuration
# Demonstrates using path parameters with the SQLite module # Demonstrates using path parameters with the SQLite module
load_module target/debug/libnginx_test.dylib; load_module target/debug/libsqlite_serve.dylib;
worker_processes 1; worker_processes 1;
events {} events {}

View File

@ -1,5 +1,5 @@
# Add the path to your library here. # Add the path to your library here.
load_module target/debug/libnginx_test.dylib; load_module target/debug/libsqlite_serve.dylib;
worker_processes 1; worker_processes 1;

View File

@ -1,6 +1,6 @@
</main> </main>
<footer style="background: #f8f9fa; padding: 2rem; text-align: center; border-top: 2px solid #e9ecef; color: #6c757d;"> <footer style="background: #f8f9fa; padding: 2rem; text-align: center; border-top: 2px solid #e9ecef; color: #6c757d;">
<p>📖 Powered by nginx-test SQLite Module</p> <p>📖 Powered by sqlite-serve</p>
<p style="margin-top: 0.5rem; font-size: 0.9rem;">A demonstration of Rust + NGINX + SQLite + Handlebars</p> <p style="margin-top: 0.5rem; font-size: 0.9rem;">A demonstration of Rust + NGINX + SQLite + Handlebars</p>
</footer> </footer>
</div> </div>

View File

@ -407,8 +407,6 @@ http_request_handler!(howto_access_handler, |request: &mut http::Request| {
.unwrap_or(""); .unwrap_or("");
// Resolve query parameters from nginx variables // Resolve query parameters from nginx variables
let _ = std::fs::write("/tmp/nginx_debug.txt", format!("Query: {}\nParams: {:?}\n", co.query, co.query_params));
let mut param_values: Vec<String> = Vec::new(); let mut param_values: Vec<String> = Vec::new();
for var_name in &co.query_params { for var_name in &co.query_params {
let value = if var_name.starts_with('$') { let value = if var_name.starts_with('$') {

View File

@ -14,7 +14,7 @@ if [ ! -f "book_catalog.db" ]; then
fi fi
# Check if module is built # Check if module is built
if [ ! -f "target/debug/libnginx_test.dylib" ]; then if [ ! -f "target/debug/libsqlite_serve.dylib" ]; then
echo "Module not built. Building..." echo "Module not built. Building..."
direnv exec "$PWD" cargo build direnv exec "$PWD" cargo build
echo "" echo ""

View File

@ -14,7 +14,7 @@ if [ ! -f "book_catalog.db" ]; then
fi fi
# Check if module is built # Check if module is built
if [ ! -f "target/debug/libnginx_test.dylib" ]; then if [ ! -f "target/debug/libsqlite_serve.dylib" ]; then
echo "Module not built. Building..." echo "Module not built. Building..."
direnv exec "$PWD" cargo build direnv exec "$PWD" cargo build
echo "" echo ""