(databaseName string, node oracleast.StmtNode, fullSQL string)
| 227 | } |
| 228 | |
| 229 | func extractOmniDML(databaseName string, node oracleast.StmtNode, fullSQL string) *statementInfo { |
| 230 | switch n := node.(type) { |
| 231 | case *oracleast.DeleteStmt: |
| 232 | table := omniDMLTableReference(databaseName, n.Table, n.Alias, StatementTypeDelete) |
| 233 | if table == nil { |
| 234 | return nil |
| 235 | } |
| 236 | return &statementInfo{ |
| 237 | statement: extractOmniStatementText(fullSQL, n.Loc), |
| 238 | node: n, |
| 239 | table: table, |
| 240 | } |
| 241 | case *oracleast.UpdateStmt: |
| 242 | table := omniDMLTableReference(databaseName, n.Table, n.Alias, StatementTypeUpdate) |
| 243 | if table == nil { |
| 244 | return nil |
| 245 | } |
| 246 | return &statementInfo{ |
| 247 | statement: extractOmniStatementText(fullSQL, n.Loc), |
| 248 | node: n, |
| 249 | table: table, |
| 250 | } |
| 251 | default: |
| 252 | return nil |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | func omniDMLTableReference(databaseName string, name *oracleast.ObjectName, alias *oracleast.Alias, statementType StatementType) *TableReference { |
| 257 | if name == nil || name.Name == "" { |
no test coverage detected