Globals

Property

v1

object

Properties

Parameter

DatabaseAdminClient

constructor

Reference to v1.DatabaseAdminClient

InstanceAdminClient

constructor

Reference to v1.InstanceAdminClient

SpannerClient

constructor

Reference to v1.SpannerClient

Abstract types

BasicCallback

BasicCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

BasicResponse

array

Property

Parameter

0

object

The full API response.

BatchUpdateCallback

BatchUpdateCallback(err, rowCounts, apiResponse)

Parameter

err

BatchUpdateError

Request error, if any.

Value may be null.

rowCounts

Array of number

Affected row counts.

apiResponse

object

The full API response.

BatchUpdateError

error

Properties

Parameter

code

number

gRPC status code.

metadata

object

gRPC metadata.

Value may be null.

rowCounts

Array of number

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

BatchUpdateResponse

array

Properties

Parameter

0

Array of number

Affected row counts.

1

object

The full API response.

ClientConfig

object

Properties

Parameter

projectId

Optional

string

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

Optional

string

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

Optional

string

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

credentials

Optional

object

Credentials object.

Values in credentials have the following properties:

Parameter

client_email

Optional

string

private_key

Optional

string

autoRetry

Optional

boolean

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

Optional

number

Maximum number of automatic retries attempted before returning the error.

promise

Optional

Constructor

Custom promise module to use instead of native Promises.

CloseDatabaseCallback

CloseDatabaseCallback(err)

Parameter

err

Error

Request error, if any.

Value may be null.

CommitCallback

CommitCallback(error, apiResponse)

Parameter

error

Error

Request error, if any.

Value may be null.

apiResponse

CommitResponse

The full API response.

CommitPromiseResponse

array

Property

Parameter

0

CommitResponse

The commit response.

CommitResponse

object

Property

Parameter

commitTimestamp

google.protobuf.Timestamp

The transaction commit timestamp.

CreateDatabaseCallback

CreateDatabaseCallback(err, database, operation, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

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

Parameter

poolOptions

Optional

SessionPoolOptions

poolCtor

Optional

SessionPoolCtor

CreateDatabaseResponse

array

Properties

Parameter

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

CreateInstanceCallback(err, instance, operation, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

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

Parameter

config

string

The name of the instance's configuration.

nodes

number

The number of nodes allocated to this instance.

CreateInstanceResponse

array

Properties

Parameter

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

CreateQueryPartitionsCallback(err, partitions, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

partitions

Array of QueryPartition

List of query partitions.

apiResponse

object

The full API response.

CreateQueryPartitionsResponse

array

Properties

Parameter

0

Array of QueryPartition

List of query partitions.

1

object

The full API response.

CreateReadPartitionsCallback

CreateReadPartitionsCallback(err, partitions, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

partitions

Array of ReadPartition

List of read partitions.

apiResponse

object

The full API response.

CreateReadPartitionsResponse

array

Properties

Parameter

0

Array of ReadPartition

List of read partitions.

1

object

The full API response.

CreateSessionCallback

CreateSessionCallback(err, session, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

session

Session

The Session.

apiResponse

object

The full API response.

CreateSessionCallback

CreateSessionCallback(err, session, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

session

Session

The newly created session.

apiResponse

object

The full API response.

CreateSessionResponse

array

Properties

Parameter

0

Session

The newly created session.

2

object

The full API response.

CreateTableCallback

CreateTableCallback(err, table, operation, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

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

Parameter

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

CreateTransactionCallback(err, transaction, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

transaction

BatchTransaction

The BatchTransaction.

apiResponse

object

The full API response.

CreateTransactionResponse

array

Properties

Parameter

0

BatchTransaction

The BatchTransaction.

1

object

The full API response.

DatabaseRunRequest

object

Transaction options.

Properties

Parameter

exactStaleness

Optional

number

Executes all reads at the timestamp that is exactStaleness old.

readTimestamp

Optional

date

Execute all reads at the given timestamp.

strong

Optional

boolean

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

DeleteInstanceCallback

DeleteInstanceCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

DeleteInstanceResponse

array

Property

Parameter

0

object

The full API response.

ExecuteSqlRequest

object

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

Properties

Parameter

sql

string

The SQL string.

params

Optional

Object with any type properties

A map of parameter names to values.

types

Optional

Object with (string or ParamType) properties

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

json

Optional

boolean

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

jsonOptions

Optional

JSONOptions

Configuration options for the serialized objects.

See also

Query Syntax

ExecuteSql API Documentation

Float

See also
Spanner.float

GetDatabasesCallback

GetDatabasesCallback(err, databases, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

databases

Array of Database

Array of Database instances.

apiResponse

object

The full API response.

GetDatabasesRequest

object

Query object for listing databases.

Properties

Parameter

autoPaginate

Optional

boolean

Have pagination handled automatically.

maxApiCalls

Optional

number

Maximum number of API calls to make.

maxResults

Optional

number

Maximum number of items to return.

pageSize

Optional

number

Maximum number of results per page.

pageToken

Optional

string

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

GetDatabasesResponse

array

Properties

Parameter

0

Array of Database

Array of Database instances.

1

object

The full API response.

GetInstanceCallback

GetInstanceCallback(err, instance, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

instance

Instance

The Instance.

apiResponse

object

The full API response.

GetInstanceConfigsCallback

GetInstanceConfigsCallback(err, instanceConfigs, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

instanceConfigs

Array of object

List of all available instance configs.

Values in instanceConfigs have the following properties:

Parameter

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

Parameter

autoPaginate

Optional

boolean

Have pagination handled automatically.

maxApiCalls

Optional

number

Maximum number of API calls to make.

maxResults

Optional

number

Maximum number of items to return.

pageSize

Optional

number

Maximum number of results per page.

pageToken

Optional

string

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

GetInstanceConfigsResponse

array

Properties

Parameter

0

Array of object

List of all available instance configs.

Values in 0 have the following properties:

Parameter

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

GetInstanceMetadataCallback(err, metadata, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

metadata

object

The Instance metadata.

apiResponse

object

The full API response.

GetInstanceMetadataResponse

array

Properties

Parameter

0

object

The Instance metadata.

1

object

The full API response.

GetInstanceResponse

array

Properties

Parameter

0

Instance

The Instance.

1

object

The full API response.

GetInstancesCallback

GetInstancesCallback(err, instances, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

instances

Array of Instance

Array of Instance instances.

apiResponse

object

The full API response.

GetInstancesRequest

object

Query object for listing instances.

Properties

Parameter

autoPaginate

Optional

boolean

Have pagination handled automatically.

filter

Optional

string

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

Optional

number

Maximum number of API calls to make.

maxResults

Optional

number

Maximum number of items to return.

pageSize

Optional

number

Maximum number of results per page.

pageToken

Optional

string

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

GetInstancesResponse

array

Properties

Parameter

0

Array of Instance

Array of Instance instances.

1

object

The full API response.

GetSchemaCallback

GetSchemaCallback(err, statements, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

statements

Array of string

An array of database DDL statements.

apiResponse

object

The full API response.

GetSchemaResponse

array

Properties

Parameter

0

Array of string

An array of database DDL statements.

1

object

The full API response.

GetSessionResponse

array

Properties

Parameter

0

Session

The Session.

1

object

The full API response.

GetSessionsCallback

GetSessionsCallback(err, instances, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

instances

Array of Session

Array of Session instances.

apiResponse

object

The full API response.

GetSessionsRequest

object

Options object for listing sessions.

Properties

Parameter

autoPaginate

Optional

boolean

Have pagination handled automatically.

filter

Optional

string

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

Optional

number

Maximum number of API calls to make.

maxResults

Optional

number

Maximum number of items to return.

pageSize

Optional

number

Maximum number of results per page.

pageToken

Optional

string

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

GetSessionsResponse

array

Properties

Parameter

0

Array of Session

Array of Session instances.

1

object

The full API response.

GetSnapshotCallback

GetSnapshotCallback(err, snapshot)

Parameter

err

Error

Request error, if any.

Value may be null.

snapshot

Snapshot

The snapshot object.

GetSnapshotResponse

array

Property

Parameter

0

Snapshot

The snapshot object.

GetTransactionCallback

GetTransactionCallback(err, transaction)

Parameter

err

Error

Request error, if any.

Value may be null.

transaction

Transaction

The transaction object.

GetTransactionResponse

array

Property

Parameter

0

Transaction

The transaction object.

InstanceExistsCallback

InstanceExistsCallback(err, exists)

Parameter

err

Error

Request error, if any.

Value may be null.

exists

boolean

Whether the Instance exists.

InstanceExistsResponse

array

Property

Parameter

0

boolean

Whether the Instance exists.

Int

See also
Spanner.int

JSONOptions

Properties

Parameter

wrapNumbers

Optional

boolean

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

wrapStructs

Optional

boolean

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

Parameter

startClosed

Optional

Array of string

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

startOpen

Optional

Array of string

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

endClosed

Optional

Array of string

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

endOpen

Optional

Array of string

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

LongRunningOperationCallback

LongRunningOperationCallback(err, operation, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

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

Parameter

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

Parameter

type

string

The param type. Must be one of the following:

- float64
- int64
- bool
- string
- bytes
- timestamp
- date
- struct
- array

fields

Optional

Array of StructField

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

child

Optional

(string or ParamType)

For array types only. The array element type.

QueryPartition

object

Property

Parameter

partitionToken

string

The partition token.

See also

ExecuteSqlRequest

ReadPartition

object

Properties

Parameter

partitionToken

string

The partition token.

gaxOptions

Optional

object

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

Parameter

keys

Optional

Array of string

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

Optional

Array of KeyRange

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

json

Optional

boolean

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

jsonOptions

Optional

JSONOptions

Configuration options for the serialized objects.

See also

StreamingRead API Documentation

ReadRequest API Documentation

RunCallback

RunCallback(err, rows, stats)

Parameter

err

Error

Request error, if any.

Value may be null.

rows

Array of array

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

stats

object

Stats returned for the provided SQL statement.

RunResponse

array

Property

Parameter

0

Array of array

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

RunUpdateCallback

RunUpdateCallback(err, rowCount)

Parameter

err

Error

Request error, if any.

Value may be null.

rowCount

number

Affected row count.

RunUpdateResponse

array

Property

Parameter

0

number

Affected row count.

SessionExistsCallback

SessionExistsCallback(err, exists)

Parameter

err

Error

Request error, if any.

Value may be null.

exists

boolean

Whether the Session exists.

SessionExistsResponse

array

Property

Parameter

0

boolean

Whether the Session exists.

Struct

See also
Spanner.struct

StructField

ParamType

Property

Parameter

name

string

The name of the field.

TimestampBounds

object

Properties

Parameter

strong

Optional

boolean

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

minReadTimestamp

Optional

(external:PreciseDate or google.protobuf.Timestamp)

Executes all reads at a timestamp >= minReadTimestamp.

maxStaleness

Optional

(number or google.protobuf.Timestamp)

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

readTimestamp

Optional

(external:PreciseDate or google.protobuf.Timestamp)

Executes all reads at the given timestamp.

exactStaleness

Optional

(number or google.protobuf.Timestamp)

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

returnReadTimestamp

Optional

boolean

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

TransactionBeginCallback

TransactionBeginCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

TransactionResponse

The raw transaction object.

TransactionBeginResponse

array

Property

Parameter

0

TransactionResponse

The raw transaction object.

TransactionIdentifier

object

Properties

Parameter

session

string

The full session name.

transaction

string

The transaction ID.

readTimestamp

(string or Date)

The transaction read timestamp.

TransactionReadCallback

TransactionReadCallback(err, rows)

Parameter

err

Error

Request error, if any.

Value may be null.

rows

Array of 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

Property

Parameter

0

Array of 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

Parameter

id

(string or Buffer)

The transaction ID.

readTimestamp

google.protobuf.Timestamp

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

Value may be null.