isObjectIdentifierCandidate reports whether a candidate type names a schema object referenced as an identifier in SQL (and so must be backtick-quoted when it is a reserved word or a non-bare name). Keywords, builtin functions, and value-like candidates (charset/engine/variable/type) are excluded.
(t base.CandidateType)
| 332 | // when it is a reserved word or a non-bare name). Keywords, builtin functions, |
| 333 | // and value-like candidates (charset/engine/variable/type) are excluded. |
| 334 | func isObjectIdentifierCandidate(t base.CandidateType) bool { |
| 335 | switch t { |
| 336 | case base.CandidateTypeDatabase, |
| 337 | base.CandidateTypeTable, |
| 338 | base.CandidateTypeView, |
| 339 | base.CandidateTypeColumn, |
| 340 | base.CandidateTypeIndex, |
| 341 | base.CandidateTypeTrigger, |
| 342 | base.CandidateTypeEvent, |
| 343 | base.CandidateTypeRoutine: |
| 344 | return true |
| 345 | default: |
| 346 | return false |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | // quoteIdentifierIfNeeded backtick-quotes an object identifier when it would |
| 351 | // otherwise be invalid as a bare identifier, so that accepting the completion |