Reads rows from the database using key lookups and scans, as a simple key/value style alternative to sessions.executeSql. This method cannot be used to return a result set larger than 10 MiB; if the read matches more data than that, the read fails with a FAILED_PRECONDITION error.

Reads inside read-write transactions might return ABORTED. If this occurs, the application should restart the transaction from the beginning. See Transaction for more details.

Larger result sets can be yielded in streaming fashion by calling sessions.streamingRead instead.

HTTP request


The URL uses gRPC Transcoding syntax.

Path parameters



Required. The session in which the read should be performed.

Authorization requires the following IAM permission on the specified resource session:


Request body

The request body contains data with the following structure:

JSON representation
  "transaction": {
    object (TransactionSelector)
  "table": string,
  "index": string,
  "columns": [
  "keySet": {
    object (KeySet)
  "limit": string,
  "resumeToken": string,
  "partitionToken": string,
  "requestOptions": {
    object (RequestOptions)
  "directedReadOptions": {
    object (DirectedReadOptions)
  "dataBoostEnabled": boolean

object (TransactionSelector)

The transaction to use. If none is provided, the default is a temporary read-only transaction with strong concurrency.



Required. The name of the table in the database to be read.



If non-empty, the name of an index on table. This index is used instead of the table primary key when interpreting keySet and sorting result rows. See keySet for further information.



Required. The columns of table to be returned for each row matching this request.


object (KeySet)

Required. keySet identifies the rows to be yielded. keySet names the primary keys of the rows in table to be yielded, unless index is present. If index is present, then keySet instead names index keys in index.

If the partitionToken field is empty, rows are yielded in table primary key order (if index is empty) or index key order (if index is non-empty). If the partitionToken field is not empty, rows will be yielded in an unspecified order.

It is not an error for the keySet to name rows that do not exist in the database. yields nothing for nonexistent rows.


string (int64 format)

If greater than zero, only the first limit rows are yielded. If limit is zero, the default is no limit. A limit cannot be specified if partitionToken is set.


string (bytes format)

If this request is resuming a previously interrupted read, resumeToken should be copied from the last PartialResultSet yielded before the interruption. Doing this enables the new read to resume where the last read left off. The rest of the request parameters must exactly match the request that yielded this token.

A base64-encoded string.


string (bytes format)

If present, results will be restricted to the specified partition previously created using sessions.partitionRead(). There must be an exact match for the values of fields common to this message and the PartitionReadRequest message used to create this partitionToken.

A base64-encoded string.


object (RequestOptions)

Common options for this request.


object (DirectedReadOptions)

Directed read options for this request.



If this is for a partitioned read and this field is set to true, the request is executed with Spanner Data Boost independent compute resources.

If the field is set to true but the request does not set partitionToken, the API returns an INVALID_ARGUMENT error.

Response body

If successful, the response body contains an instance of ResultSet.

Authorization scopes

Requires one of the following OAuth scopes:


For more information, see the Authentication Overview.