(sql string)
| 181 | } |
| 182 | |
| 183 | func getTableName(sql string) string { |
| 184 | s := strings.ToLower(sql) |
| 185 | |
| 186 | fromIndex := strings.Index(s, "from") |
| 187 | if fromIndex == -1 { |
| 188 | return "" |
| 189 | } |
| 190 | behindSQL := strings.Trim(s[fromIndex+4:], " \t") |
| 191 | spaceIndex := strings.Index(behindSQL, " ") |
| 192 | if spaceIndex == -1 { |
| 193 | return behindSQL |
| 194 | } |
| 195 | return behindSQL[:spaceIndex] |
| 196 | } |
| 197 | |
| 198 | func getColumnTypeAndLen(columnType string) (byte, uint32) { |
| 199 | index := strings.Index(columnType, "(") |
no outgoing calls