MCPcopy Create free account
hub / github.com/cloudspannerecosystem/spanner-cli / TestShowColumns

Function TestShowColumns

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

Source from the content-addressed store, hash-verified

617}
618
619func TestShowColumns(t *testing.T) {
620 if skipIntegrateTest {
621 t.Skip("Integration tests skipped")
622 }
623
624 ctx, cancel := context.WithTimeout(context.Background(), 180*time.Second)
625 defer cancel()
626
627 session, tableId, tearDown := setup(t, ctx, []string{})
628 defer tearDown()
629
630 stmt, err := BuildStatement(fmt.Sprintf("SHOW COLUMNS FROM %s", tableId))
631 if err != nil {
632 t.Fatalf("invalid statement: error=%s", err)
633 }
634
635 result, err := stmt.Execute(ctx, session)
636 if err != nil {
637 t.Fatalf("unexpected error happened: %s", err)
638 }
639
640 compareResult(t, result, &Result{
641 ColumnNames: []string{"Field", "Type", "NULL", "Key", "Key_Order", "Options"},
642 Rows: []Row{
643 Row{[]string{"id", "INT64", "NO", "PRIMARY_KEY", "ASC", "NULL"}},
644 Row{[]string{"active", "BOOL", "NO", "NULL", "NULL", "NULL"}},
645 },
646 AffectedRows: 2,
647 IsMutation: false,
648 })
649}
650
651func TestShowIndexes(t *testing.T) {
652 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