Send feedback
Class Instance
Stay organized with collections
Save and categorize content based on your preferences.
Version 5.14.0 keyboard_arrow_down
Inheritance
common .GrpcServiceObject
>
Instance
Package
@google-cloud/spanner!
Constructors
(constructor)(spanner, name)
constructor ( spanner : Spanner , name : string );
Constructs a new instance of the Instance
class
Parameters
Type Name Description Spanner spanner
string name
Properties
databases_
databases_ : Map<string , Database >;
Property Value
Type Description Map <string, Database >
Property Value
Property Value
request
request : InstanceRequest ;
Property Value
Type Description InstanceRequest
requestStream
requestStream : ( config : RequestConfig ) = > Duplex ;
Property Value
resourceHeader_ : {
[ k : string ] : string ;
};
Property Value
Type Description {
[k: string]: string;
}
Methods
backup(backupId)
backup ( backupId : string ) : Backup ;
Get a reference to a Backup object.
Parameter
Type Name Description string backupId
The name of the backup. {Backup} A Backup object.
Returns
createDatabase(name, options)
createDatabase ( name : string , options ?: CreateDatabaseOptions ) : Promise<CreateDatabaseResponse> ;
Parameters
Type Name Description string name
CreateDatabaseOptions options
Returns
Type Description Promise <CreateDatabaseResponse >
createDatabase(name, callback)
createDatabase ( name : string , callback : CreateDatabaseCallback ) : void ;
Parameters
Type Name Description string name
CreateDatabaseCallback callback
Returns
createDatabase(name, options, callback)
createDatabase ( name : string , options : CreateDatabaseOptions , callback : CreateDatabaseCallback ) : void ;
Parameters
Type Name Description string name
CreateDatabaseOptions options
CreateDatabaseCallback callback
Returns
database(name, poolOptions, queryOptions)
database ( name : string , poolOptions ?: SessionPoolOptions | SessionPoolConstructor , queryOptions ?: spannerClient . spanner . v1 . ExecuteSqlRequest . IQueryOptions ) : Database ;
Get a reference to a Database object.
Parameters
Type Name Description string name
The name of the instance.
SessionPoolOptions | SessionPoolConstructor poolOptions
Session pool configuration options.
spannerClient.spanner.v1.ExecuteSqlRequest.IQueryOptions queryOptions
Default query options to use with the database. These options will be overridden by any query options set in environment variables or that are specified on a per-query basis. {Database} A Database object.
Returns
delete(gaxOptions)
delete ( gaxOptions ?: CallOptions ) : Promise<DeleteInstanceResponse> ;
Parameter
Type Name Description CallOptions gaxOptions
Returns
Type Description Promise <DeleteInstanceResponse >
delete(callback)
delete ( callback : DeleteInstanceCallback ) : void ;
Parameter
Type Name Description DeleteInstanceCallback callback
Returns
delete(gaxOptions, callback)
delete ( gaxOptions : CallOptions , callback : DeleteInstanceCallback ) : void ;
Parameters
Type Name Description CallOptions gaxOptions
DeleteInstanceCallback callback
Returns
exists(gaxOptions)
exists ( gaxOptions ?: CallOptions ) : Promise<ExistsInstanceResponse> ;
Parameter
Type Name Description CallOptions gaxOptions
Returns
Type Description Promise <ExistsInstanceResponse >
exists(callback)
exists ( callback : ExistsInstanceCallback ) : void ;
Parameter
Type Name Description ExistsInstanceCallback callback
Returns
exists(gaxOptions, callback)
exists ( gaxOptions : CallOptions , callback : ExistsInstanceCallback ) : void ;
Parameters
Type Name Description CallOptions gaxOptions
ExistsInstanceCallback callback
Returns
static formatName_ ( projectId : string , name : string ) : string ;
Format the instance name to include the project ID.
Parameters
Type Name Description string projectId
The project ID.
string name
The instance name.
Returns
Type Description string {string}
get(options)
get ( options ?: GetInstanceConfig ) : Promise<GetInstanceResponse> ;
Parameter
Type Name Description GetInstanceConfig options
Returns
Type Description Promise <GetInstanceResponse >
get(callback)
get ( callback : GetInstanceCallback ) : void ;
Parameter
Type Name Description GetInstanceCallback callback
Returns
get(options, callback)
get ( options : GetInstanceConfig , callback : GetInstanceCallback ) : void ;
Parameters
Type Name Description GetInstanceConfig options
GetInstanceCallback callback
Returns
getBackupOperations(options)
getBackupOperations ( options ?: GetBackupOperationsOptions ) : Promise<GetBackupOperationsResponse> ;
Parameter
Type Name Description GetBackupOperationsOptions options
Returns
Type Description Promise <GetBackupOperationsResponse >
getBackupOperations(callback)
getBackupOperations ( callback : GetBackupOperationsCallback ) : void ;
Parameter
Type Name Description GetBackupOperationsCallback callback
Returns
getBackupOperations(options, callback)
getBackupOperations ( options : GetBackupOperationsOptions , callback : GetBackupOperationsCallback ) : void ;
Parameters
Type Name Description GetBackupOperationsOptions options
GetBackupOperationsCallback callback
Returns
getBackups(options)
getBackups ( options ?: GetBackupsOptions ) : Promise<GetBackupsResponse> ;
Parameter
Type Name Description GetBackupsOptions options
Returns
Type Description Promise <GetBackupsResponse >
getBackups(callback)
getBackups ( callback : GetBackupsCallback ) : void ;
Parameter
Type Name Description GetBackupsCallback callback
Returns
getBackups(options, callback)
getBackups ( options : GetBackupsOptions , callback : GetBackupsCallback ) : void ;
Parameters
Type Name Description GetBackupsOptions options
GetBackupsCallback callback
Returns
getBackupsStream(options)
getBackupsStream ( options ?: GetBackupsOptions ) : NodeJS . ReadableStream ;
Get a list of backups as a readable object stream.
Wrapper around .
[ListBackups API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.ListBackups)
Spanner#getBackupsStream
Parameter
Type Name Description GetBackupsOptions options
Query object for listing backups.
Returns
Type Description NodeJS.ReadableStream {ReadableStream} A readable stream that emits Backup instances.
getDatabaseOperations(options)
getDatabaseOperations ( options ?: GetDatabaseOperationsOptions ) : Promise<GetDatabaseOperationsResponse> ;
Parameter
Type Name Description GetDatabaseOperationsOptions options
Returns
Type Description Promise <GetDatabaseOperationsResponse >
getDatabaseOperations(callback)
getDatabaseOperations ( callback : GetDatabaseOperationsCallback ) : void ;
Parameter
Type Name Description GetDatabaseOperationsCallback callback
Returns
getDatabaseOperations(options, callback)
getDatabaseOperations ( options : GetDatabaseOperationsOptions , callback : GetDatabaseOperationsCallback ) : void ;
Parameters
Type Name Description GetDatabaseOperationsOptions options
GetDatabaseOperationsCallback callback
Returns
getDatabases(options)
getDatabases ( options ?: GetDatabasesOptions ) : Promise<GetDatabasesResponse> ;
Parameter
Type Name Description GetDatabasesOptions options
Returns
Type Description Promise <GetDatabasesResponse >
getDatabases(callback)
getDatabases ( callback : GetDatabasesCallback ) : void ;
Parameter
Type Name Description GetDatabasesCallback callback
Returns
getDatabases(options, callback)
getDatabases ( options : GetDatabasesOptions , callback : GetDatabasesCallback ) : void ;
Parameters
Type Name Description GetDatabasesOptions options
GetDatabasesCallback callback
Returns
getDatabasesStream(options)
getDatabasesStream ( options ?: GetDatabasesOptions ) : NodeJS . ReadableStream ;
Get a list of databases as a readable object stream.
Wrapper around .
[ListDatabases API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases)
Spanner#getDatabasesStream
Parameter
Type Name Description GetDatabasesOptions options
Query object for listing databases.
Returns
Type Description NodeJS.ReadableStream {ReadableStream} A readable stream that emits Database instances.
getMetadata ( options ?: GetInstanceMetadataOptions ) : Promise<GetInstanceMetadataResponse> ;
Parameter
Type Name Description GetInstanceMetadataOptions options
Returns
Type Description Promise <GetInstanceMetadataResponse >
getMetadata ( callback : GetInstanceMetadataCallback ) : void ;
Parameter
Type Name Description GetInstanceMetadataCallback callback
Returns
getMetadata ( options : GetInstanceMetadataOptions , callback : GetInstanceMetadataCallback ) : void ;
Parameters
Type Name Description GetInstanceMetadataOptions options
GetInstanceMetadataCallback callback
Returns
setMetadata ( metadata : IInstance , gaxOptions ?: CallOptions ) : Promise<SetInstanceMetadataResponse> ;
Parameters
Type Name Description IInstance metadata
CallOptions gaxOptions
Returns
Type Description Promise <SetInstanceMetadataResponse >
setMetadata ( metadata : IInstance , callback : SetInstanceMetadataCallback ) : void ;
Parameters
Type Name Description IInstance metadata
SetInstanceMetadataCallback callback
Returns
setMetadata ( metadata : IInstance , gaxOptions : CallOptions , callback : SetInstanceMetadataCallback ) : void ;
Parameters
Type Name Description IInstance metadata
CallOptions gaxOptions
SetInstanceMetadataCallback callback
Returns
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-19 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-19 UTC."],[],[]]