Skip to content

Commit c3d8d13

Browse files
committed
removed EngineService from protos/engine/engine.proto
1 parent 7b46024 commit c3d8d13

File tree

6 files changed

+15
-155
lines changed

6 files changed

+15
-155
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ proto:
5353
proto-engine-plugin:
5454
protoc -I. \
5555
--go_out=. --go_opt=module=github.com/sqlc-dev/sqlc --go_opt=Mprotos/engine/engine.proto=github.com/sqlc-dev/sqlc/pkg/engine \
56-
--go-grpc_out=. --go-grpc_opt=module=github.com/sqlc-dev/sqlc --go-grpc_opt=Mprotos/engine/engine.proto=github.com/sqlc-dev/sqlc/pkg/engine \
5756
protos/engine/engine.proto
5857

5958
remote-proto:

docs/guides/engine-plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ The definition lives in `protos/engine/engine.proto` (generated Go in `pkg/engin
194194

195195
## Example
196196

197-
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.
197+
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 handles the `parse` subcommand (stdin: `ParseRequest`, stdout: `ParseResponse`); register it under `engines` in sqlc.yaml as shown above.
198198

199199
## Architecture
200200

pkg/engine/engine.pb.go

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

pkg/engine/engine_grpc.pb.go

Lines changed: 0 additions & 133 deletions
This file was deleted.

pkg/engine/sdk.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// The Protocol Buffer schema is published at buf.build/sqlc/sqlc and ensures
1313
// binary compatibility between sqlc and plugins.
1414
//
15-
// # Generating engine.pb.go and engine_grpc.pb.go
15+
// # Generating engine.pb.go
1616
//
1717
// Run from the repository root:
1818
//
@@ -22,7 +22,6 @@
2222
//
2323
// protoc -I. \
2424
// --go_out=. --go_opt=module=github.com/sqlc-dev/sqlc --go_opt=Mprotos/engine/engine.proto=github.com/sqlc-dev/sqlc/pkg/engine \
25-
// --go-grpc_out=. --go-grpc_opt=module=github.com/sqlc-dev/sqlc --go-grpc_opt=Mprotos/engine/engine.proto=github.com/sqlc-dev/sqlc/pkg/engine \
2625
// protos/engine/engine.proto
2726
//
2827
// Example plugin:

protos/engine/engine.proto

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@ syntax = "proto3";
22

33
package engine;
44

5-
// EngineService defines the interface for database engine plugins.
6-
// Engine plugins are responsible for parsing SQL statements and extracting
7-
// information about parameters and result columns.
8-
service EngineService {
9-
// Parse parses SQL statements and returns the processed SQL along with
10-
// information about parameters and result columns.
11-
rpc Parse (ParseRequest) returns (ParseResponse);
12-
}
13-
5+
// Database engine plugins are subprocesses: sqlc runs e.g. `my-engine-plugin parse`,
6+
// writes a serialized ParseRequest to stdin, reads a serialized ParseResponse from stdout.
7+
// There is no gRPC on the wire — only these protobuf messages.
8+
//
149
// ParseRequest contains the SQL to parse and either schema or connection parameters.
1510
message ParseRequest {
1611
// The SQL query text to parse.

0 commit comments

Comments
 (0)