Global

Members

v1 :object

Properties:
Name Type Description
DatabaseAdminClient constructor

Reference to v1.DatabaseAdminClient

InstanceAdminClient constructor

Reference to v1.InstanceAdminClient

SpannerClient constructor

Reference to v1.SpannerClient

Methods

isSessionNotFoundError(error)

Checks whether the given error is a 'Session not found' error.

Parameters:
Name Type Description
error

the error to check

Type Definitions

BasicCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

apiResponse object

The full API response.

BasicResponse :array

Properties:
Name Type Description
0 object

The full API response.

BatchCreateSessionsCallback(errnullable, sessions, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

sessions Array.<Session>

The newly created sessions.

apiResponse object

The full API response.

BatchCreateSessionsOptions :object

Properties:
Name Type Attributes Description
count number

The number of sessions to create.

labels object.<string, string> <optional>

Labels to apply to each session.

BatchCreateSessionsResponse :array

Properties:
Name Type Description
0 Array.<Session>

The newly created sessions.

1 object

The full API response.

BatchUpdateCallback(errnullable, rowCounts, apiResponse)

Parameters:
Name Type Attributes Description
err BatchUpdateError <nullable>

Request error, if any.

rowCounts Array.<number>

Affected row counts.

apiResponse object

The full API response.

BatchUpdateError :error

Properties:
Name Type Attributes Description
code number

gRPC status code.

metadata object <nullable>

gRPC metadata.

rowCounts Array.<number>

The affected row counts for any DML statements that were executed successfully before this error occurred.

BatchUpdateResponse :array

Properties:
Name Type Description
0 Array.<number>

Affected row counts.

1 object

The full API response.

ClientConfig :object

Properties:
Name Type Attributes Default Description
projectId string <optional>

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

keyFilename string <optional>

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option above is not necessary. NOTE: .pem and .p12 require you to specify the email option as well.

email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
autoRetry boolean <optional>
true

Automatically retry requests if the response is related to rate limits or certain intermittent server errors. We will exponentially backoff subsequent requests by default.

maxRetries number <optional>
3

Maximum number of automatic retries attempted before returning the error.

promise Constructor <optional>

Custom promise module to use instead of native Promises.

CloseDatabaseCallback(errnullable)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

CommitCallback(errornullable, apiResponse)

Parameters:
Name Type Attributes Description
error Error <nullable>

Request error, if any.

apiResponse CommitResponse

The full API response.

CommitPromiseResponse :array

Properties:
Name Type Description
0 CommitResponse

The commit response.

CommitResponse :object

Properties:
Name Type Description
commitTimestamp google.protobuf.Timestamp

The transaction commit timestamp.

CreateDatabaseCallback(errnullable, database, operation, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

database Database

The new Database.

operation Operation

An Operation object that can be used to check the status of the request.

apiResponse object

The full API response.

CreateDatabaseRequest :object

Config for the new database.

Properties:
Name Type Attributes Description
poolOptions SessionPoolOptions <optional>
poolCtor SessionPoolCtor <optional>

CreateDatabaseResponse :array

Properties:
Name Type Description
0 Database

The new Database.

1 Operation

An Operation object that can be used to check the status of the request.

2 object

The full API response.

CreateInstanceCallback(errnullable, instance, operation, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

instance Instance

The new Instance.

operation Operation

An Operation object that can be used to check the status of the request.

apiResponse object

The full API response.

CreateInstanceRequest :object

Config for the new instance.

Properties:
Name Type Description
config string

The name of the instance's configuration.

nodes number

The number of nodes allocated to this instance.

CreateInstanceResponse :array

Properties:
Name Type Description
0 Instance

The new Instance.

1 Operation

An Operation object that can be used to check the status of the request.

2 object

The full API response.

CreateQueryPartitionsCallback(errnullable, partitions, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

partitions Array.<QueryPartition>

List of query partitions.

apiResponse object

The full API response.

CreateQueryPartitionsResponse :array

Properties:
Name Type Description
0 Array.<QueryPartition>

List of query partitions.

1 object

The full API response.

CreateReadPartitionsCallback(errnullable, partitions, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

partitions Array.<ReadPartition>

List of read partitions.

apiResponse object

The full API response.

CreateReadPartitionsResponse :array

Properties:
Name Type Description
0 Array.<ReadPartition>

List of read partitions.

1 object

The full API response.

CreateSessionCallback(errnullable, session, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

session Session

The newly created session.

apiResponse object

The full API response.

CreateSessionCallback(errnullable, session, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

session Session

The Session.

apiResponse object

The full API response.

CreateSessionResponse :array

Properties:
Name Type Description
0 Session

The newly created session.

1 object

The full API response.

CreateTableCallback(errnullable, table, operation, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

table Table

The new Table.

operation Operation

An Operation object that can be used to check the status of the request.

apiResponse object

The full API response.

CreateTableResponse :array

Properties:
Name Type Description
0 Table

The new Table.

1 Operation

An Operation object that can be used to check the status of the request.

2 object

The full API response.

CreateTransactionCallback(errnullable, transaction, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

transaction BatchTransaction

The BatchTransaction.

apiResponse object

The full API response.

CreateTransactionResponse :array

Properties:
Name Type Description
0 BatchTransaction

The BatchTransaction.

1 object

The full API response.

DatabaseExistsCallback(errnullable, exists)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

exists boolean

Whether the Database exists.

DatabaseExistsResponse :array

Properties:
Name Type Description
0 boolean

Whether the Database exists.

DatabaseRunRequest :object

Transaction options.

Properties:
Name Type Attributes Description
exactStaleness number <optional>

Executes all reads at the timestamp that is exactStaleness old.

readTimestamp date <optional>

Execute all reads at the given timestamp.

strong boolean <optional>

Read at the timestamp where all previously committed transactions are visible.

DeleteInstanceCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

apiResponse object

The full API response.

DeleteInstanceResponse :array

Properties:
Name Type Description
0 object

The full API response.

ExecuteSqlRequest :object

ExecuteSql request options. This includes all standard ExecuteSqlRequest options as well as several convenience properties.

Properties:
Name Type Attributes Default Description
sql string

The SQL string.

params Object.<string, *> <optional>

A map of parameter names to values.

types Object.<string, (string|ParamType)> <optional>

A map of parameter names to types. If omitted the client will attempt to guess for all non-null values.

json boolean <optional>
false

Receive the rows as serialized objects. This is the equivalent of calling toJSON() on each row.

jsonOptions JSONOptions <optional>

Configuration options for the serialized objects.

See:

Float

See:

GetDatabaseCallback(errnullable, database, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

database Database

The Database.

apiResponse object

The full API response.

GetDatabaseMetadataCallback(errnullable, metadata, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

metadata object

The Database metadata.

apiResponse object

The full API response.

GetDatabaseMetadataResponse :array

Properties:
Name Type Description
0 object

The Database metadata.

1 object

The full API response.

GetDatabaseResponse :array

Properties:
Name Type Description
0 Database

The Database.

1 object

The full API response.

GetDatabasesCallback(errnullable, databases, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

databases Array.<Database>

Array of Database instances.

apiResponse object

The full API response.

GetDatabasesRequest :object

Query object for listing databases.

Properties:
Name Type Attributes Default Description
autoPaginate boolean <optional>
true

Have pagination handled automatically.

maxApiCalls number <optional>

Maximum number of API calls to make.

maxResults number <optional>

Maximum number of items to return.

pageSize number <optional>

Maximum number of results per page.

pageToken string <optional>

A previously-returned page token representing part of the larger set of results to view.

GetDatabasesResponse :array

Properties:
Name Type Description
0 Array.<Database>

Array of Database instances.

1 object

The full API response.

GetInstanceCallback(errnullable, instance, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

instance Instance

The Instance.

apiResponse object

The full API response.

GetInstanceConfigsCallback(errnullable, instanceConfigs, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

instanceConfigs Array.<object>

List of all available instance configs.

Properties
Name Type Description
name string

The unique identifier for the instance config.

displayName string

The name of the instance config as it appears in UIs.

apiResponse object

The full API response.

GetInstanceConfigsRequest :object

Query object for listing instance configs.

Properties:
Name Type Attributes Default Description
autoPaginate boolean <optional>
true

Have pagination handled automatically.

maxApiCalls number <optional>

Maximum number of API calls to make.

maxResults number <optional>

Maximum number of items to return.

pageSize number <optional>

Maximum number of results per page.

pageToken string <optional>

A previously-returned page token representing part of the larger set of results to view.

GetInstanceConfigsResponse :array

Properties:
Name Type Description
0 Array.<object>

List of all available instance configs.

Properties
Name Type Description
name string

The unique identifier for the instance config.

displayName string

The name of the instance config as it appears in UIs.

1 object

The full API response.

GetInstanceMetadataCallback(errnullable, metadata, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

metadata object

The Instance metadata.

apiResponse object

The full API response.

GetInstanceMetadataResponse :array

Properties:
Name Type Description
0 object

The Instance metadata.

1 object

The full API response.

GetInstanceResponse :array

Properties:
Name Type Description
0 Instance

The Instance.

1 object

The full API response.

GetInstancesCallback(errnullable, instances, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

instances Array.<Instance>

Array of Instance instances.

apiResponse object

The full API response.

GetInstancesRequest :object

Query object for listing instances.

Properties:
Name Type Attributes Default Description
autoPaginate boolean <optional>
true

Have pagination handled automatically.

filter string <optional>

An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: - name - display_name - labels.key where key is the name of a label

Some examples of using filters are:
- **`name:*`** The instance has a name.
- **`name:Howl`** The instance's name is howl.
- **`labels.env:*`** The instance has the label env.
- **`labels.env:dev`** The instance's label env has the value dev.
- **`name:howl labels.env:dev`** The instance's name is howl and it has
  the label env with value dev.
maxApiCalls number <optional>

Maximum number of API calls to make.

maxResults number <optional>

Maximum number of items to return.

pageSize number <optional>

Maximum number of results per page.

pageToken string <optional>

A previously-returned page token representing part of the larger set of results to view.

GetInstancesResponse :array

Properties:
Name Type Description
0 Array.<Instance>

Array of Instance instances.

1 object

The full API response.

GetSchemaCallback(errnullable, statements, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

statements Array.<string>

An array of database DDL statements.

apiResponse object

The full API response.

GetSchemaResponse :array

Properties:
Name Type Description
0 Array.<string>

An array of database DDL statements.

1 object

The full API response.

GetSessionMetadataCallback(errnullable, metadata, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

metadata object

The session's metadata.

apiResponse object

The full API response.

GetSessionMetadataResponse :array

Properties:
Name Type Description
0 object

The session's metadata.

1 object

The full API response.

GetSessionResponse :array

Properties:
Name Type Description
0 Session

The Session.

1 object

The full API response.

GetSessionsCallback(errnullable, instances, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

instances Array.<Session>

Array of Session instances.

apiResponse object

The full API response.

GetSessionsRequest :object

Options object for listing sessions.

Properties:
Name Type Attributes Default Description
autoPaginate boolean <optional>
true

Have pagination handled automatically.

filter string <optional>

An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: - name - display_name - labels.key where key is the name of a label

Some examples of using filters are:
- **`name:*`** The instance has a name.
- **`name:Howl`** The instance's name is howl.
- **`labels.env:*`** The instance has the label env.
- **`labels.env:dev`** The instance's label env has the value dev.
- **`name:howl labels.env:dev`** The instance's name is howl and it has
  the label env with value dev.
maxApiCalls number <optional>

Maximum number of API calls to make.

maxResults number <optional>

Maximum number of items to return.

pageSize number <optional>

Maximum number of results per page.

pageToken string <optional>

A previously-returned page token representing part of the larger set of results to view.

GetSessionsResponse :array

Properties:
Name Type Description
0 Array.<Session>

Array of Session instances.

1 object

The full API response.

GetSnapshotCallback(errnullable, snapshot)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

snapshot Snapshot

The snapshot object.

GetSnapshotResponse :array

Properties:
Name Type Description
0 Snapshot

The snapshot object.

GetTransactionCallback(errnullable, transaction)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

transaction Transaction

The transaction object.

GetTransactionResponse :array

Properties:
Name Type Description
0 Transaction

The transaction object.

InstanceExistsCallback(errnullable, exists)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

exists boolean

Whether the Instance exists.

InstanceExistsResponse :array

Properties:
Name Type Description
0 boolean

Whether the Instance exists.

Int

See:

JSONOptions

Properties:
Name Type Attributes Default Description
wrapNumbers boolean <optional>
false

Indicates if the numbers should be wrapped in Int/Float wrappers.

wrapStructs boolean <optional>
false

Indicates if the structs should be wrapped in Struct wrapper.

KeyRange :object

A KeyRange represents a range of rows in a table or index.

A range has a start key and an end key. These keys can be open or closed, indicating if the range includes rows with that key.

Keys are represented by an array of strings where the nth value in the list corresponds to the nth component of the table or index primary key.

Properties:
Name Type Attributes Description
startClosed Array.<string> <optional>

If the start is closed, then the range includes all rows whose first key columns exactly match.

startOpen Array.<string> <optional>

If the start is open, then the range excludes rows whose first key columns exactly match.

endClosed Array.<string> <optional>

If the end is closed, then the range includes all rows whose first key columns exactly match.

endOpen Array.<string> <optional>

If the end is open, then the range excludes rows whose first key columns exactly match.

LongRunningOperationCallback(errnullable, operation, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

operation Operation

An Operation object that can be used to check the status of the request.

apiResponse object

The full API response.

LongRunningOperationResponse :array

Properties:
Name Type Description
0 Operation

An Operation object that can be used to check the status of the request.

1 object

The full API response.

ParamType :object

Properties:
Name Type Attributes Description
type string

The param type. Must be one of the following: - float64 - int64 - bool - string - bytes - timestamp - date - struct - array

fields Array.<StructField> <optional>

For struct types only. Type definitions for the individual fields.

child string | ParamType <optional>

For array types only. The array element type.

QueryPartition :object

Properties:
Name Type Description
partitionToken string

The partition token.

See:

ReadPartition :object

Properties:
Name Type Attributes Description
partitionToken string

The partition token.

gaxOptions object <optional>

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

Mixes In:
  • ReadRequestOptions

ReadRequest :object

Read request options. This includes all standard ReadRequest options as well as several convenience properties.

Properties:
Name Type Attributes Default Description
keys Array.<string> <optional>

The primary keys of the rows in this table to be yielded. If using a composite key, provide an array within this array. See the example below.

ranges Array.<KeyRange> <optional>

An alternative to the keys property; this can be used to define a range of keys to be yielded.

json boolean <optional>
false

Receive the rows as serialized objects. This is the equivalent of calling toJSON() on each row.

jsonOptions JSONOptions <optional>

Configuration options for the serialized objects.

See:

RunCallback(errnullable, rows, statsnullable)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

rows Array.<(Row|Json)>

Rows are returned as an array of objects. Each object has a name and value property. To get a serialized object, call toJSON().

stats ResultSetStats <nullable>

Query statistics, if the query is executed in PLAN or PROFILE mode.

RunResponse :array

Properties:
Name Type Attributes Description
0 Array.<(Row|Json)>

Rows are returned as an array objects. Each object has a name and value property. To get a serialized object, call toJSON().

1 ResultSetStats <nullable>

Query statistics, if the query is executed in PLAN or PROFILE mode.

RunUpdateCallback(errnullable, rowCount)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

rowCount number

Affected row count.

RunUpdateResponse :array

Properties:
Name Type Description
0 number

Affected row count.

SessionExistsCallback(errnullable, exists)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

exists boolean

Whether the Session exists.

SessionExistsResponse :array

Properties:
Name Type Description
0 boolean

Whether the Session exists.

Struct

See:

StructField :ParamType

Properties:
Name Type Description
name string

The name of the field.

TableReadCallback(errnullable, rows)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

rows Array.<array>

Rows are returned as an array of object arrays. Each object has a name and value property. To get a serialized object, call toJSON(). Optionally, provide an options object to toJSON() specifying wrapNumbers: true to protect large integer values outside of the range of JavaScript Number. If set, FLOAT64 values will be returned as Spanner.Float objects and INT64 values as Spanner.Int.

TableReadRequestOptions :object

Configuration object, describing what to read from the table.

Properties:
Name Type Attributes Default Description
columns Array.<string>

The columns of the table to be returned for each row matching this query.

keys array

The primary keys of the rows in this table to be yielded. If using a composite key, provide an array within this array. See the example below.

index string <optional>

The name of an index on the table.

json boolean <optional>
false

Receive the rows as serialized objects. This is the equivalent of calling toJSON() on each row.

jsonOptions object <optional>

Configuration options for the serialized objects.

Properties
Name Type Attributes Default Description
wrapNumbers boolean <optional>
false

Protect large integer values outside of the range of JavaScript Number.

keySet object <optional>

Defines a collection of keys and/or key ranges to read.

limit number <optional>

The number of rows to yield.

TableReadResponse :array

Properties:
Name Type Description
1 Array.<array>

Rows are returned as an array of object arrays. Each object has a name and value property. To get a serialized object, call toJSON(). Optionally, provide an options object to toJSON() specifying wrapNumbers: true to protect large integer values outside of the range of JavaScript Number. If set, FLOAT64 values will be returned as Spanner.Float objects and INT64 values as Spanner.Int.

TimestampBounds :object

Properties:
Name Type Attributes Default Description
strong boolean <optional>
true

Read at a timestamp where all previously committed transactions are visible.

minReadTimestamp external:PreciseDate | google.protobuf.Timestamp <optional>

Executes all reads at a timestamp >= minReadTimestamp.

maxStaleness number | google.protobuf.Timestamp <optional>

Read data at a timestamp >= NOW - maxStaleness (milliseconds).

readTimestamp external:PreciseDate | google.protobuf.Timestamp <optional>

Executes all reads at the given timestamp.

exactStaleness number | google.protobuf.Timestamp <optional>

Executes all reads at a timestamp that is exactStaleness (milliseconds) old.

returnReadTimestamp boolean <optional>
true

When true, Snapshot#readTimestamp will be populated after Snapshot#begin is called.

TransactionBeginCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

apiResponse TransactionResponse

The raw transaction object.

TransactionBeginResponse :array

Properties:
Name Type Description
0 TransactionResponse

The raw transaction object.

TransactionIdentifier :object

Properties:
Name Type Description
session string

The full session name.

transaction string

The transaction ID.

readTimestamp string | Date

The transaction read timestamp.

TransactionReadCallback(errnullable, rows)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

rows Array.<array>

Rows are returned as an array of object arrays. Each object has a name and value property. To get a serialized object, call toJSON(). Optionally, provide an options object to toJSON() specifying wrapNumbers: true to protect large integer values outside of the range of JavaScript Number. If set, FLOAT64 values are returned as Spanner.Float objects and INT64 values as Spanner.Int.

TransactionReadResponse :array

Properties:
Name Type Description
0 Array.<array>

Rows are returned as an array of object arrays. Each object has a name and value property. To get a serialized object, call toJSON(). Optionally, provide an options object to toJSON() specifying wrapNumbers: true to protect large integer values outside of the range of JavaScript Number. If set, FLOAT64 values are returned as Spanner.Float objects and INT64 values as Spanner.Int.

TransactionResponse :object

Properties:
Name Type Attributes Description
id string | Buffer

The transaction ID.

readTimestamp google.protobuf.Timestamp <nullable>

For snapshot read-only transactions, the read timestamp chosen for the transaction.