Browse Source

添加调试函数

yjp 1 year ago
parent
commit
b5b693f51c
1 changed files with 5 additions and 0 deletions
  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, ";")