MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / GetKeywordID

Function GetKeywordID

pkg/sql/lex/keywords.go:845–1684  ·  view source on GitHub ↗

GetKeywordID returns the lex id of the SQL keyword k or IDENT if k is not a keyword.

(k string)

Source from the content-addressed store, hash-verified

843// GetKeywordID returns the lex id of the SQL keyword k or IDENT if k is
844// not a keyword.
845func GetKeywordID(k string) int32 {
846 // The previous implementation generated a map that did a string ->
847 // id lookup. Various ideas were benchmarked and the implementation below
848 // was the fastest of those, between 3% and 10% faster (at parsing, so the
849 // scanning speedup is even more) than the map implementation.
850 switch k {
851 case "abort":
852 return ABORT
853 case "action":
854 return ACTION
855 case "add":
856 return ADD
857 case "admin":
858 return ADMIN
859 case "aggregate":
860 return AGGREGATE
861 case "all":
862 return ALL
863 case "alter":
864 return ALTER
865 case "analyse":
866 return ANALYSE
867 case "analyze":
868 return ANALYZE
869 case "and":
870 return AND
871 case "annotate_type":
872 return ANNOTATE_TYPE
873 case "any":
874 return ANY
875 case "array":
876 return ARRAY
877 case "as":
878 return AS
879 case "asc":
880 return ASC
881 case "asymmetric":
882 return ASYMMETRIC
883 case "at":
884 return AT
885 case "authorization":
886 return AUTHORIZATION
887 case "automatic":
888 return AUTOMATIC
889 case "backup":
890 return BACKUP
891 case "begin":
892 return BEGIN
893 case "between":
894 return BETWEEN
895 case "bigint":
896 return BIGINT
897 case "bigserial":
898 return BIGSERIAL
899 case "bit":
900 return BIT
901 case "blob":
902 return BLOB

Callers 1

scanIdentMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…