Zum Hauptinhalt springen

Google Spanner

Inoffizielle Beta-Übersetzung

Diese Seite wurde von PageTurner AI übersetzt (Beta). Nicht offiziell vom Projekt unterstützt. Fehler gefunden? Problem melden →

Installation

npm install @google-cloud/spanner

Datenquellen-Optionen

Allgemeine Datenquellen-Optionen finden Sie unter Data Source Options.

Stellen Sie Ihrem Anwendungscode Authentifizierungsdaten bereit, indem Sie die Umgebungsvariable GOOGLE_APPLICATION_CREDENTIALS setzen:

# Linux/macOS
export GOOGLE_APPLICATION_CREDENTIALS="KEY_PATH"

# Windows
set GOOGLE_APPLICATION_CREDENTIALS=KEY_PATH

# Replace KEY_PATH with the path of the JSON file that contains your service account key.

Um Spanner mit dem Emulator zu verwenden, setzen Sie die Umgebungsvariable SPANNER_EMULATOR_HOST:

# Linux/macOS
export SPANNER_EMULATOR_HOST=localhost:9010

# Windows
set SPANNER_EMULATOR_HOST=localhost:9010

Spaltentypen

bool, int64, float64, numeric, string, json, bytes, date, timestamp, array