Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .github/hurl-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ all_examples:
- 'src/webserver/database/sqlpage_functions/functions/user_info*.rs'
- 'src/webserver/database/sqlpage_functions/functions/oidc_logout_url.rs'

# The configuration reference is built from Rust field metadata.
'examples/official-site':
- 'src/app_config.rs'
- 'src/app_config/**'
- 'package*.json'
- 'configuration.md'

# A real proxy connects to SQLPage's Unix socket and rewrites pretty URLs.
'examples/nginx':
- 'src/app_config.rs'
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ jobs:
shared-key: rust-sqlpage-proj-test
save-if: ${{ github.ref == 'refs/heads/main' }}
- run: cargo fmt --all -- --check
- run: cargo test --locked --features config-schema --test mod configuration_docs
- run: cargo clippy --all-targets --all-features -- -D warnings
- name: Prepare official website
run: npm run site:build
- name: Upload prepared website
uses: actions/upload-artifact@v7
with:
name: official-site
path: target/official-site/
# The database matrix below runs the same Rust test harnesses against
# different DATABASE_URL values. Package the Linux test executables once
# here so those jobs do not recompile SQLPage or its dependencies.
Expand Down Expand Up @@ -147,6 +155,11 @@ jobs:
db_url: "Driver=DuckDB;Database=/tmp/sqlpage-test.duckdb"
steps:
- uses: actions/checkout@v7
- name: Download prepared website
uses: actions/download-artifact@v8
with:
name: official-site
path: target/official-site
# Reuse the exact Linux test harnesses produced by compile_and_lint.
# This keeps the DB matrix focused on database behavior instead of
# compiling the same Rust crate five more times.
Expand Down Expand Up @@ -185,6 +198,7 @@ jobs:
timeout-minutes: 5
run: scripts/run-test-binaries.sh ${{ matrix.test_args }}
env:
SQLPAGE_SITE_PREBUILT: 1
DATABASE_URL: ${{ matrix.db_url }}
MALLOC_CHECK_: 3
MALLOC_PERTURB_: 10
Expand Down Expand Up @@ -244,7 +258,14 @@ jobs:
with:
name: sqlpage-linux-debug
path: ${{ runner.temp }}/sqlpage-bin
- name: Download prepared website
uses: actions/download-artifact@v8
with:
name: official-site
path: target/official-site
- name: Run Playwright tests
env:
SQLPAGE_SITE_PREBUILT: 1
run: |
chmod +x "${{ runner.temp }}/sqlpage-bin/sqlpage"
SQLPAGE_BINARY="${{ runner.temp }}/sqlpage-bin/sqlpage" npx playwright test
Expand Down Expand Up @@ -417,6 +438,7 @@ jobs:
timeout-minutes: 15
needs:
- docker_build
- compile_and_lint
- hurl_examples
strategy:
fail-fast: false
Expand All @@ -443,7 +465,15 @@ jobs:
if [[ "$SQLPAGE_IMAGE_VARIANT" == minimal ]]; then
docker tag "${{ env.REGISTRY_IMAGE }}:main" "${{ env.REGISTRY_IMAGE }}:latest"
fi
- name: Download prepared website
if: matrix.example == 'examples/official-site'
uses: actions/download-artifact@v8
with:
name: official-site
path: target/official-site
- name: Run example Hurl test
env:
SQLPAGE_SITE_PREBUILT: 1
run: scripts/test-examples-hurl.sh "${{ matrix.example }}"

# Require this single check in branch protection instead of individual jobs.
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/official-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ jobs:
deploy_official_site:
runs-on: ubuntu-latest
steps:
- name: Cloning repo
uses: actions/checkout@v7
- name: Download tested website
uses: actions/download-artifact@v8
with:
fetch-depth: 0
name: official-site
- id: get_gitsha
name: Make a commit for the official site
name: Package the site for Dokku
run: |
cp -r examples/official-site /tmp/
rm -rf * .[!.]*
cp -r /tmp/official-site/* .
git init .
git init --initial-branch=main .
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git add .
Expand Down
9 changes: 4 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ relevant tests and the formatting/lint checks in CONTRIBUTING.md before stopping
Report unavailable checks and failures accurately; a test summary followed by a
hung process is a failure.

The official site in `examples/official-site/` is rebuilt from its SQL migrations
on deployment. Update the existing page or documentation migration for changed
behavior; add a migration only for new documentation content. Document user-visible
changes there and in configuration.md when applicable. Add a concise CHANGELOG.md
entry only for user-visible changes, and never edit an already tagged release.
Author official site references and examples under `examples/official-site/content/`.
Document configuration fields on `AppConfig`; the site build generates the option
reference. Keep setup instructions in `configuration.md`. Add a concise
CHANGELOG.md entry only for user-visible changes, and never edit a tagged release.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## unreleased

- The [configuration reference](https://sql-page.com/configuration) now lists server settings and their defaults directly from SQLPage. Search for a setting by name or link to it with a URL such as `/configuration#listen_on`.
- The first-website tutorial now lets you choose an installation target, copy a command, or download an archive for macOS, Windows, Linux, or AWS Lambda.
- Missing component pages on the official site return HTTP 404 and link to the catalog. Action buttons in colored alerts stay readable.
- The `shell` sidebar now uses `navbar_title` and preserves the colors of the supplied logo in dark mode.
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ behavior and validation in the pull request. Keep changes and formatting focused
Architectural constraints and documentation maintenance rules are in
[AGENTS.md](./AGENTS.md).

User documentation lives in [the official-site SQL pages and migrations](./examples/official-site/).
Edit existing documentation in place: deployment recreates the site database.
Use nearby entries as examples rather than copying schemas into this guide. Update
[configuration.md](./configuration.md) for configuration changes and
[CHANGELOG.md](./CHANGELOG.md) for user-visible changes in an unreleased version.
Edit the [official site content](./examples/official-site/content/) to document components,
functions, and examples. Document configuration options on the Rust fields of
[`AppConfig`](./src/app_config.rs). Use [configuration.md](./configuration.md) for
setup guides. Run `npm run site` to preview edits. See the [site README](./examples/official-site/README.md)
for the authoring format. Update [CHANGELOG.md](./CHANGELOG.md) for user-visible changes.
25 changes: 25 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ tokio = { version = "1.24.1", features = ["macros", "rt", "process", "sync"] }
tokio-stream = "0.1.9"
anyhow = "1"
serde = "1"
schemars = { version = "1", optional = true }
serde_json = { version = "1.0.82", features = [
"preserve_order",
"raw_value",
Expand Down Expand Up @@ -137,6 +138,7 @@ opentelemetry-semantic-conventions = { version = "0.33", features = ["semconv_ex

[features]
default = []
config-schema = ["dep:schemars"]
odbc-static = ["odbc-sys", "odbc-sys/vendored-unix-odbc"]
lambda-web = [
"dep:actix-http",
Expand All @@ -151,3 +153,7 @@ actix-http = "3"
tempfile = "3"
tokio = { version = "1", features = ["rt", "time", "test-util"] }

[[example]]
name = "export_config_schema"
required-features = ["config-schema"]

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ select

## Supported databases

- [SQLite](https://www.sqlite.org/index.html), including the ability to [load extensions](./configuration.md) such as *Spatialite*.
- [SQLite](https://www.sqlite.org/index.html), including the ability to [load extensions](https://sql-page.com/configuration#sqlite_extensions) such as *Spatialite*.
- [PostgreSQL](https://www.postgresql.org/), and other compatible databases such as *YugabyteDB*, *CockroachDB* and *Aurora*.
- [MySQL](https://www.mysql.com/), and other compatible databases such as *MariaDB* and *TiDB*.
- [Microsoft SQL Server](https://www.microsoft.com/en-us/sql-server), and all compatible databases and providers such as *Azure SQL* and *Amazon RDS*.
Expand Down Expand Up @@ -218,7 +218,7 @@ You still need to install or provide the database-specific ODBC driver for the d
- Find your [connection string](https://www.connectionstrings.com/).
- It will look like this: `Driver=/opt/snowflake_odbc/lib/libSnowflake.so;Server=xyz.snowflakecomputing.com;Database=MY_DB;Schema=PUBLIC;UID=my_user;PWD=my_password`
- It must reference the path to the database driver you installed earlier, plus any connection parameter required by the driver itself. Follow the instructions from the driver's own documentation.
- Use it in the [DATABASE_URL configuration option](./configuration.md)
- Use it in the [DATABASE_URL configuration option](https://sql-page.com/configuration#database_url)


## How it works
Expand Down
Loading
Loading