Saltar al contenido principal

Google Spanner

Traducción Beta No Oficial

Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →

Instalación

npm install @google-cloud/spanner

Opciones de Data Source

Consulta Opciones de Origen de Datos para ver las opciones comunes de origen de datos.

Proporciona credenciales de autenticación a tu código de aplicación configurando la variable de entorno GOOGLE_APPLICATION_CREDENTIALS:

# 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.

Para usar Spanner con el emulador, configura la variable de entorno SPANNER_EMULATOR_HOST:

# Linux/macOS
export SPANNER_EMULATOR_HOST=localhost:9010

# Windows
set SPANNER_EMULATOR_HOST=localhost:9010

Tipos de Columna

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