Repository navigation
Conversation
…served for async)
Meta.plan was required, so a row inserted with only id and email (meta defaults to '{}')
made GET / fail with a decode error. plan is optional and still serialises as {}, matching
the JS example's response.
wit submodule -> FastEdge-wit e41118a. Same API; example db_sql renamed to db_postgres.
…the WIT wit → FastEdge-wit a23194c. Column.type_name replaces type_oid; example db_sql_postgres (named after its dialect). Secret FASTEDGE_DB_SQL_<name>.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Invalid input in the PostgreSQL example causes a handler failure instead of HTTP 400, and generated documentation is missing the new database API coverage.
2 open issues
What changed in this PR
Adds a thin database interface to the FastEdge Rust SDK for host-managed SQL and key-value bindings, without a PostgreSQL-specific wrapper.
Changes:
- Exposes generated database APIs with SQL parameter helpers and optional typed row decoding.
- Adds WASI HTTP examples for PostgreSQL queries and KV-based rate limiting.
- Extends the
jsonfeature with Serde and records the API design decisions.
| File | Description |
|---|---|
src/lib.rs |
Generates database bindings and exports db. |
src/db.rs |
Adds SQL/KV APIs, parameter helpers, and typed decoding. |
examples/README.md |
Lists both database examples. |
examples/http/wasi/db_sql_postgres/src/lib.rs |
Demonstrates parameterized queries and typed results. |
examples/http/wasi/db_sql_postgres/schema.sql |
Provides the example schema and seed data. |
examples/http/wasi/db_sql_postgres/README.md |
Documents SQL setup and usage. |
examples/http/wasi/db_sql_postgres/Cargo.toml |
Declares SQL example dependencies. |
examples/http/wasi/db_sql_postgres/Cargo.lock |
Locks SQL example dependencies. |
examples/http/wasi/db_kv/src/lib.rs |
Demonstrates batched rate-limit and visit counters. |
examples/http/wasi/db_kv/README.md |
Documents KV setup and usage. |
examples/http/wasi/db_kv/Cargo.toml |
Declares KV example dependencies. |
examples/http/wasi/db_kv/Cargo.lock |
Locks KV example dependencies. |
context/CHANGELOG.md |
Records database integration decisions. |
Cargo.toml |
Adds optional Serde to the json feature. |
Cargo.lock |
Records the SDK’s Serde dependency. |
Review effort: Balanced
| .query() | ||
| .and_then(|q| q.split('&').find_map(|kv| kv.strip_prefix("id="))) | ||
| .map(str::parse::<i64>) | ||
| .transpose()?; |
Comment on lines
+420
to
+421
| /// Customer-owned databases bound to the app by name (`gcore:db`). | ||
| pub mod db; |
ruslanti
approved these changes
Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No Postgres wrapper