@google-cloud/spanner
The default export of the @google-cloud/spanner
package is the
Spanner class.
See Spanner and ClientConfig for client methods and configuration options.
Examples
Install the client library with npm:
npm install --save @google-cloud/spanner
Import the client library
const {Spanner} = require('@google-cloud/spanner');
Create a client that uses Application Default Credentials (ADC):
const client = new Spanner();
Create a client with explicit credentials:
const client = new Spanner({
projectId: 'your-project-id',
keyFilename: '/path/to/keyfile.json'
});
Full quickstart example:
Properties
Database
Reference to the Database class.
- See also
- Database
Instance
Reference to the Instance class.
- See also
- Instance
Table
Reference to the Table class.
- See also
- Table
Transaction
Reference to the Transaction class.
- See also
- Transaction
TransactionRequest
Reference to the TransactionRequest class.
- See also
- TransactionRequest
v1
object
Properties
Parameter |
|
---|---|
DatabaseAdminClient |
constructor Reference to v1.DatabaseAdminClient |
InstanceAdminClient |
constructor Reference to v1.InstanceAdminClient |
SpannerClient |
constructor Reference to v1.SpannerClient |