fix: sql or protobuf name cannot use the suffix _test

This commit is contained in:
zhuyasen
2024-03-23 19:53:51 +08:00
parent 6e44dfbf43
commit d01e88e876
12 changed files with 274 additions and 18 deletions

View File

@@ -203,6 +203,7 @@ func TestGetPostgresqlTableInfo(t *testing.T) {
t.Log(err)
return
}
printPGFields(fields)
sql, fieldTypes := ConvertToSQLByPgFields("user_example", fields)
t.Log(sql, fieldTypes)
}
@@ -259,6 +260,13 @@ func printCode(code map[string]string) {
}
}
func printPGFields(fields []*PGField) {
fmt.Printf("%-20v %-20v %-20v %-20v %-20v %-20v\n", "Name", "Type", "Length", "Lengthvar", "Notnull", "Comment")
for _, p := range fields {
fmt.Printf("%-20v %-20v %-20v %-20v %-20v %-20v\n", p.Name, p.Type, p.Length, p.Lengthvar, p.Notnull, p.Comment)
}
}
func Test_getMongodbTableFields(t *testing.T) {
fields := []*MgoField{
{