Skip to content

Commit b3e6bfb

Browse files
committed
Generate a configuration reference from the Rust settings schema
1 parent 732163f commit b3e6bfb

33 files changed

Lines changed: 486 additions & 217 deletions

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ jobs:
6262
with:
6363
shared-key: rust-sqlpage-proj-test
6464
save-if: ${{ github.ref == 'refs/heads/main' }}
65+
- run: sudo apt-get update && sudo apt-get install -y unixodbc-dev
6566
- run: cargo fmt --all -- --check
6667
- run: cargo clippy --all-targets --all-features -- -D warnings
6768
- name: Prepare and check official website
6869
run: npm run site:test
70+
- name: Check the configuration schema against Serde
71+
run: cargo test --locked --features config-schema --test mod configuration_docs
6972
- name: Upload prepared website
7073
uses: actions/upload-artifact@v7
7174
with:

‎AGENTS.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ Update the existing documentation page or its authored source under
4242
`examples/official-site/content/` for changed behavior.
4343

4444
Build and preview the official site with the commands in its [README](./examples/official-site/README.md).
45-
Update `configuration.md` for configuration changes.
45+
Document server settings on `AppConfig`, where the site build reads them.
46+
Update `configuration.md` for setup changes.
4647

4748
Add a concise CHANGELOG.md entry only for user-visible changes to SQLPage itself,
4849
and never edit an already tagged release. Be careful: sometimes a tiny subdependency

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,6 @@ seed and the site's checked-in migrations.
116116

117117
Run `npm run site` to preview changes using the same site build as deployment.
118118

119-
Update [configuration.md](./configuration.md) for configuration changes and
120-
[CHANGELOG.md](./CHANGELOG.md) for user-visible changes in an unreleased version.
119+
Document settings on `AppConfig` and keep setup instructions in
120+
[configuration.md](./configuration.md). Update [CHANGELOG.md](./CHANGELOG.md)
121+
for user-visible changes to SQLPage in an unreleased version.

‎Cargo.lock‎

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ tokio = { version = "1.24.1", features = ["macros", "rt", "process", "sync"] }
6262
tokio-stream = "0.1.9"
6363
anyhow = "1"
6464
serde = "1"
65+
schemars = { version = "1", optional = true }
6566
serde_json = { version = "1.0.82", features = [
6667
"preserve_order",
6768
"raw_value",
@@ -137,6 +138,7 @@ opentelemetry-semantic-conventions = { version = "0.33", features = ["semconv_ex
137138

138139
[features]
139140
default = []
141+
config-schema = ["dep:schemars"]
140142
odbc-static = ["odbc-sys", "odbc-sys/vendored-unix-odbc"]
141143
lambda-web = [
142144
"dep:actix-http",
@@ -151,3 +153,7 @@ actix-http = "3"
151153
tempfile = "3"
152154
tokio = { version = "1", features = ["rt", "time", "test-util"] }
153155

156+
[[example]]
157+
name = "configuration_reference"
158+
path = "examples/configuration_reference.rs"
159+
required-features = ["config-schema"]

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ select
124124

125125
## Supported databases
126126

127-
- [SQLite](https://www.sqlite.org/index.html), including the ability to [load extensions](./configuration.md) such as *Spatialite*.
127+
- [SQLite](https://www.sqlite.org/index.html), including the ability to [load extensions](https://sql-page.com/configuration#sqlite_extensions) such as *Spatialite*.
128128
- [PostgreSQL](https://www.postgresql.org/), and other compatible databases such as *YugabyteDB*, *CockroachDB* and *Aurora*.
129129
- [MySQL](https://www.mysql.com/), and other compatible databases such as *MariaDB* and *TiDB*.
130130
- [Microsoft SQL Server](https://www.microsoft.com/en-us/sql-server), and all compatible databases and providers such as *Azure SQL* and *Amazon RDS*.
@@ -218,7 +218,7 @@ You still need to install or provide the database-specific ODBC driver for the d
218218
- Find your [connection string](https://www.connectionstrings.com/).
219219
- 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`
220220
- 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.
221-
- Use it in the [DATABASE_URL configuration option](./configuration.md)
221+
- Use it in the [DATABASE_URL configuration option](https://sql-page.com/configuration#database_url)
222222
223223
224224
## How it works

0 commit comments

Comments
 (0)