gRPC
ParticleDB ships a single gRPC service defined in proto/particledb.proto. The current server exposes SQL execution, batch execution, client-streaming inserts, CDC subscriptions, and health checks on the gRPC port.
Endpoint
Section titled “Endpoint”127.0.0.1:26257Configure it with:
particledb start --grpc-addr 0.0.0.0:26257What Is Actually Served
Section titled “What Is Actually Served”The current protobuf package is particledb.v1, and the server implements one service:
service ParticleDB { rpc ExecuteSQL(ExecuteSqlRequest) returns (ExecuteSqlResponse); rpc BatchExecute(BatchExecuteRequest) returns (BatchExecuteResponse); rpc StreamInsert(stream InsertRowRequest) returns (InsertResult); rpc Subscribe(SubscribeRequest) returns (stream ChangeEvent); rpc Health(HealthRequest) returns (HealthResponse);}There is no particledb.Admin / particledb.Query split in the current proto.
Proto Files
Section titled “Proto Files”The main entrypoint is:
proto/particledb.protoGenerate stubs from that file:
protoc --go_out=. --go-grpc_out=. proto/particledb.protopython -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. proto/particledb.protogrpcurl
Section titled “grpcurl”The server does not expose gRPC reflection today, so use -import-path and -proto.
Health
Section titled “Health”grpcurl -plaintext \ -import-path proto \ -proto proto/particledb.proto \ -d '{}' \ localhost:26257 \ particledb.v1.ParticleDB/HealthExample response:
{ "status": "OK", "version": "0.1.0"}Execute SQL
Section titled “Execute SQL”grpcurl -plaintext \ -import-path proto \ -proto proto/particledb.proto \ -d '{"sql":"SELECT 1 AS ok"}' \ localhost:26257 \ particledb.v1.ParticleDB/ExecuteSQLExample response:
{ "columns": [ { "name": "ok", "type": "Int64" } ], "rows": [ { "values": [ { "intValue": "1" } ] } ], "rowsAffected": "1"}Batch execute
Section titled “Batch execute”grpcurl -plaintext \ -import-path proto \ -proto proto/particledb.proto \ -d '{"statements":["CREATE TABLE demo (id BIGINT PRIMARY KEY)","INSERT INTO demo VALUES (1)","SELECT * FROM demo"]}' \ localhost:26257 \ particledb.v1.ParticleDB/BatchExecuteMessage Shapes
Section titled “Message Shapes”message ExecuteSqlRequest { string sql = 1; repeated Value params = 2;}
message ExecuteSqlResponse { repeated Column columns = 1; repeated Row rows = 2; int64 rows_affected = 3; string error = 4;}
message HealthResponse { string status = 1; string version = 2;}Value is a protobuf oneof supporting integers, floats, strings, booleans, nulls, and bytes.
Authentication
Section titled “Authentication”When --auth-method trust or --no-auth is used, gRPC calls are accepted without credentials.
When auth is enabled, the current server expects:
Authorization: Bearer <username>:<password>Example:
grpcurl \ -cacert ca.crt \ -H "authorization: Bearer admin:secret" \ -import-path proto \ -proto proto/particledb.proto \ -d '{}' \ localhost:26257 \ particledb.v1.ParticleDB/HealthThe gRPC endpoint supports direct TLS with the same certificate/key pair used by the PG wire and Redis listeners:
particledb start \ --grpc-addr 0.0.0.0:26257 \ --tls-cert /path/to/server.crt \ --tls-key /path/to/server.keyWhat To Use gRPC For
Section titled “What To Use gRPC For”- Typed SQL execution without going through PG wire drivers
- Batch execution from generated clients
- Client-streaming inserts
- CDC subscriptions
- Health probes from gRPC-native environments
For normal application SQL and ORM compatibility, the PostgreSQL wire protocol is still the most ergonomic default.
Next Steps
Section titled “Next Steps”- HTTP API — JSON SQL, KV helpers, and SSE streaming
- PostgreSQL Wire Protocol — Primary application interface
- TLS / Security — TLS/auth details by protocol