Cloud Spanner API
The Cloud Spanner API can be used to manage sessions and execute transactions on data stored in Cloud Spanner databases. v1
Package
@google-cloud/spanner!Constructors
(constructor)(opts)
constructor
(
opts
?:
ClientOptions
);
Construct an instance of SpannerClient.
Type | Name | Description |
---|---|---|
ClientOptions
|
opts |
Properties
apiEndpoint
static
get
apiEndpoint
()
:
string
;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
Type | Description |
---|---|
string |
auth
auth
:
gax
.
GoogleAuth
;
Type | Description |
---|---|
gax. GoogleAuth |
descriptors
descriptors
:
Descriptors
;
Type | Description |
---|---|
Descriptors |
innerApiCalls
innerApiCalls
:
{
[
name
:
string
]
:
Function
;
};
Type | Description |
---|---|
{ [name: string]: Function ; } |
pathTemplates
pathTemplates
:
{
[
name
:
string
]
:
gax
.
PathTemplate
;
};
Type | Description |
---|---|
{ [name: string]: gax. PathTemplate ; } |
port
static
get
port
()
:
number
;
The port for this API service.
Type | Description |
---|---|
number |
scopes
static
get
scopes
()
:
string
[];
The scopes needed to make gRPC calls for every method defined in this service.
Type | Description |
---|---|
string[] |
servicePath
static
get
servicePath
()
:
string
;
The DNS address for this API service.
Type | Description |
---|---|
string |
spannerStub
spannerStub
?:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
Type | Description |
---|---|
Promise <{ [name: string]: Function ; }> |
Methods
batchCreateSessions(request, options)
batchCreateSessions
(
request
?:
protos
.
google
.
spanner
.
v1
.
IBatchCreateSessionsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
spanner
.
v1
.
IBatchCreateSessionsResponse
,
protos
.
google
.
spanner
.
v1
.
IBatchCreateSessionsRequest
|
undefined
,
{}
|
undefined
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IBatchCreateSessionsRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.spanner.v1.IBatchCreateSessionsResponse , protos. google.spanner.v1.IBatchCreateSessionsRequest | undefined, {} | undefined]> |
batchCreateSessions(request, options, callback)
batchCreateSessions
(
request
:
protos
.
google
.
spanner
.
v1
.
IBatchCreateSessionsRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
IBatchCreateSessionsResponse
,
protos
.
google
.
spanner
.
v1
.
IBatchCreateSessionsRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IBatchCreateSessionsRequest
|
request | |
CallOptions
|
options | |
Callback
<protos. google.spanner.v1.IBatchCreateSessionsResponse
, protos. google.spanner.v1.IBatchCreateSessionsRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
batchCreateSessions(request, callback)
batchCreateSessions
(
request
:
protos
.
google
.
spanner
.
v1
.
IBatchCreateSessionsRequest
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
IBatchCreateSessionsResponse
,
protos
.
google
.
spanner
.
v1
.
IBatchCreateSessionsRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IBatchCreateSessionsRequest
|
request | |
Callback
<protos. google.spanner.v1.IBatchCreateSessionsResponse
, protos. google.spanner.v1.IBatchCreateSessionsRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
beginTransaction(request, options)
beginTransaction
(
request
?:
protos
.
google
.
spanner
.
v1
.
IBeginTransactionRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
spanner
.
v1
.
ITransaction
,
protos
.
google
.
spanner
.
v1
.
IBeginTransactionRequest
|
undefined
,
{}
|
undefined
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IBeginTransactionRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.spanner.v1.ITransaction , protos. google.spanner.v1.IBeginTransactionRequest | undefined, {} | undefined]> |
beginTransaction(request, options, callback)
beginTransaction
(
request
:
protos
.
google
.
spanner
.
v1
.
IBeginTransactionRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
ITransaction
,
protos
.
google
.
spanner
.
v1
.
IBeginTransactionRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IBeginTransactionRequest
|
request | |
CallOptions
|
options | |
Callback
<protos. google.spanner.v1.ITransaction
, protos. google.spanner.v1.IBeginTransactionRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
beginTransaction(request, callback)
beginTransaction
(
request
:
protos
.
google
.
spanner
.
v1
.
IBeginTransactionRequest
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
ITransaction
,
protos
.
google
.
spanner
.
v1
.
IBeginTransactionRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IBeginTransactionRequest
|
request | |
Callback
<protos. google.spanner.v1.ITransaction
, protos. google.spanner.v1.IBeginTransactionRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
close()
close
()
:
Promise<void>
;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Type | Description |
---|---|
Promise <void> | {Promise} A promise that resolves when the client is closed. |
commit(request, options)
commit
(
request
?:
protos
.
google
.
spanner
.
v1
.
ICommitRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
spanner
.
v1
.
ICommitResponse
,
protos
.
google
.
spanner
.
v1
.
ICommitRequest
|
undefined
,
{}
|
undefined
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.ICommitRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.spanner.v1.ICommitResponse , protos. google.spanner.v1.ICommitRequest | undefined, {} | undefined]> |
commit(request, options, callback)
commit
(
request
:
protos
.
google
.
spanner
.
v1
.
ICommitRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
ICommitResponse
,
protos
.
google
.
spanner
.
v1
.
ICommitRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.ICommitRequest
|
request | |
CallOptions
|
options | |
Callback
<protos. google.spanner.v1.ICommitResponse
, protos. google.spanner.v1.ICommitRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
commit(request, callback)
commit
(
request
:
protos
.
google
.
spanner
.
v1
.
ICommitRequest
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
ICommitResponse
,
protos
.
google
.
spanner
.
v1
.
ICommitRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.ICommitRequest
|
request | |
Callback
<protos. google.spanner.v1.ICommitResponse
, protos. google.spanner.v1.ICommitRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
createSession(request, options)
createSession
(
request
?:
protos
.
google
.
spanner
.
v1
.
ICreateSessionRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
spanner
.
v1
.
ISession
,
protos
.
google
.
spanner
.
v1
.
ICreateSessionRequest
|
undefined
,
{}
|
undefined
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.ICreateSessionRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.spanner.v1.ISession , protos. google.spanner.v1.ICreateSessionRequest | undefined, {} | undefined]> |
createSession(request, options, callback)
createSession
(
request
:
protos
.
google
.
spanner
.
v1
.
ICreateSessionRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
ISession
,
protos
.
google
.
spanner
.
v1
.
ICreateSessionRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.ICreateSessionRequest
|
request | |
CallOptions
|
options | |
Callback
<protos. google.spanner.v1.ISession
, protos. google.spanner.v1.ICreateSessionRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
createSession(request, callback)
createSession
(
request
:
protos
.
google
.
spanner
.
v1
.
ICreateSessionRequest
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
ISession
,
protos
.
google
.
spanner
.
v1
.
ICreateSessionRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.ICreateSessionRequest
|
request | |
Callback
<protos. google.spanner.v1.ISession
, protos. google.spanner.v1.ICreateSessionRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
databasePath(project, instance, database)
databasePath
(
project
:
string
,
instance
:
string
,
database
:
string
)
:
string
;
Return a fully-qualified database resource name string.
Type | Name | Description |
---|---|---|
string
|
project | |
string
|
instance | |
string
|
database |
Type | Description |
---|---|
string | {string} Resource name string. |
deleteSession(request, options)
deleteSession
(
request
?:
protos
.
google
.
spanner
.
v1
.
IDeleteSessionRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
spanner
.
v1
.
IDeleteSessionRequest
|
undefined
,
{}
|
undefined
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IDeleteSessionRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.protobuf.IEmpty , protos. google.spanner.v1.IDeleteSessionRequest | undefined, {} | undefined]> |
deleteSession(request, options, callback)
deleteSession
(
request
:
protos
.
google
.
spanner
.
v1
.
IDeleteSessionRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
spanner
.
v1
.
IDeleteSessionRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IDeleteSessionRequest
|
request | |
CallOptions
|
options | |
Callback
<protos. google.protobuf.IEmpty
, protos. google.spanner.v1.IDeleteSessionRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
deleteSession(request, callback)
deleteSession
(
request
:
protos
.
google
.
spanner
.
v1
.
IDeleteSessionRequest
,
callback
:
Callback<protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
spanner
.
v1
.
IDeleteSessionRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IDeleteSessionRequest
|
request | |
Callback
<protos. google.protobuf.IEmpty
, protos. google.spanner.v1.IDeleteSessionRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
executeBatchDml(request, options)
executeBatchDml
(
request
?:
protos
.
google
.
spanner
.
v1
.
IExecuteBatchDmlRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
spanner
.
v1
.
IExecuteBatchDmlResponse
,
protos
.
google
.
spanner
.
v1
.
IExecuteBatchDmlRequest
|
undefined
,
{}
|
undefined
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IExecuteBatchDmlRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.spanner.v1.IExecuteBatchDmlResponse , protos. google.spanner.v1.IExecuteBatchDmlRequest | undefined, {} | undefined]> |
executeBatchDml(request, options, callback)
executeBatchDml
(
request
:
protos
.
google
.
spanner
.
v1
.
IExecuteBatchDmlRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
IExecuteBatchDmlResponse
,
protos
.
google
.
spanner
.
v1
.
IExecuteBatchDmlRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IExecuteBatchDmlRequest
|
request | |
CallOptions
|
options | |
Callback
<protos. google.spanner.v1.IExecuteBatchDmlResponse
, protos. google.spanner.v1.IExecuteBatchDmlRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
executeBatchDml(request, callback)
executeBatchDml
(
request
:
protos
.
google
.
spanner
.
v1
.
IExecuteBatchDmlRequest
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
IExecuteBatchDmlResponse
,
protos
.
google
.
spanner
.
v1
.
IExecuteBatchDmlRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IExecuteBatchDmlRequest
|
request | |
Callback
<protos. google.spanner.v1.IExecuteBatchDmlResponse
, protos. google.spanner.v1.IExecuteBatchDmlRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
executeSql(request, options)
executeSql
(
request
?:
protos
.
google
.
spanner
.
v1
.
IExecuteSqlRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
spanner
.
v1
.
IResultSet
,
protos
.
google
.
spanner
.
v1
.
IExecuteSqlRequest
|
undefined
,
{}
|
undefined
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IExecuteSqlRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.spanner.v1.IResultSet , protos. google.spanner.v1.IExecuteSqlRequest | undefined, {} | undefined]> |
executeSql(request, options, callback)
executeSql
(
request
:
protos
.
google
.
spanner
.
v1
.
IExecuteSqlRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
IResultSet
,
protos
.
google
.
spanner
.
v1
.
IExecuteSqlRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IExecuteSqlRequest
|
request | |
CallOptions
|
options | |
Callback
<protos. google.spanner.v1.IResultSet
, protos. google.spanner.v1.IExecuteSqlRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
executeSql(request, callback)
executeSql
(
request
:
protos
.
google
.
spanner
.
v1
.
IExecuteSqlRequest
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
IResultSet
,
protos
.
google
.
spanner
.
v1
.
IExecuteSqlRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IExecuteSqlRequest
|
request | |
Callback
<protos. google.spanner.v1.IResultSet
, protos. google.spanner.v1.IExecuteSqlRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
executeStreamingSql(request, options)
executeStreamingSql
(
request
?:
protos
.
google
.
spanner
.
v1
.
IExecuteSqlRequest
,
options
?:
CallOptions
)
:
gax
.
CancellableStream
;
Like , except returns the result set as a stream. Unlike , there is no limit on the size of the returned result set. However, no individual row in the result set can exceed 100 MiB, and no column value can exceed 10 MiB.
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IExecuteSqlRequest
|
request | The request object that will be sent. |
CallOptions
|
options | Call options. See CallOptions for more details. |
Type | Description |
---|---|
gax. CancellableStream | {Stream} An object stream which emits [PartialResultSet] on 'data' event. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) for more details and examples. |
getProjectId()
getProjectId
()
:
Promise<string>
;
Type | Description |
---|---|
Promise <string> |
getProjectId(callback)
getProjectId
(
callback
:
Callback<string
,
undefined
,
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
Callback
<string, undefined, undefined>
|
callback |
Type | Description |
---|---|
void |
getSession(request, options)
getSession
(
request
?:
protos
.
google
.
spanner
.
v1
.
IGetSessionRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
spanner
.
v1
.
ISession
,
protos
.
google
.
spanner
.
v1
.
IGetSessionRequest
|
undefined
,
{}
|
undefined
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IGetSessionRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.spanner.v1.ISession , protos. google.spanner.v1.IGetSessionRequest | undefined, {} | undefined]> |
getSession(request, options, callback)
getSession
(
request
:
protos
.
google
.
spanner
.
v1
.
IGetSessionRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
ISession
,
protos
.
google
.
spanner
.
v1
.
IGetSessionRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IGetSessionRequest
|
request | |
CallOptions
|
options | |
Callback
<protos. google.spanner.v1.ISession
, protos. google.spanner.v1.IGetSessionRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
getSession(request, callback)
getSession
(
request
:
protos
.
google
.
spanner
.
v1
.
IGetSessionRequest
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
ISession
,
protos
.
google
.
spanner
.
v1
.
IGetSessionRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IGetSessionRequest
|
request | |
Callback
<protos. google.spanner.v1.ISession
, protos. google.spanner.v1.IGetSessionRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
initialize()
initialize
()
:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Type | Description |
---|---|
Promise <{ [name: string]: Function ; }> | {Promise} A promise that resolves to an authenticated service stub. |
listSessions(request, options)
listSessions
(
request
?:
protos
.
google
.
spanner
.
v1
.
IListSessionsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
spanner
.
v1
.
ISession
[],
protos
.
google
.
spanner
.
v1
.
IListSessionsRequest
|
null
,
protos
.
google
.
spanner
.
v1
.
IListSessionsResponse
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IListSessionsRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.spanner.v1.ISession [], protos. google.spanner.v1.IListSessionsRequest | null, protos. google.spanner.v1.IListSessionsResponse ]> |
listSessions(request, options, callback)
listSessions
(
request
:
protos
.
google
.
spanner
.
v1
.
IListSessionsRequest
,
options
:
CallOptions
,
callback
:
PaginationCallback<protos
.
google
.
spanner
.
v1
.
IListSessionsRequest
,
protos
.
google
.
spanner
.
v1
.
IListSessionsResponse
|
null
|
undefined
,
protos
.
google
.
spanner
.
v1
.
ISession
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IListSessionsRequest
|
request | |
CallOptions
|
options | |
PaginationCallback
<protos. google.spanner.v1.IListSessionsRequest
, protos. google.spanner.v1.IListSessionsResponse
| null | undefined, protos. google.spanner.v1.ISession
>
|
callback |
Type | Description |
---|---|
void |
listSessions(request, callback)
listSessions
(
request
:
protos
.
google
.
spanner
.
v1
.
IListSessionsRequest
,
callback
:
PaginationCallback<protos
.
google
.
spanner
.
v1
.
IListSessionsRequest
,
protos
.
google
.
spanner
.
v1
.
IListSessionsResponse
|
null
|
undefined
,
protos
.
google
.
spanner
.
v1
.
ISession
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IListSessionsRequest
|
request | |
PaginationCallback
<protos. google.spanner.v1.IListSessionsRequest
, protos. google.spanner.v1.IListSessionsResponse
| null | undefined, protos. google.spanner.v1.ISession
>
|
callback |
Type | Description |
---|---|
void |
listSessionsAsync(request, options)
listSessionsAsync
(
request
?:
protos
.
google
.
spanner
.
v1
.
IListSessionsRequest
,
options
?:
CallOptions
)
:
AsyncIterable<protos
.
google
.
spanner
.
v1
.
ISession
> ;
Equivalent to listSessions
, but returns an iterable object.
for
- await
- of
syntax is used with the iterable to get response elements on-demand.
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IListSessionsRequest
|
request | The request object that will be sent. |
CallOptions
|
options | Call options. See CallOptions for more details. |
Type | Description |
---|---|
AsyncIterable <protos. google.spanner.v1.ISession > | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Session]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
listSessionsStream(request, options)
listSessionsStream
(
request
?:
protos
.
google
.
spanner
.
v1
.
IListSessionsRequest
,
options
?:
CallOptions
)
:
Transform
;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IListSessionsRequest
|
request | The request object that will be sent. |
CallOptions
|
options | Call options. See CallOptions for more details. |
Type | Description |
---|---|
Transform | {Stream} An object stream which emits an object representing [Session] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
matchDatabaseFromDatabaseName(databaseName)
matchDatabaseFromDatabaseName
(
databaseName
:
string
)
:
string
|
number
;
Parse the database from Database resource.
Type | Name | Description |
---|---|---|
string
|
databaseName | A fully-qualified path representing Database resource. |
Type | Description |
---|---|
string | number | {string} A string representing the database. |
matchDatabaseFromSessionName(sessionName)
matchDatabaseFromSessionName
(
sessionName
:
string
)
:
string
|
number
;
Parse the database from Session resource.
Type | Name | Description |
---|---|---|
string
|
sessionName | A fully-qualified path representing Session resource. |
Type | Description |
---|---|
string | number | {string} A string representing the database. |
matchInstanceFromDatabaseName(databaseName)
matchInstanceFromDatabaseName
(
databaseName
:
string
)
:
string
|
number
;
Parse the instance from Database resource.
Type | Name | Description |
---|---|---|
string
|
databaseName | A fully-qualified path representing Database resource. |
Type | Description |
---|---|
string | number | {string} A string representing the instance. |
matchInstanceFromSessionName(sessionName)
matchInstanceFromSessionName
(
sessionName
:
string
)
:
string
|
number
;
Parse the instance from Session resource.
Type | Name | Description |
---|---|---|
string
|
sessionName | A fully-qualified path representing Session resource. |
Type | Description |
---|---|
string | number | {string} A string representing the instance. |
matchProjectFromDatabaseName(databaseName)
matchProjectFromDatabaseName
(
databaseName
:
string
)
:
string
|
number
;
Parse the project from Database resource.
Type | Name | Description |
---|---|---|
string
|
databaseName | A fully-qualified path representing Database resource. |
Type | Description |
---|---|
string | number | {string} A string representing the project. |
matchProjectFromSessionName(sessionName)
matchProjectFromSessionName
(
sessionName
:
string
)
:
string
|
number
;
Parse the project from Session resource.
Type | Name | Description |
---|---|---|
string
|
sessionName | A fully-qualified path representing Session resource. |
Type | Description |
---|---|
string | number | {string} A string representing the project. |
matchSessionFromSessionName(sessionName)
matchSessionFromSessionName
(
sessionName
:
string
)
:
string
|
number
;
Parse the session from Session resource.
Type | Name | Description |
---|---|---|
string
|
sessionName | A fully-qualified path representing Session resource. |
Type | Description |
---|---|
string | number | {string} A string representing the session. |
partitionQuery(request, options)
partitionQuery
(
request
?:
protos
.
google
.
spanner
.
v1
.
IPartitionQueryRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
spanner
.
v1
.
IPartitionResponse
,
protos
.
google
.
spanner
.
v1
.
IPartitionQueryRequest
|
undefined
,
{}
|
undefined
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IPartitionQueryRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.spanner.v1.IPartitionResponse , protos. google.spanner.v1.IPartitionQueryRequest | undefined, {} | undefined]> |
partitionQuery(request, options, callback)
partitionQuery
(
request
:
protos
.
google
.
spanner
.
v1
.
IPartitionQueryRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
IPartitionResponse
,
protos
.
google
.
spanner
.
v1
.
IPartitionQueryRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IPartitionQueryRequest
|
request | |
CallOptions
|
options | |
Callback
<protos. google.spanner.v1.IPartitionResponse
, protos. google.spanner.v1.IPartitionQueryRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
partitionQuery(request, callback)
partitionQuery
(
request
:
protos
.
google
.
spanner
.
v1
.
IPartitionQueryRequest
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
IPartitionResponse
,
protos
.
google
.
spanner
.
v1
.
IPartitionQueryRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IPartitionQueryRequest
|
request | |
Callback
<protos. google.spanner.v1.IPartitionResponse
, protos. google.spanner.v1.IPartitionQueryRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
partitionRead(request, options)
partitionRead
(
request
?:
protos
.
google
.
spanner
.
v1
.
IPartitionReadRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
spanner
.
v1
.
IPartitionResponse
,
protos
.
google
.
spanner
.
v1
.
IPartitionReadRequest
|
undefined
,
{}
|
undefined
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IPartitionReadRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.spanner.v1.IPartitionResponse , protos. google.spanner.v1.IPartitionReadRequest | undefined, {} | undefined]> |
partitionRead(request, options, callback)
partitionRead
(
request
:
protos
.
google
.
spanner
.
v1
.
IPartitionReadRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
IPartitionResponse
,
protos
.
google
.
spanner
.
v1
.
IPartitionReadRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IPartitionReadRequest
|
request | |
CallOptions
|
options | |
Callback
<protos. google.spanner.v1.IPartitionResponse
, protos. google.spanner.v1.IPartitionReadRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
partitionRead(request, callback)
partitionRead
(
request
:
protos
.
google
.
spanner
.
v1
.
IPartitionReadRequest
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
IPartitionResponse
,
protos
.
google
.
spanner
.
v1
.
IPartitionReadRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IPartitionReadRequest
|
request | |
Callback
<protos. google.spanner.v1.IPartitionResponse
, protos. google.spanner.v1.IPartitionReadRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
read(request, options)
read
(
request
?:
protos
.
google
.
spanner
.
v1
.
IReadRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
spanner
.
v1
.
IResultSet
,
protos
.
google
.
spanner
.
v1
.
IReadRequest
|
undefined
,
{}
|
undefined
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IReadRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.spanner.v1.IResultSet , protos. google.spanner.v1.IReadRequest | undefined, {} | undefined]> |
read(request, options, callback)
read
(
request
:
protos
.
google
.
spanner
.
v1
.
IReadRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
IResultSet
,
protos
.
google
.
spanner
.
v1
.
IReadRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IReadRequest
|
request | |
CallOptions
|
options | |
Callback
<protos. google.spanner.v1.IResultSet
, protos. google.spanner.v1.IReadRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
read(request, callback)
read
(
request
:
protos
.
google
.
spanner
.
v1
.
IReadRequest
,
callback
:
Callback<protos
.
google
.
spanner
.
v1
.
IResultSet
,
protos
.
google
.
spanner
.
v1
.
IReadRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IReadRequest
|
request | |
Callback
<protos. google.spanner.v1.IResultSet
, protos. google.spanner.v1.IReadRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
rollback(request, options)
rollback
(
request
?:
protos
.
google
.
spanner
.
v1
.
IRollbackRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
spanner
.
v1
.
IRollbackRequest
|
undefined
,
{}
|
undefined
]>;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IRollbackRequest
|
request | |
CallOptions
|
options |
Type | Description |
---|---|
Promise <[protos. google.protobuf.IEmpty , protos. google.spanner.v1.IRollbackRequest | undefined, {} | undefined]> |
rollback(request, options, callback)
rollback
(
request
:
protos
.
google
.
spanner
.
v1
.
IRollbackRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
spanner
.
v1
.
IRollbackRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IRollbackRequest
|
request | |
CallOptions
|
options | |
Callback
<protos. google.protobuf.IEmpty
, protos. google.spanner.v1.IRollbackRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
rollback(request, callback)
rollback
(
request
:
protos
.
google
.
spanner
.
v1
.
IRollbackRequest
,
callback
:
Callback<protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
spanner
.
v1
.
IRollbackRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IRollbackRequest
|
request | |
Callback
<protos. google.protobuf.IEmpty
, protos. google.spanner.v1.IRollbackRequest
| null | undefined, {} | null | undefined>
|
callback |
Type | Description |
---|---|
void |
sessionPath(project, instance, database, session)
sessionPath
(
project
:
string
,
instance
:
string
,
database
:
string
,
session
:
string
)
:
string
;
Return a fully-qualified session resource name string.
Type | Name | Description |
---|---|---|
string
|
project | |
string
|
instance | |
string
|
database | |
string
|
session |
Type | Description |
---|---|
string | {string} Resource name string. |
streamingRead(request, options)
streamingRead
(
request
?:
protos
.
google
.
spanner
.
v1
.
IReadRequest
,
options
?:
CallOptions
)
:
gax
.
CancellableStream
;
Like , except returns the result set as a stream. Unlike , there is no limit on the size of the returned result set. However, no individual row in the result set can exceed 100 MiB, and no column value can exceed 10 MiB.
Type | Name | Description |
---|---|---|
protos. google.spanner.v1.IReadRequest
|
request | The request object that will be sent. |
CallOptions
|
options | Call options. See CallOptions for more details. |
Type | Description |
---|---|
gax. CancellableStream | {Stream} An object stream which emits [PartialResultSet] on 'data' event. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) for more details and examples. |