Ver Fonte

添加调试函数

yjp há 1 ano atrás
pai
commit
b5b693f51c
1 ficheiros alterados com 5 adições e 0 exclusões
  1. 5 0
      sql_parser.go

+ 5 - 0
sql_parser.go

@@ -49,6 +49,11 @@ type selectClause struct {
 	offset     int
 }
 
+// 调试很重要的函数,可以看到一个节点的实际类型以及包含字段的类型
+func printNode(node any) {
+	fmt.Printf("%+#v\n", node)
+}
+
 func parseSql(sqlStr string) ([]any, error) {
 	sqls := strings.Split(sqlStr, ";")