samples

package module
v0.0.0-...-e005a71 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

README

Spanner GORM Examples

This directory contains samples for how to use GORM with Cloud Spanner. Each sample can be executed as a standalone application without the need for any prior setup, other than that Docker must be installed on your system. Each sample will automatically:

  1. Download and start the Spanner Emulator in a Docker container.
  2. Create a sample database and execute the sample on the sample database.
  3. Shutdown the Docker container that is running the emulator.

Running a sample is done by navigating to the corresponding sample directory and executing the following command:

# Change the 'helloword' directory below to any of the samples in this directory.
cd helloworld
go run main.go

Prerequisites

Your system must have Docker installed for these samples to be executed, as each sample will automatically start the Spanner Emulator in a Docker container.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunSampleOnEmulator

func RunSampleOnEmulator(sample func(string, string, string) error, ddlStatements ...string)

RunSampleOnEmulator will run a sample function against a Spanner emulator instance in a Docker container. It requires Docker to be installed your local system to work.

It will execute the following steps: 1. Start a Spanner emulator in a Docker container. 2. Create a sample instance and database on the emulator. 3. Execute the sample function against the emulator. 4. Stop the Docker container with the emulator.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL