// Creating a Batch Del Request delRequest := &roachpb.DeleteRangeRequest{ Key: roachpb.Key("user:"), EndKey: roachpb.Key("user:~"), } // Batch Del with options batch := db.NewBatch() batch.DelRange(delRequest.Key, delRequest.EndKey) if err := db.Run(batch); err != nil { log.Fatalf("failed to delete rows: %v", err) }
cockroachDBURL := "postgresql://root@localhost:26257/Overall, the package library is a useful tool for developers building applications with CockroachDB and want to use Go as their language of choice.?sslmode=disable" db, err := sql.Open("postgres", cockroachDBURL) if err != nil { log.Fatalf("error creating cockroachdb client: %v", err) }