Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
9f2d837
poc(db): fastedge::db::sql (gcore:db/sql@0.1.0) + db_sql wstd example
godronus Oct 27, 2026
5f24861
example(db_sql): 'no such database' message, same as the JS example
godronus Oct 27, 2026
a78e427
fix(db): non-finite floats decode as strings, not null
godronus Oct 27, 2026
659e3e6
chore(wit): FastEdge-wit 6af3ae7 (float64 case unescaped again)
godronus Oct 27, 2026
f420841
feat(db): bind gcore:db/sql-types + sql-sync (WIT split; plain sql re…
godronus Oct 27, 2026
0b56752
docs(context): db sql-sync WIT split
godronus Oct 27, 2026
cf31945
feat(db): fastedge::db::kv (gcore:db/kv-sync) + db_kv example
godronus Oct 27, 2026
57ecb4d
docs(db): kv consistency — read-your-writes within a request (FastEdg…
godronus Oct 27, 2026
4f07841
fix(examples): db_sql decodes rows with the schema's default meta ({})
godronus Oct 30, 2026
d75f865
db: fastedge::db::sql -> fastedge::db::postgres (gcore:db/postgres-sync)
godronus Nov 5, 2026
df58253
db: example README uses secret FASTEDGE_DB_POSTGRES_main
godronus Nov 5, 2026
36c5013
db: dialect-neutral fastedge::db::sql (gcore:db/sql-sync), following …
godronus Nov 5, 2026
6b8695e
db: wit → FastEdge-wit 29f389b (sql-sync portability wording)
godronus Nov 5, 2026
e8f382f
db: fastedge::db::postgres, a PostgreSQL module over gcore:db/sql
godronus Nov 5, 2026
b3451b7
docs: gcore:db (sql, postgres, kv) in HOST_SERVICES.md; extension typ…
godronus Nov 5, 2026
9701f74
db: wit → FastEdge-wit f2f350c (batch docs)
godronus Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ name = "fastedge"
[features]
default = ["proxywasm"]
proxywasm = []
json = ["serde_json"]
json = ["serde_json", "serde"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change: versions are bumped in a separate chore: bump version commit at release time, as for 0.4.x. This one waits until the engine with gcore:db is on every edge.


[dependencies]
fastedge-derive = { path = "derive", version = "0.4" }
Expand All @@ -45,6 +45,7 @@ wit-bindgen = "0.46"
thiserror = "2.0"
mime = "^0.3"
serde_json = { version = "^1.0", optional = true }
serde = { version = "1", optional = true }

[dev-dependencies]

101 changes: 101 additions & 0 deletions context/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,107 @@ This file tracks agent decisions, architectural changes, and context for future

---

## [2026-11-05] — db: `fastedge::db::postgres` (PostgreSQL module over `gcore:db/sql`)

### Overview
A PostgreSQL-named module over the neutral SQL interface: same `Database`, `params!`, `ToSql`,
`QueryAs`, plus SQLSTATE constants and an `Error::sqlstate()` helper. No WIT change.

### Decisions
- Re-export, not a wrapper type: the host cannot check a binding's dialect, so a distinct
`Database` type would add code without adding checking. The module names the dialect for
readers, agents and tooling; it does not verify it
- `sqlstate` constants are taken from PostgreSQL's `errcodes.txt` (REL_17_STABLE); any other code
still arrives in `DbError::code`
- `fastedge::db::sql` stays for code that is not PostgreSQL-specific

### Changes
- `src/db.rs` — `pub mod postgres` (re-exports, `sqlstate`, `SqlState` for `Error` and
`QueryAsError`, unit test); `sql` docs point PostgreSQL users at it
- `examples/http/wasi/db_sql_postgres` — imports `fastedge::db::postgres` (responses unchanged)
- `src/db.rs` — `postgres` docs: extension and user-defined types (pgvector, PostGIS, enums) work as text
(`$1::vector` casts) with an empty `type_name`
- `fastedge-plugin-source/.generation-config.md` — `HOST_SERVICES.md` covers `fastedge::db` (`sql`, `postgres`,
`kv`; sources `src/db.rs`, the `gcore:db` WIT and the db examples); `docs/HOST_SERVICES.md` regenerated

## [2026-11-05] — db: dialect-neutral SQL; `Column.type_name`; example `db_sql_postgres`

### Overview
`gcore:db/sql` is documented as dialect-neutral: SQL text, placeholders and error codes are the bound
database's, and the host picks the backend from the binding's configuration. Still `0.1.0`
(unreleased).

### Decisions
- No `dialect()` call: binding a database of the wrong dialect is the developer's mistake
- The example is named after its dialect (PostgreSQL schema, `$1` placeholders), so a SQLite example
can sit beside it later

### Changes
- `wit` submodule → FastEdge-wit `feat/db-interface-all` a23194c
- `Column.type_name` (the database's type name, e.g. `int4`) replaces the PostgreSQL `type_oid`
- `src/db.rs` — module docs describe the dialect as the bound database's
- `examples/http/wasi/db_sql/` → `examples/http/wasi/db_sql_postgres/`

## [2026-10-27] — POC: `fastedge::db::kv` (gcore:db/kv-sync@0.1.0)

### Overview
Added `fastedge::db::kv`: Database KV (regional, durable, writable; Upstash Redis in the POC) bound
to the app by name; the host holds the credentials.

### Decisions
- Sync interface `kv-sync`, like `sql-sync`; the plain `kv` name is reserved for an async variant
(JS SDK).
- Re-export the generated types as is (`Database`, `Op`, `OpResult`, `SetOptions`, ...), plus
`Default for SetOptions` (always write, no expiry). No other wrapper.
- Example mirrors the JS SDK `examples/db-kv` (same keys, limits, responses).

### Changes
- `wit` submodule → FastEdge-wit `feat/db-interface-kv` ca89dc6 (`kv-types`, `kv-sync`)
- `src/lib.rs` — `with:` generates `gcore:db/kv-types@0.1.0` and `gcore:db/kv-sync@0.1.0`
- `src/db.rs` — `db::kv` module
- `examples/http/wasi/db_kv/` — new wstd example; `examples/README.md` entry

## [2026-10-27] — db: bind `gcore:db/sql-sync` (WIT split)

### Overview
FastEdge-wit split `gcore:db/sql` into `sql-types` + `sql-sync`, mirroring `cache-types` / `cache-sync`.

### Decisions
- Rust stays on the sync interface by default; the plain `sql` name is reserved for an async (pollable)
variant intended for the JS SDK. Public API `fastedge::db::sql` is unchanged.

### Changes
- `wit` submodule → FastEdge-wit `feat/db-interface` 83a7d08
- `src/lib.rs` — `with:` generates `gcore:db/sql-types@0.1.0` and `gcore:db/sql-sync@0.1.0`
- `src/db.rs` — re-exports `Database` from `sql_sync`, data types from `sql_types`

---

## [2026-10-27] — POC: `fastedge::db::sql` (gcore:db/sql@0.1.0)

### Overview
Added `fastedge::db::sql`: SQL database (PostgreSQL, Neon in the POC) bound to the app by name; the host holds the credentials.

### Decisions
- Module path `fastedge::db::sql` mirrors the WIT package `gcore:db/sql`, and keeps it apart from `fastedge::key_value` (Edge Storage). Upstash KV will follow as `fastedge::db::kv`.
- Re-export the generated types (`Database`, `Value`, `QueryResult`, `Error`, `DbError`, ...) as is, plus a thin layer: `params!` / `ToSql` for parameters, and `QueryAs::query_as::<T>` / `rows_as` decoding rows by column name via serde_json.
- `query_as` is behind the existing `json` feature (now also enables optional `serde`), so the default build gains no deps. Alternatives: sqlx/diesel (own the connection, don't fit), a custom serde Deserializer (more code, same result).
- Calls are blocking (sync WIT). Async (futures / WASI p3) is an open decision; see coordinator `db-integration/context/async-calls.md`.

### Changes
- `wit` submodule → FastEdge-wit `feat/db-interface` (`deps/db/sql.wit`, world imports `gcore:db/sql@0.1.0`)
- `src/lib.rs` — `with: { "gcore:db/sql@0.1.0": generate }` in `generate!`; `pub mod db`
- `src/db.rs` — new: `db::sql` re-exports, `ToSql`, `params!`, `QueryAs`, `rows_as`, `QueryAsError`
- `Cargo.toml` — optional `serde`, `json = ["serde_json", "serde"]`
- `examples/http/wasi/db_sql/` — new wstd example + `schema.sql`; `examples/README.md` entry

### Follow-up
- `examples/http/wasi/db_sql/Cargo.toml` uses a path dependency until `fastedge::db` is published (same as `examples/cdn/cache`).
- The `wit` submodule points at a FastEdge-wit commit that is not pushed yet (`6ddb92e`).
- Not yet: fixtures, SDK_ARCHITECTURE/PROJECT_OVERVIEW updates, plugin manifest entries, docs generation.

---

## [2026-09-14] — ProxyWasm cache module

### Overview
Expand Down
Loading
Loading