Spanner

google.spanner.v1. Spanner

Represents a Spanner

Constructor

new Spanner(rpcImpl, requestDelimitedopt, responseDelimitedopt)

Constructs a new Spanner service.

Parameters:
Name Type Attributes Default Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean <optional>
false

Whether requests are length-delimited

responseDelimited boolean <optional>
false

Whether responses are length-delimited

Extends

  • $protobuf.rpc.Service

Methods

batchCreateSessions(request, callback) → {undefined}

Calls BatchCreateSessions.

Parameters:
Name Type Description
request google.spanner.v1.IBatchCreateSessionsRequest

BatchCreateSessionsRequest message or plain object

callback google.spanner.v1.Spanner.BatchCreateSessionsCallback

Node-style callback called with the error, if any, and BatchCreateSessionsResponse

Returns:
Type Description
undefined

batchCreateSessions(request) → {Promise.<google.spanner.v1.BatchCreateSessionsResponse>}

Calls BatchCreateSessions.

Parameters:
Name Type Description
request google.spanner.v1.IBatchCreateSessionsRequest

BatchCreateSessionsRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.BatchCreateSessionsResponse>

Promise

batchWrite(request, callback) → {undefined}

Calls BatchWrite.

Parameters:
Name Type Description
request google.spanner.v1.IBatchWriteRequest

BatchWriteRequest message or plain object

callback google.spanner.v1.Spanner.BatchWriteCallback

Node-style callback called with the error, if any, and BatchWriteResponse

Returns:
Type Description
undefined

batchWrite(request) → {Promise.<google.spanner.v1.BatchWriteResponse>}

Calls BatchWrite.

Parameters:
Name Type Description
request google.spanner.v1.IBatchWriteRequest

BatchWriteRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.BatchWriteResponse>

Promise

beginTransaction(request, callback) → {undefined}

Calls BeginTransaction.

Parameters:
Name Type Description
request google.spanner.v1.IBeginTransactionRequest

BeginTransactionRequest message or plain object

callback google.spanner.v1.Spanner.BeginTransactionCallback

Node-style callback called with the error, if any, and Transaction

Returns:
Type Description
undefined

beginTransaction(request) → {Promise.<google.spanner.v1.Transaction>}

Calls BeginTransaction.

Parameters:
Name Type Description
request google.spanner.v1.IBeginTransactionRequest

BeginTransactionRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.Transaction>

Promise

commit(request, callback) → {undefined}

Calls Commit.

Parameters:
Name Type Description
request google.spanner.v1.ICommitRequest

CommitRequest message or plain object

callback google.spanner.v1.Spanner.CommitCallback

Node-style callback called with the error, if any, and CommitResponse

Returns:
Type Description
undefined

commit(request) → {Promise.<google.spanner.v1.CommitResponse>}

Calls Commit.

Parameters:
Name Type Description
request google.spanner.v1.ICommitRequest

CommitRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.CommitResponse>

Promise

createSession(request, callback) → {undefined}

Calls CreateSession.

Parameters:
Name Type Description
request google.spanner.v1.ICreateSessionRequest

CreateSessionRequest message or plain object

callback google.spanner.v1.Spanner.CreateSessionCallback

Node-style callback called with the error, if any, and Session

Returns:
Type Description
undefined

createSession(request) → {Promise.<google.spanner.v1.Session>}

Calls CreateSession.

Parameters:
Name Type Description
request google.spanner.v1.ICreateSessionRequest

CreateSessionRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.Session>

Promise

deleteSession(request, callback) → {undefined}

Calls DeleteSession.

Parameters:
Name Type Description
request google.spanner.v1.IDeleteSessionRequest

DeleteSessionRequest message or plain object

callback google.spanner.v1.Spanner.DeleteSessionCallback

Node-style callback called with the error, if any, and Empty

Returns:
Type Description
undefined

deleteSession(request) → {Promise.<google.protobuf.Empty>}

Calls DeleteSession.

Parameters:
Name Type Description
request google.spanner.v1.IDeleteSessionRequest

DeleteSessionRequest message or plain object

Returns:
Type Description
Promise.<google.protobuf.Empty>

Promise

executeBatchDml(request, callback) → {undefined}

Calls ExecuteBatchDml.

Parameters:
Name Type Description
request google.spanner.v1.IExecuteBatchDmlRequest

ExecuteBatchDmlRequest message or plain object

callback google.spanner.v1.Spanner.ExecuteBatchDmlCallback

Node-style callback called with the error, if any, and ExecuteBatchDmlResponse

Returns:
Type Description
undefined

executeBatchDml(request) → {Promise.<google.spanner.v1.ExecuteBatchDmlResponse>}

Calls ExecuteBatchDml.

Parameters:
Name Type Description
request google.spanner.v1.IExecuteBatchDmlRequest

ExecuteBatchDmlRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.ExecuteBatchDmlResponse>

Promise

executeSql(request, callback) → {undefined}

Calls ExecuteSql.

Parameters:
Name Type Description
request google.spanner.v1.IExecuteSqlRequest

ExecuteSqlRequest message or plain object

callback google.spanner.v1.Spanner.ExecuteSqlCallback

Node-style callback called with the error, if any, and ResultSet

Returns:
Type Description
undefined

executeSql(request) → {Promise.<google.spanner.v1.ResultSet>}

Calls ExecuteSql.

Parameters:
Name Type Description
request google.spanner.v1.IExecuteSqlRequest

ExecuteSqlRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.ResultSet>

Promise

executeStreamingSql(request, callback) → {undefined}

Calls ExecuteStreamingSql.

Parameters:
Name Type Description
request google.spanner.v1.IExecuteSqlRequest

ExecuteSqlRequest message or plain object

callback google.spanner.v1.Spanner.ExecuteStreamingSqlCallback

Node-style callback called with the error, if any, and PartialResultSet

Returns:
Type Description
undefined

executeStreamingSql(request) → {Promise.<google.spanner.v1.PartialResultSet>}

Calls ExecuteStreamingSql.

Parameters:
Name Type Description
request google.spanner.v1.IExecuteSqlRequest

ExecuteSqlRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.PartialResultSet>

Promise

getSession(request, callback) → {undefined}

Calls GetSession.

Parameters:
Name Type Description
request google.spanner.v1.IGetSessionRequest

GetSessionRequest message or plain object

callback google.spanner.v1.Spanner.GetSessionCallback

Node-style callback called with the error, if any, and Session

Returns:
Type Description
undefined

getSession(request) → {Promise.<google.spanner.v1.Session>}

Calls GetSession.

Parameters:
Name Type Description
request google.spanner.v1.IGetSessionRequest

GetSessionRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.Session>

Promise

listSessions(request, callback) → {undefined}

Calls ListSessions.

Parameters:
Name Type Description
request google.spanner.v1.IListSessionsRequest

ListSessionsRequest message or plain object

callback google.spanner.v1.Spanner.ListSessionsCallback

Node-style callback called with the error, if any, and ListSessionsResponse

Returns:
Type Description
undefined

listSessions(request) → {Promise.<google.spanner.v1.ListSessionsResponse>}

Calls ListSessions.

Parameters:
Name Type Description
request google.spanner.v1.IListSessionsRequest

ListSessionsRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.ListSessionsResponse>

Promise

partitionQuery(request, callback) → {undefined}

Calls PartitionQuery.

Parameters:
Name Type Description
request google.spanner.v1.IPartitionQueryRequest

PartitionQueryRequest message or plain object

callback google.spanner.v1.Spanner.PartitionQueryCallback

Node-style callback called with the error, if any, and PartitionResponse

Returns:
Type Description
undefined

partitionQuery(request) → {Promise.<google.spanner.v1.PartitionResponse>}

Calls PartitionQuery.

Parameters:
Name Type Description
request google.spanner.v1.IPartitionQueryRequest

PartitionQueryRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.PartitionResponse>

Promise

partitionRead(request, callback) → {undefined}

Calls PartitionRead.

Parameters:
Name Type Description
request google.spanner.v1.IPartitionReadRequest

PartitionReadRequest message or plain object

callback google.spanner.v1.Spanner.PartitionReadCallback

Node-style callback called with the error, if any, and PartitionResponse

Returns:
Type Description
undefined

partitionRead(request) → {Promise.<google.spanner.v1.PartitionResponse>}

Calls PartitionRead.

Parameters:
Name Type Description
request google.spanner.v1.IPartitionReadRequest

PartitionReadRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.PartitionResponse>

Promise

read(request, callback) → {undefined}

Calls Read.

Parameters:
Name Type Description
request google.spanner.v1.IReadRequest

ReadRequest message or plain object

callback google.spanner.v1.Spanner.ReadCallback

Node-style callback called with the error, if any, and ResultSet

Returns:
Type Description
undefined

read(request) → {Promise.<google.spanner.v1.ResultSet>}

Calls Read.

Parameters:
Name Type Description
request google.spanner.v1.IReadRequest

ReadRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.ResultSet>

Promise

rollback(request, callback) → {undefined}

Calls Rollback.

Parameters:
Name Type Description
request google.spanner.v1.IRollbackRequest

RollbackRequest message or plain object

callback google.spanner.v1.Spanner.RollbackCallback

Node-style callback called with the error, if any, and Empty

Returns:
Type Description
undefined

rollback(request) → {Promise.<google.protobuf.Empty>}

Calls Rollback.

Parameters:
Name Type Description
request google.spanner.v1.IRollbackRequest

RollbackRequest message or plain object

Returns:
Type Description
Promise.<google.protobuf.Empty>

Promise

streamingRead(request, callback) → {undefined}

Calls StreamingRead.

Parameters:
Name Type Description
request google.spanner.v1.IReadRequest

ReadRequest message or plain object

callback google.spanner.v1.Spanner.StreamingReadCallback

Node-style callback called with the error, if any, and PartialResultSet

Returns:
Type Description
undefined

streamingRead(request) → {Promise.<google.spanner.v1.PartialResultSet>}

Calls StreamingRead.

Parameters:
Name Type Description
request google.spanner.v1.IReadRequest

ReadRequest message or plain object

Returns:
Type Description
Promise.<google.spanner.v1.PartialResultSet>

Promise

(static) create(rpcImpl, requestDelimitedopt, responseDelimitedopt) → {Spanner}

Creates new Spanner service using the specified rpc implementation.

Parameters:
Name Type Attributes Default Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean <optional>
false

Whether requests are length-delimited

responseDelimited boolean <optional>
false

Whether responses are length-delimited

Returns:
Type Description
Spanner

RPC service. Useful where requests and/or responses are streamed.

Type Definitions

BatchCreateSessionsCallback(error, responseopt)

Callback as used by batchCreateSessions.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.BatchCreateSessionsResponse <optional>

BatchCreateSessionsResponse

BatchWriteCallback(error, responseopt)

Callback as used by batchWrite.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.BatchWriteResponse <optional>

BatchWriteResponse

BeginTransactionCallback(error, responseopt)

Callback as used by beginTransaction.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.Transaction <optional>

Transaction

CommitCallback(error, responseopt)

Callback as used by commit.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.CommitResponse <optional>

CommitResponse

CreateSessionCallback(error, responseopt)

Callback as used by createSession.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.Session <optional>

Session

DeleteSessionCallback(error, responseopt)

Callback as used by deleteSession.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.protobuf.Empty <optional>

Empty

ExecuteBatchDmlCallback(error, responseopt)

Callback as used by executeBatchDml.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.ExecuteBatchDmlResponse <optional>

ExecuteBatchDmlResponse

ExecuteSqlCallback(error, responseopt)

Callback as used by executeSql.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.ResultSet <optional>

ResultSet

ExecuteStreamingSqlCallback(error, responseopt)

Callback as used by executeStreamingSql.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.PartialResultSet <optional>

PartialResultSet

GetSessionCallback(error, responseopt)

Callback as used by getSession.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.Session <optional>

Session

ListSessionsCallback(error, responseopt)

Callback as used by listSessions.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.ListSessionsResponse <optional>

ListSessionsResponse

PartitionQueryCallback(error, responseopt)

Callback as used by partitionQuery.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.PartitionResponse <optional>

PartitionResponse

PartitionReadCallback(error, responseopt)

Callback as used by partitionRead.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.PartitionResponse <optional>

PartitionResponse

ReadCallback(error, responseopt)

Callback as used by read.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.ResultSet <optional>

ResultSet

RollbackCallback(error, responseopt)

Callback as used by rollback.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.protobuf.Empty <optional>

Empty

StreamingReadCallback(error, responseopt)

Callback as used by streamingRead.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.spanner.v1.PartialResultSet <optional>

PartialResultSet