Core Concept: User writes .sql files, SQLPage executes queries, results mapped to handlebars UI components, HTML streamed to client
Mandatory formatting (rust): cargo fmt --all
Mandatory linting: cargo clippy --all-targets --all-features -- -D warnings
Frontend formatting: npm run format
More about testing: see github actions. Project structure: see contribution guide
NEVER reformat/lint/touch files unrelated to your task. Always run tests/lints/format before stopping when you changed code.
cargo test # tests with inmemory sqlite by default
For other databases, see docker testing setup
docker compose up -d mssql # or postgres or mysql
DATABASE_URL='mssql://root:Password123!@localhost/sqlpage' cargo test # all dbms use the same user:pass and db name
Components and functions are documented in official website; one migration per component and per function. You CAN update existing migrations, the official site database is recreated from scratch on each deployment.
official documentation website sql tables:
component(name,description,icon,introduced_in_version)-- icon name from tabler iconparameter(top_level BOOLEAN, name, component REFERENCES component(name), description, description_md, type, optional BOOLEAN)parameter types: BOOLEAN, COLOR, HTML, ICON, INTEGER, JSON, REAL, TEXT, TIMESTAMP, URLexample(component REFERENCES component(name), description, properties JSON)
- Components: defined in
./sqlpage/templates/*.handlebars - Functions:
src/webserver/database/sqlpage_functions/functions.rsregistered withmake_function!. - Configuration: see AppConfig
- Routing: file-based in
src/webserver/routing.rs; not found handled viasrc/default_404.sql. - Follow patterns from similar modules before introducing new abstractions.
- frontend: see css and js