IsDDL returns true if the given sql string is a DDL statement.
(query string)
| 206 | |
| 207 | // IsDDL returns true if the given sql string is a DDL statement. |
| 208 | func IsDDL(query string) bool { |
| 209 | for ddl := range ddlStatements { |
| 210 | if len(query) >= len(ddl) && strings.EqualFold(query[:len(ddl)], ddl) { |
| 211 | return true |
| 212 | } |
| 213 | } |
| 214 | return false |
| 215 | } |
| 216 | |
| 217 | // IsSelect returns true if the given sql string is a SELECT statement. |
| 218 | func IsSelect(query string) bool { |