diff --git a/driver/mysql/sql.go b/driver/mysql/sql.go index 9228880..afcc24f 100644 --- a/driver/mysql/sql.go +++ b/driver/mysql/sql.go @@ -18,12 +18,12 @@ import ( var _ driver.Driver = (*SQL)(nil) type SQL struct { - CreateTableSQL string + SQL string } // InspectSchema implements driver.Driver. func (self *SQL) InspectSchema(context.Context, *schema.InspectOptions) (ens.Schemaer, error) { - statement, err := sqlparser.Parse(self.CreateTableSQL) + statement, err := sqlparser.Parse(self.SQL) if err != nil { return nil, err } diff --git a/driver/mysql/sql_test.go b/driver/mysql/sql_test.go index 0776a98..a2064c5 100644 --- a/driver/mysql/sql_test.go +++ b/driver/mysql/sql_test.go @@ -54,7 +54,7 @@ func Test_SQL_Parse(t *testing.T) { ")ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='公告-面向所有人的消息';" d := &SQL{ - CreateTableSQL: sql, + SQL: sql, } value, err := d.InspectSchema(context.Background(), nil) if err != nil {