MCPcopy Index your code
hub / github.com/cloudspannerecosystem/spanner-cli / TestShowCreateTable

Function TestShowCreateTable

integration_test.go:588–617  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

586}
587
588func TestShowCreateTable(t *testing.T) {
589 if skipIntegrateTest {
590 t.Skip("Integration tests skipped")
591 }
592
593 ctx, cancel := context.WithTimeout(context.Background(), 180*time.Second)
594 defer cancel()
595
596 session, tableId, tearDown := setup(t, ctx, []string{})
597 defer tearDown()
598
599 stmt, err := BuildStatement(fmt.Sprintf("SHOW CREATE TABLE %s", tableId))
600 if err != nil {
601 t.Fatalf("invalid statement: error=%s", err)
602 }
603
604 result, err := stmt.Execute(ctx, session)
605 if err != nil {
606 t.Fatalf("unexpected error happened: %s", err)
607 }
608
609 compareResult(t, result, &Result{
610 ColumnNames: []string{"Table", "Create Table"},
611 Rows: []Row{
612 Row{[]string{tableId, fmt.Sprintf("CREATE TABLE %s (\n id INT64 NOT NULL,\n active BOOL NOT NULL,\n) PRIMARY KEY(id)", tableId)}},
613 },
614 AffectedRows: 1,
615 IsMutation: false,
616 })
617}
618
619func TestShowColumns(t *testing.T) {
620 if skipIntegrateTest {

Callers

nothing calls this directly

Calls 4

setupFunction · 0.85
BuildStatementFunction · 0.85
compareResultFunction · 0.85
ExecuteMethod · 0.65

Tested by

no test coverage detected