Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The batch failure contract needs clarification to prevent unsafe retries when the commit outcome is unknown.
1 open issue
What changed in this PR
Adds a synchronous PostgreSQL-compatible database interface and makes it available to components through the reactor world.
Changes:
- Defines database bindings, parameterized queries, and transactional batches.
- Adds SQL value types, result metadata, and structured errors.
- Imports
gcore:db/sql@0.1.0into the reactor world.
| File | Description |
|---|---|
world.wit |
Imports the new SQL interface. |
deps/db/sql.wit |
Defines the database API, types, errors, and behavioral contract. |
Review effort: Balanced
Comment on lines
+92
to
+93
| /// Returns one `query-result` per statement, in order. On failure nothing is committed | ||
| /// and the error of the failing statement is returned. |
…ich accepts it) Reverts 6ddb92e.
…plain `sql` reserved for async
This was referenced Oct 27, 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.

Summary
Adds the
gcore:db@0.1.0package (customer-owned databases bound to an app by name), synchronous SQL for the MVP:deps/db/sql-types.wit:value,column,query-result,statement,db-error,errordeps/db/sql-sync.wit:resource database { open(name), query(sql, params), batch(statements) }, blockingworld reactorimportsgcore:db/sql-sync@0.1.0Contract is PostgreSQL (
$1placeholders, SQLSTATE codes). Eachqueryauto-commits; eachbatchis one transaction. Full design and rationale:docs/db/in G-Core/FastEdge (branchfeat/db-interface).Decisions needed
sql-types+sql-sync, followingcache-types/cache-sync; the plain namesqlis reserved for the async interface (draft PR stacked on this one)gcore:db, notgcore:fastedge, so DB connectors version independently; KV (Upstash) will follow asgcore:db/kv, distinct from Edge Storagekey-valuevaluetypingint8→int64,numeric→ decimal text,json/jsonb→ JSON text,bytea→ bytes, other types → Postgres text +type-oid)no-such-database,access-denied,config,connection,timeout,limit,query,internal-errorMerge this first: the engine vendors these files and both SDKs pin this branch as a submodule.
Related: G-Core/FastEdge#659, G-Core/FastEdge-sdk-rust#93, G-Core/FastEdge-sdk-js#155 · Async (stacked): #9