truncate

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Overview

Package truncate provides the functionality to truncate all rows from a Cloud Spanner database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, projectID, instanceID, databaseID string, quiet bool, out io.Writer, targetTables, excludeTables []string) error

Run starts a routine to delete all rows from the specified database. If targetTables is not empty, it deletes from the specified tables. Otherwise, it deletes from all tables in the database. If excludeTables is not empty, those tables are excluded from the deleted tables. This function internally creates and uses a Cloud Spanner client.

func RunWithClient added in v0.1.2

func RunWithClient(ctx context.Context, client *spanner.Client, quiet bool, out io.Writer, targetTables, excludeTables []string) error

RunWithClient starts a routine to delete all rows using the given spanner client. If targetTables is not empty, it deletes from the specified tables. Otherwise, it deletes from all tables in the database. If excludeTables is not empty, those tables are excluded from the deleted tables. This function uses an externally passed Cloud Spanner client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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