advsql/check_table_integrity_test.go

35 lines
608 B
Go
Raw Normal View History

package advsql
import (
"log"
"testing"
_ "github.com/go-sql-driver/mysql"
)
func TestCheckTableIntegrity(t *testing.T) {
store, err := NewStoreMySQL("localhost", 3306, "kaikei", "u399D-TFulJykgRF4ijW6G7tK6zdO-jy", "kaikei")
if err != nil {
t.Fatal("could not make store", err)
}
type Person struct {
Surname string
Lastname string
Age int
}
p := &Person{
Surname: "Timon",
Lastname: "Ringwald",
Age: 25,
}
integrity, err := store.checkTableIntegrity(p)
if err != nil {
t.Fatal("could not check table integrity", err)
}
log.Println("integrity:", integrity)
}