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.