(ctx context.Context, engine storepb.Engine, statement string)
| 2239 | } |
| 2240 | |
| 2241 | func requiresAdminDataSource(ctx context.Context, engine storepb.Engine, statement string) bool { |
| 2242 | readOnly, _, err := parserbase.ValidateSQLForEditor(engine, statement) |
| 2243 | if err != nil { |
| 2244 | return false |
| 2245 | } |
| 2246 | if !readOnly { |
| 2247 | return true |
| 2248 | } |
| 2249 | |
| 2250 | if !shouldClassifyStatementByQuerySpan(engine) { |
| 2251 | return false |
| 2252 | } |
| 2253 | spans, err := getQuerySpansForStatement(ctx, engine, statement) |
| 2254 | if err != nil { |
| 2255 | return false |
| 2256 | } |
| 2257 | for _, span := range spans { |
| 2258 | if span == nil { |
| 2259 | continue |
| 2260 | } |
| 2261 | if span.Type == parserbase.DDL || span.Type == parserbase.DML { |
| 2262 | return true |
| 2263 | } |
| 2264 | } |
| 2265 | return false |
| 2266 | } |
| 2267 | |
| 2268 | func checkAndGetDataSourceQueriable( |
| 2269 | ctx context.Context, |
no test coverage detected