Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeEscapedSQLIdent(buf *bytes.Buffer, s string)
- func EncodeRestrictedSQLIdent(buf *bytes.Buffer, s string, flags EncodeFlags)
- func EncodeSQLBytes(buf *bytes.Buffer, in string)
- func EncodeSQLBytesInner(buf *bytes.Buffer, in string)
- func EncodeSQLString(buf *bytes.Buffer, in string)
- func EncodeSQLStringWithFlags(buf *bytes.Buffer, in string, flags EncodeFlags)
- func EncodeUnrestrictedSQLIdent(buf *bytes.Buffer, s string, flags EncodeFlags)
- func EscapeSQLString(in string) string
- func GetKeywordID(k string) int32
- func IsBareIdentifier(s string) bool
- func IsDigit(ch int) bool
- func IsHexDigit(ch int) bool
- func IsIdentMiddle(ch int) bool
- func IsIdentStart(ch int) bool
- func NormalizeName(n string) string
- func NormalizeString(s string) string
- type EncodeFlags
Constants ¶
const ABORT = 57363
const ABSOLUTE = 57364
const ACCESS = 57365
const ACTION = 57366
const ADD = 57367
const ADMIN = 57368
const AFTER = 57369
const AGGREGATE = 57370
const ALL = 57371
const ALTER = 57372
const ALWAYS = 57373
const ANALYSE = 57374
const ANALYZE = 57375
const AND = 57376
const AND_AND = 57377
const ANNOTATE_TYPE = 57379
const ANY = 57378
const ARRAY = 57380
const AS = 57381
const ASC = 57382
const ASENSITIVE = 57383
const ASYMMETRIC = 57384
const AS_LA = 57942
const AT = 57385
const ATTRIBUTE = 57386
const AUTHORIZATION = 57387
const AUTOMATIC = 57388
const AVAILABILITY = 57389
const BACKUP = 57390
const BACKUPS = 57391
const BACKWARD = 57392
const BCONST = 57348
const BEFORE = 57393
const BEGIN = 57394
const BETWEEN = 57395
const BIGINT = 57396
const BIGSERIAL = 57397
const BINARY = 57398
const BIT = 57399
const BITCONST = 57349
const BOOLEAN = 57401
const BOTH = 57402
const BOX2D = 57403
const BUCKET_COUNT = 57400
const BUNDLE = 57404
const BY = 57405
const CACHE = 57406
const CANCEL = 57407
const CANCELQUERY = 57408
const CASCADE = 57409
const CASE = 57410
const CAST = 57411
const CBRT = 57412
const CHANGEFEED = 57413
const CHAR = 57414
const CHARACTER = 57415
const CHARACTERISTICS = 57416
const CHECK = 57417
const CLOSE = 57418
const CLUSTER = 57419
const COALESCE = 57420
const COLLATE = 57421
const COLLATION = 57422
const COLUMN = 57423
const COLUMNS = 57424
const COMMENT = 57425
const COMMENTS = 57426
const COMMIT = 57427
const COMMITTED = 57428
const COMPACT = 57429
const COMPLETE = 57430
const COMPLETIONS = 57431
const CONCAT = 57432
const CONCURRENTLY = 57433
const CONFIGURATION = 57434
const CONFIGURATIONS = 57435
const CONFIGURE = 57436
const CONFLICT = 57437
const CONNECTION = 57438
const CONSTRAINT = 57439
const CONSTRAINTS = 57440
const CONTAINED_BY = 57950
const CONTAINS = 57441
const CONTROLCHANGEFEED = 57442
const CONTROLJOB = 57443
const CONVERSION = 57444
const CONVERT = 57445
const COPY = 57446
const COVERING = 57447
const CREATE = 57448
const CREATEDB = 57449
const CREATELOGIN = 57450
const CREATEROLE = 57451
const CROSS = 57452
const CSV = 57453
const CUBE = 57454
const CURRENT = 57455
const CURRENT_CATALOG = 57456
const CURRENT_DATE = 57457
const CURRENT_ROLE = 57459
const CURRENT_SCHEMA = 57458
const CURRENT_TIME = 57460
const CURRENT_TIMESTAMP = 57461
const CURRENT_USER = 57462
const CURSOR = 57463
const CYCLE = 57464
const DATA = 57465
const DATABASE = 57466
const DATABASES = 57467
const DATE = 57468
const DAY = 57469
const DEALLOCATE = 57475
const DEBUG_PAUSE_ON = 57470
const DEC = 57471
const DECIMAL = 57472
const DECLARE = 57476
const DEFAULT = 57473
const DEFAULTS = 57474
const DEFERRABLE = 57477
const DEFERRED = 57478
const DELETE = 57479
const DELIMITER = 57480
const DESC = 57481
const DESTINATION = 57482
const DETACHED = 57483
const DISCARD = 57484
const DISTINCT = 57485
const DO = 57486
const DOMAIN = 57487
const DOT_DOT = 57355
const DOUBLE = 57488
const DROP = 57489
const ELSE = 57490
const ENCODING = 57491
const ENCRYPTED = 57492
const ENCRYPTION_PASSPHRASE = 57493
const END = 57494
const ENUM = 57495
const ENUMS = 57496
const ERROR = 57362
const ESCAPE = 57497
const EXCEPT = 57498
const EXCLUDE = 57499
const EXCLUDING = 57500
const EXECUTE = 57502
const EXECUTION = 57503
const EXISTS = 57501
const EXPERIMENTAL = 57504
const EXPERIMENTAL_AUDIT = 57507
const EXPERIMENTAL_FINGERPRINTS = 57505
const EXPERIMENTAL_RELOCATE = 57508
const EXPERIMENTAL_REPLICA = 57506
const EXPIRATION = 57509
const EXPLAIN = 57510
const EXPORT = 57511
const EXTENSION = 57512
const EXTRACT = 57513
const EXTRACT_DURATION = 57514
const FAILURE = 57515
const FALSE = 57516
const FAMILY = 57517
const FCONST = 57351
const FETCH = 57518
const FETCHTEXT = 57520
const FETCHTEXT_PATH = 57522
const FETCHVAL = 57519
const FETCHVAL_PATH = 57521
const FILES = 57523
const FILTER = 57524
const FIRST = 57525
const FLOAT = 57526
const FLOAT4 = 57527
const FLOAT8 = 57528
const FLOORDIV = 57529
const FOLLOWING = 57530
const FOR = 57531
const FORCE = 57532
const FORCE_INDEX = 57533
const FORCE_ZIGZAG = 57534
const FOREIGN = 57535
const FORWARD = 57536
const FROM = 57537
const FULL = 57538
const FUNCTION = 57539
const FUNCTIONS = 57540
const GENERATED = 57541
const GENERATED_ALWAYS = 57943
const GENERATED_BY_DEFAULT = 57944
const GEOGRAPHY = 57542
const GEOMETRY = 57543
const GEOMETRYCOLLECTION = 57547
const GEOMETRYCOLLECTIONM = 57548
const GEOMETRYCOLLECTIONZ = 57549
const GEOMETRYCOLLECTIONZM = 57550
const GEOMETRYM = 57544
const GEOMETRYZ = 57545
const GEOMETRYZM = 57546
const GLOBAL = 57551
const GOAL = 57552
const GRANT = 57553
const GRANTS = 57554
const GREATER_EQUALS = 57357
const GREATEST = 57555
const GROUP = 57556
const GROUPING = 57557
const GROUPS = 57558
const HASH = 57560
const HAVING = 57559
const HELPTOKEN = 57954
const HIGH = 57561
const HISTOGRAM = 57562
const HOLD = 57563
const HOUR = 57564
const ICONST = 57350
const IDENT = 57346
const IDENTITY = 57565
const IF = 57566
const IFERROR = 57567
const IFNULL = 57568
const IGNORE_FOREIGN_KEYS = 57569
const ILIKE = 57570
const IMMEDIATE = 57571
const IMPORT = 57572
const IN = 57573
const INCLUDE = 57574
const INCLUDING = 57575
const INCREMENT = 57576
const INCREMENTAL = 57577
const INCREMENTAL_LOCATION = 57578
const INDEX = 57582
const INDEXES = 57583
const INET = 57579
const INET_CONTAINED_BY_OR_EQUALS = 57580
const INET_CONTAINS_OR_EQUALS = 57581
const INHERITS = 57584
const INITIALLY = 57586
const INJECT = 57585
const INNER = 57587
const INSENSITIVE = 57588
const INSERT = 57589
const INT = 57590
const INTEGER = 57591
const INTERSECT = 57592
const INTERVAL = 57593
const INTERVAL_SIMPLE = 57952
const INTO = 57594
const INTO_DB = 57595
const INVERTED = 57596
const IS = 57597
const ISERROR = 57598
const ISNULL = 57599
const ISOLATION = 57600
const JOB = 57601
const JOBS = 57602
const JOIN = 57603
const JSON = 57604
const JSONB = 57605
const JSON_ALL_EXISTS = 57607
const JSON_SOME_EXISTS = 57606
const KEY = 57608
const KEYS = 57609
const KMS = 57610
const KV = 57611
const LANGUAGE = 57612
const LAST = 57613
const LATERAL = 57614
const LATEST = 57615
const LC_COLLATE = 57617
const LC_CTYPE = 57616
const LEADING = 57618
const LEASE = 57619
const LEAST = 57620
const LEFT = 57621
const LESS = 57622
const LESS_EQUALS = 57356
const LEVEL = 57623
const LIKE = 57624
const LIMIT = 57625
const LINESTRING = 57626
const LINESTRINGM = 57627
const LINESTRINGZ = 57628
const LINESTRINGZM = 57629
const LIST = 57630
const LOCAL = 57631
const LOCALITY = 57632
const LOCALTIME = 57633
const LOCALTIMESTAMP = 57634
const LOCKED = 57635
const LOGIN = 57636
const LOOKUP = 57637
const LOW = 57638
const LSHIFT = 57639
const MATCH = 57640
const MATERIALIZED = 57641
const MAXVALUE = 57644
const MERGE = 57642
const METHOD = 57645
const MINUTE = 57646
const MINVALUE = 57643
const MODIFYCLUSTERSETTING = 57647
const MONTH = 57648
const MOVE = 57649
const MULTILINESTRING = 57650
const MULTILINESTRINGM = 57651
const MULTILINESTRINGZ = 57652
const MULTILINESTRINGZM = 57653
const MULTIPOINT = 57654
const MULTIPOINTM = 57655
const MULTIPOINTZ = 57656
const MULTIPOINTZM = 57657
const MULTIPOLYGON = 57658
const MULTIPOLYGONM = 57659
const MULTIPOLYGONZ = 57660
const MULTIPOLYGONZM = 57661
const NAME = 57663
const NAMES = 57664
const NAN = 57662
const NATURAL = 57665
const NEVER = 57666
const NEW_DB_NAME = 57667
const NEW_KMS = 57668
const NEXT = 57669
const NO = 57670
const NOCANCELQUERY = 57671
const NOCONTROLCHANGEFEED = 57672
const NOCONTROLJOB = 57673
const NOCREATEDB = 57674
const NOCREATELOGIN = 57675
const NOCREATEROLE = 57676
const NOLOGIN = 57677
const NOMODIFYCLUSTERSETTING = 57678
const NONE = 57683
const NONVOTERS = 57684
const NORMAL = 57685
const NOSQLLOGIN = 57679
const NOT = 57686
const NOTHING = 57687
const NOTNULL = 57688
const NOT_EQUALS = 57358
const NOT_LA = 57939
const NOT_REGIMATCH = 57361
const NOT_REGMATCH = 57359
const NOVIEWACTIVITY = 57689
const NOVIEWACTIVITYREDACTED = 57690
const NOVIEWCLUSTERSETTING = 57691
const NOWAIT = 57692
const NO_FULL_SCAN = 57682
const NO_INDEX_JOIN = 57680
const NO_ZIGZAG_JOIN = 57681
const NULL = 57693
const NULLIF = 57694
const NULLS = 57695
const NULLS_LA = 57940
const NUMERIC = 57696
const OF = 57697
const OFF = 57698
const OFFSET = 57699
const OID = 57700
const OIDS = 57701
const OIDVECTOR = 57702
const OLD_KMS = 57703
const ON = 57704
const ONLY = 57705
const ON_LA = 57948
const OPERATOR = 57720
const OPT = 57706
const OPTION = 57707
const OPTIONS = 57708
const OR = 57709
const ORDER = 57710
const ORDINALITY = 57711
const OTHERS = 57712
const OUT = 57713
const OUTER = 57714
const OVER = 57715
const OVERLAPS = 57716
const OVERLAY = 57717
const OWNED = 57718
const OWNER = 57719
const PARENT = 57721
const PARTIAL = 57722
const PARTITION = 57723
const PARTITIONS = 57724
const PASSWORD = 57725
const PAUSE = 57726
const PAUSED = 57727
const PHYSICAL = 57728
const PLACEHOLDER = 57352
const PLACEMENT = 57729
const PLACING = 57730
const PLAN = 57731
const PLANS = 57732
const POINT = 57733
const POINTM = 57734
const POINTZ = 57735
const POINTZM = 57736
const POLYGON = 57737
const POLYGONM = 57738
const POLYGONZ = 57739
const POLYGONZM = 57740
const POSITION = 57741
const POSTFIXOP = 57951
const PRECEDING = 57742
const PRECISION = 57743
const PREPARE = 57744
const PRESERVE = 57745
const PRIMARY = 57746
const PRIOR = 57747
const PRIORITY = 57748
const PRIVILEGES = 57749
const PROCEDURAL = 57750
const PUBLIC = 57751
const PUBLICATION = 57752
const QUERIES = 57753
const QUERY = 57754
const RANGE = 57755
const RANGES = 57756
const READ = 57757
const REAL = 57758
const REASON = 57759
const REASSIGN = 57760
const RECURRING = 57762
const RECURSIVE = 57761
const REF = 57763
const REFERENCES = 57764
const REFRESH = 57765
const REGCLASS = 57766
const REGIMATCH = 57360
const REGION = 57767
const REGIONAL = 57768
const REGIONS = 57769
const REGNAMESPACE = 57770
const REGPROC = 57771
const REGPROCEDURE = 57772
const REGROLE = 57773
const REGTYPE = 57774
const REINDEX = 57775
const RELATIVE = 57776
const RELEASE = 57783
const RELOCATE = 57777
const REMOVE_PATH = 57778
const RENAME = 57779
const REPEATABLE = 57780
const REPLACE = 57781
const REPLICATION = 57782
const RESET = 57784
const RESET_ALL = 57945
const RESTORE = 57785
const RESTRICT = 57786
const RESTRICTED = 57787
const RESUME = 57788
const RETRY = 57790
const RETURNING = 57789
const REVISION_HISTORY = 57791
const REVOKE = 57792
const RIGHT = 57793
const ROLE = 57794
const ROLES = 57795
const ROLE_ALL = 57946
const ROLLBACK = 57796
const ROLLUP = 57797
const ROUTINES = 57798
const ROW = 57799
const ROWS = 57800
const RSHIFT = 57801
const RULE = 57802
const RUNNING = 57803
const SAVEPOINT = 57804
const SCANS = 57805
const SCATTER = 57806
const SCHEDULE = 57807
const SCHEDULES = 57808
const SCHEMA = 57810
const SCHEMAS = 57811
const SCONST = 57347
const SCROLL = 57809
const SCRUB = 57812
const SEARCH = 57813
const SECOND = 57814
const SELECT = 57815
const SEQUENCE = 57816
const SEQUENCES = 57817
const SERIALIZABLE = 57818
const SERVER = 57819
const SESSION = 57820
const SESSIONS = 57821
const SESSION_USER = 57822
const SET = 57823
const SETS = 57824
const SETTING = 57825
const SETTINGS = 57826
const SHARE = 57827
const SHOW = 57828
const SIMILAR = 57829
const SIMPLE = 57830
const SKIP = 57831
const SKIP_LOCALITIES_CHECK = 57832
const SKIP_MISSING_FOREIGN_KEYS = 57833
const SKIP_MISSING_SEQUENCES = 57834
const SKIP_MISSING_SEQUENCE_OWNERS = 57835
const SKIP_MISSING_VIEWS = 57836
const SMALLINT = 57837
const SMALLSERIAL = 57838
const SNAPSHOT = 57839
const SOME = 57840
const SPLIT = 57841
const SQL = 57842
const SQLLOGIN = 57843
const SQRT = 57863
const START = 57844
const STATE = 57845
const STATEMENTS = 57865
const STATISTICS = 57846
const STATUS = 57847
const STDIN = 57848
const STORAGE = 57852
const STORE = 57853
const STORED = 57854
const STORING = 57855
const STREAM = 57849
const STRICT = 57850
const STRING = 57851
const SUBSCRIPTION = 57864
const SUBSTRING = 57856
const SUPER = 57857
const SURVIVAL = 57859
const SURVIVE = 57858
const SYMMETRIC = 57860
const SYNTAX = 57861
const SYSTEM = 57862
const TABLE = 57866
const TABLES = 57867
const TABLESPACE = 57868
const TEMP = 57869
const TEMPLATE = 57870
const TEMPORARY = 57871
const TENANT = 57872
const TENANTS = 57873
const TENANT_ALL = 57949
const TESTING_RELOCATE = 57874
const TEXT = 57875
const THEN = 57876
const THROTTLING = 57883
const TIES = 57877
const TIME = 57878
const TIMESTAMP = 57880
const TIMESTAMPTZ = 57881
const TIMETZ = 57879
const TO = 57882
const TRACE = 57885
const TRACING = 57897
const TRAILING = 57884
const TRANSACTION = 57886
const TRANSACTIONS = 57887
const TRANSFER = 57888
const TREAT = 57889
const TRIGGER = 57890
const TRIM = 57891
const TRUE = 57892
const TRUNCATE = 57893
const TRUSTED = 57894
const TYPE = 57895
const TYPEANNOTATE = 57354
const TYPECAST = 57353
const TYPES = 57896
const UMINUS = 57953
const UNBOUNDED = 57898
const UNCOMMITTED = 57899
const UNION = 57900
const UNIQUE = 57901
const UNKNOWN = 57902
const UNLOGGED = 57903
const UNSET = 57907
const UNSPLIT = 57904
const UNTIL = 57908
const UPDATE = 57905
const UPSERT = 57906
const USE = 57909
const USER = 57910
const USERS = 57911
const USER_ALL = 57947
const USING = 57912
const UUID = 57913
const VALID = 57914
const VALIDATE = 57915
const VALUE = 57916
const VALUES = 57917
const VARBIT = 57918
const VARCHAR = 57919
const VARIADIC = 57920
const VARYING = 57922
const VIEW = 57921
const VIEWACTIVITY = 57923
const VIEWACTIVITYREDACTED = 57924
const VIEWCLUSTERSETTING = 57925
const VIRTUAL = 57926
const VISIBLE = 57927
const VOTERS = 57928
const WHEN = 57929
const WHERE = 57930
const WINDOW = 57931
const WITH = 57932
const WITHIN = 57933
const WITHOUT = 57934
const WITH_LA = 57941
const WORK = 57935
const WRITE = 57936
const YEAR = 57937
const ZONE = 57938
Variables ¶
var AllowedExperimental = map[string]struct{}{
"ranges": {},
}
AllowedExperimental contains keywords for which the EXPERIMENTAL_ or TESTING_ prefixes are allowed to be parsed along with the keyword to the same token. This ambiguity exists during the deprecation period of an EXPERIMENTAL_ keyword as it is being transitioned to the normal version. Once the transition is done, the keyword should be removed from here as well.
var KeywordNames = []string{}/* 539 elements not displayed */
KeywordNames contains all keywords sorted, so that pg_get_keywords returns deterministic results.
var KeywordsCategories = map[string]string{}/* 539 elements not displayed */
Functions ¶
func EncodeEscapedSQLIdent ¶
EncodeEscapedSQLIdent writes the identifier in s to buf. The identifier is always quoted. Double quotes inside the identifier are escaped.
func EncodeRestrictedSQLIdent ¶
func EncodeRestrictedSQLIdent(buf *bytes.Buffer, s string, flags EncodeFlags)
EncodeRestrictedSQLIdent writes the identifier in s to buf. The identifier is quoted if either the flags ask for it, the identifier contains special characters, or the identifier is a reserved SQL keyword.
func EncodeSQLBytes ¶
EncodeSQLBytes encodes the SQL byte array in 'in' to buf, to a format suitable for re-scanning. We don't use a straightforward hex encoding here with x'...' because the result would be less compact. We are trading a little more time during the encoding to have a little less bytes on the wire.
func EncodeSQLBytesInner ¶
EncodeSQLBytesInner is like EncodeSQLBytes but does not include the outer quote delimiter and the 'b' prefix.
func EncodeSQLString ¶
EncodeSQLString writes a string literal to buf. All unicode and non-printable characters are escaped.
func EncodeSQLStringWithFlags ¶
func EncodeSQLStringWithFlags(buf *bytes.Buffer, in string, flags EncodeFlags)
EncodeSQLStringWithFlags writes a string literal to buf. All unicode and non-printable characters are escaped. flags controls the output format: if encodeBareString is set, the output string will not be wrapped in quotes if the strings contains no special characters.
func EncodeUnrestrictedSQLIdent ¶
func EncodeUnrestrictedSQLIdent(buf *bytes.Buffer, s string, flags EncodeFlags)
EncodeUnrestrictedSQLIdent writes the identifier in s to buf. The identifier is only quoted if the flags don't tell otherwise and the identifier contains special characters.
func EscapeSQLString ¶
EscapeSQLString returns an escaped SQL representation of the given string. This is suitable for safely producing a SQL string valid for input to the parser.
func GetKeywordID ¶
GetKeywordID returns the lex id of the SQL keyword k or IDENT if k is not a keyword.
func IsBareIdentifier ¶
IsBareIdentifier returns true if the input string is a permissible bare SQL identifier.
func IsHexDigit ¶
IsHexDigit returns true if the character is a valid hexadecimal digit.
func IsIdentMiddle ¶
IsIdentMiddle returns true if the character is valid inside an identifier.
func IsIdentStart ¶
IsIdentStart returns true if the character is valid at the start of an identifier.
func NormalizeName ¶
NormalizeName normalizes to lowercase and Unicode Normalization Form C (NFC).
func NormalizeString ¶
NormalizeString normalizes to Unicode Normalization Form C (NFC). This function is specifically for double quoted identifiers.
Types ¶
type EncodeFlags ¶
type EncodeFlags int
EncodeFlags influence the formatting of strings and identifiers.
const ( // EncNoFlags indicates nothing special should happen while encoding. EncNoFlags EncodeFlags = 0 // EncBareStrings indicates that strings will be rendered without // wrapping quotes if they contain no special characters. EncBareStrings EncodeFlags = 1 << iota // EncBareIdentifiers indicates that identifiers will be rendered // without wrapping quotes. EncBareIdentifiers // EncFirstFreeFlagBit needs to remain unused; it is used as base // bit offset for tree.FmtFlags. EncFirstFreeFlagBit )
func (EncodeFlags) HasFlags ¶
func (f EncodeFlags) HasFlags(subset EncodeFlags) bool
HasFlags tests whether the given flags are set.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
all-keywords generates sql/lexbase/keywords.go from sql.y.
|
all-keywords generates sql/lexbase/keywords.go from sql.y. |