ScalarDB Cluster SQL gRPC API Guide
This document describes the ScalarDB Cluster SQL gRPC API.
You need to have a license key (trial license or commercial license) to use ScalarDB Cluster. If you don't have a license key, please contact us.
ScalarDB Cluster SQL provides a Java API that uses the gRPC API internally. If you use Java or a JVM language, you can use the Java API instead of the ScalarDB Cluster SQL gRPC API directly. For details about the Java API, see Developer Guide for ScalarDB Cluster with the Java API.
For details about the services and messages for the ScalarDB Cluster SQL gRPC API, see the definitions in the scalardb-cluster-sql.proto
file. For ScalarDB Cluster users who have a commercial license, please contact support if you need the scalardb-cluster-sql.proto
file.
ScalarDB Cluster SQL gRPC API is composed of the following services:
scalardb.cluster.rpc.v1.sql.SqlTransaction
: Provides a transaction capability for ScalarDB Cluster SQL.scalardb.cluster.rpc.v1.sql.SqlTwoPhaseCommitTransaction
: Provides a two-phase commit transaction capability for ScalarDB Cluster SQL.scalardb.cluster.rpc.v1.sql.Metadata
: Provides a metadata view of ScalarDB Cluster SQL.
The following sections describe how to use each service.
Overview of error handling in ScalarDB Cluster SQL gRPC API
Before describing how to use each service, this section explains how error handling works in ScalarDB Cluster SQL gRPC API.
ScalarDB Cluster SQL gRPC API employs Richer error model for error handling.
This model enables servers to return and enables clients to consume additional error details expressed as one or more protobuf messages.
ScalarDB Cluster SQL gRPC API uses google.rpc.ErrorInfo
, which is one of the standard set of error message types, and puts additional error details in ErrorInfo
fields.
ErrorInfo
has the following fields:
reason
: A string that provides a short description of the error. The following sections describe the possible values ofreason
in each service.domain
: A string that indicates the error's origin. In ScalarDB Cluster SQL gRPC API, this string is always set tocom.scalar.db.cluster.sql
.metadata
: A map of metadata for the specific error. In ScalarDB Cluster SQL gRPC API, a transaction ID with thetransactionId
key in the map is put if the error is related to a transaction.
If you encounter an error, you can retrieve ErrorInfo
from google.rpc.Status
in the gRPC response, but the method for doing so depends on the programming language.
Please refer to the appropriate documentation to understand how to get ErrorInfo
in your specific programming language.