Skip to content

Commit 9b9b3ed

Browse files
committed
docs
1 parent e4667d2 commit 9b9b3ed

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/guides/engine-plugins.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ An engine plugin is an external process that implements one RPC:
1818

1919
- **Parse** — accepts the query text and either schema SQL or connection parameters, and returns processed SQL, parameter list, and result columns.
2020

21-
Process plugins (e.g. written in Go) talk to sqlc over **stdin/stdout** using **Protocol Buffers**. The schema is defined in `engine/engine.proto`.
21+
Process plugins (e.g. written in Go) talk to sqlc over **stdin/stdout** using **Protocol Buffers**. The protocol is defined in `protos/engine/engine.proto`.
2222

2323
## Compatibility
2424

@@ -62,7 +62,9 @@ sql:
6262
|-------|-------------|
6363
| `name` | Engine name used in `sql[].engine` |
6464
| `process.cmd` | Command to run (PATH or absolute path) |
65-
| `env` | Environment variables passed to the plugin |
65+
| `env` | Environment variable names passed to the plugin |
66+
67+
Each engine must define either `process` (with `cmd`) or `wasm` (with `url` and `sha256`). See [Configuration reference](../reference/config.md) for the full `engines` schema.
6668

6769
## Implementing an engine plugin (Go)
6870

@@ -152,7 +154,7 @@ The definition lives in `engine/engine.proto` (and generated Go in `pkg/engine`)
152154

153155
## Example
154156

155-
A minimal engine that parses SQLite-style SQL and expands `*` using a schema is in this repository under `examples/plugin-based-codegen/plugins/sqlc-engine-sqlite3/`. It pairs with the Rust codegen example in the same `plugin-based-codegen` sample.
157+
The protocol and Go SDK are in this repository: `protos/engine/engine.proto` and `pkg/engine/` (including `sdk.go` with `engine.Run` and `engine.Handler`). Use them to build a binary that implements the Parse RPC; register it under `engines` in sqlc.yaml as shown above.
156158

157159
## Architecture
158160

0 commit comments

Comments
 (0)