增加返回值
This commit is contained in:
parent
f8e2ab7f5b
commit
d49f21dd30
@ -26,15 +26,14 @@ const (
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 4:49 下午 2021/10/25
|
||||
func ParseCreateTableSql(sql string) {
|
||||
func ParseCreateTableSql(sql string) (string, error) {
|
||||
var (
|
||||
stmt sqlparser.Statement
|
||||
err error
|
||||
)
|
||||
sql = strings.ReplaceAll(sql, " ", "")
|
||||
if stmt, err = sqlparser.ParseStrictDDL(sql); nil != err {
|
||||
fmt.Println(err.Error(), string(sql[786:]))
|
||||
return
|
||||
return "", err
|
||||
}
|
||||
|
||||
r := stmt.(*sqlparser.DDL)
|
||||
@ -59,5 +58,5 @@ func ParseCreateTableSql(sql string) {
|
||||
}
|
||||
fmt.Println(val)
|
||||
}
|
||||
// fmt.Println(r.TableSpec)
|
||||
return "", nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user