rawsql-ts 0.1.0-beta.5 → 0.1.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/dist/index.d.ts +13 -0
  2. package/dist/models/BinarySelectQuery.d.ts +91 -0
  3. package/dist/models/Clause.d.ts +189 -0
  4. package/dist/models/KeywordTrie.d.ts +11 -0
  5. package/dist/models/Lexeme.d.ts +25 -0
  6. package/dist/models/SelectQuery.d.ts +5 -0
  7. package/dist/models/SimpleSelectQuery.d.ts +167 -0
  8. package/dist/models/SqlComponent.d.ts +18 -0
  9. package/dist/models/ValueComponent.d.ts +158 -0
  10. package/dist/models/ValuesQuery.d.ts +10 -0
  11. package/dist/parsers/CommandExpressionParser.d.ts +15 -0
  12. package/dist/parsers/CommonTableParser.d.ts +9 -0
  13. package/dist/parsers/ForClauseParser.d.ts +9 -0
  14. package/dist/parsers/FromClauseParser.d.ts +9 -0
  15. package/dist/parsers/FunctionExpressionParser.d.ts +22 -0
  16. package/dist/parsers/GroupByParser.d.ts +10 -0
  17. package/dist/parsers/HavingParser.d.ts +9 -0
  18. package/dist/parsers/IdentifierParser.d.ts +8 -0
  19. package/dist/parsers/JoinClauseParser.d.ts +14 -0
  20. package/dist/parsers/KeywordParser.d.ts +17 -0
  21. package/dist/parsers/LimitClauseParser.d.ts +9 -0
  22. package/dist/parsers/LiteralParser.d.ts +8 -0
  23. package/dist/parsers/OrderByClauseParser.d.ts +10 -0
  24. package/dist/parsers/OverExpressionParser.d.ts +9 -0
  25. package/dist/parsers/ParameterExpressionParser.d.ts +8 -0
  26. package/dist/parsers/ParenExpressionParser.d.ts +8 -0
  27. package/dist/parsers/PartitionByParser.d.ts +9 -0
  28. package/dist/parsers/SelectClauseParser.d.ts +10 -0
  29. package/dist/parsers/SelectQueryParser.d.ts +13 -0
  30. package/dist/parsers/SourceAliasExpressionParser.d.ts +8 -0
  31. package/dist/parsers/SourceExpressionParser.d.ts +8 -0
  32. package/dist/parsers/SourceParser.d.ts +13 -0
  33. package/dist/parsers/SqlTokenizer.d.ts +64 -0
  34. package/dist/parsers/StringSpecifierExpressionParser.d.ts +8 -0
  35. package/dist/parsers/UnaryExpressionParser.d.ts +8 -0
  36. package/dist/parsers/ValueParser.d.ts +14 -0
  37. package/dist/parsers/ValuesQueryParser.d.ts +10 -0
  38. package/dist/parsers/WhereClauseParser.d.ts +9 -0
  39. package/dist/parsers/WindowClauseParser.d.ts +9 -0
  40. package/dist/parsers/WindowExpressionParser.d.ts +12 -0
  41. package/dist/parsers/WithClauseParser.d.ts +9 -0
  42. package/dist/tokenReaders/BaseTokenReader.d.ts +43 -0
  43. package/dist/tokenReaders/CommandTokenReader.d.ts +7 -0
  44. package/dist/tokenReaders/FunctionTokenReader.d.ts +11 -0
  45. package/dist/tokenReaders/IdentifierTokenReader.d.ts +15 -0
  46. package/dist/tokenReaders/LiteralTokenReader.d.ts +23 -0
  47. package/dist/tokenReaders/OperatorTokenReader.d.ts +5 -0
  48. package/dist/tokenReaders/ParameterTokenReader.d.ts +11 -0
  49. package/dist/tokenReaders/StringSpecifierTokenReader.d.ts +8 -0
  50. package/dist/tokenReaders/SymbolTokenReader.d.ts +12 -0
  51. package/dist/tokenReaders/TokenReaderManager.d.ts +53 -0
  52. package/dist/tokenReaders/TypeTokenReader.d.ts +11 -0
  53. package/dist/transformers/CTEBuilder.d.ts +52 -0
  54. package/dist/transformers/CTECollector.d.ts +81 -0
  55. package/dist/transformers/CTEDisabler.d.ts +77 -0
  56. package/dist/transformers/CTEInjector.d.ts +40 -0
  57. package/dist/transformers/CTENormalizer.d.ts +25 -0
  58. package/dist/transformers/Formatter.d.ts +67 -0
  59. package/dist/transformers/QueryNormalizer.d.ts +37 -0
  60. package/dist/transformers/SelectValueCollector.d.ts +62 -0
  61. package/dist/transformers/SelectableColumnCollector.d.ts +70 -0
  62. package/dist/transformers/TableSourceCollector.d.ts +92 -0
  63. package/dist/transformers/UpstreamSelectQueryFinder.d.ts +27 -0
  64. package/dist/utils/charLookupTable.d.ts +11 -0
  65. package/dist/utils/stringUtils.d.ts +43 -0
  66. package/package.json +7 -3
  67. package/src/index.d.ts +378 -0
  68. package/.vs/CopilotSnapshots/02E79E48DFF5234787CB618DE990598A/48814CCF3E4E4B44A66AB8BC7D6CF6B6/904140CF7EDF0C98AEA45F0D36062FE1 +0 -1
  69. package/.vs/CopilotSnapshots/02E79E48DFF5234787CB618DE990598A/48814CCF3E4E4B44A66AB8BC7D6CF6B6/A32D1DB906C73FA74EF270AAEE165FC0 +0 -86
  70. package/.vs/CopilotSnapshots/02E79E48DFF5234787CB618DE990598A/48814CCF3E4E4B44A66AB8BC7D6CF6B6/E621434FB1D5415B14FBBCC11967E420 +0 -34
  71. package/.vs/CopilotSnapshots/02E79E48DFF5234787CB618DE990598A/48814CCF3E4E4B44A66AB8BC7D6CF6B6/EF71788BE39818EEA3F0164DC15E1BD7 +0 -170
  72. package/.vs/CopilotSnapshots/02E79E48DFF5234787CB618DE990598A/state.mpack +0 -1
  73. package/.vs/CopilotSnapshots/07B1013C385C5641A5F5100E0751210B/0C73C015B2C859419AFBD08BE1343FC0/BA5D2B145A59265D63FA3B3584344B02 +0 -236
  74. package/.vs/CopilotSnapshots/07B1013C385C5641A5F5100E0751210B/state.mpack +0 -1
  75. package/.vs/CopilotSnapshots/0D03762A9EA0CB4885F2114567F23F93/A9AF50781E77B849AA3262D2738D9338/1F95FD72006ED6E92629CEFD7B2C4FEC +0 -1
  76. package/.vs/CopilotSnapshots/0D03762A9EA0CB4885F2114567F23F93/A9AF50781E77B849AA3262D2738D9338/4CA7B9D3BC2D0A498DC0777EDA3F9B0F +0 -1
  77. package/.vs/CopilotSnapshots/0D03762A9EA0CB4885F2114567F23F93/A9AF50781E77B849AA3262D2738D9338/7B623BFBAEB4EB61A9585F0BC8039B06 +0 -19
  78. package/.vs/CopilotSnapshots/0D03762A9EA0CB4885F2114567F23F93/CA94452964F7A94B8ECE3B54EE21B50F/1F95FD72006ED6E92629CEFD7B2C4FEC +0 -5
  79. package/.vs/CopilotSnapshots/0D03762A9EA0CB4885F2114567F23F93/CA94452964F7A94B8ECE3B54EE21B50F/4CA7B9D3BC2D0A498DC0777EDA3F9B0F +0 -3
  80. package/.vs/CopilotSnapshots/0D03762A9EA0CB4885F2114567F23F93/CA94452964F7A94B8ECE3B54EE21B50F/7B623BFBAEB4EB61A9585F0BC8039B06 +0 -21
  81. package/.vs/CopilotSnapshots/0D03762A9EA0CB4885F2114567F23F93/state.mpack +0 -1
  82. package/.vs/CopilotSnapshots/10B71DC3C4C1C04E8602FA06D3925F98/23B181EB1228EF40ABCEF51E89FBF6E6/41035D2B1D57326B55F66372017E223A +0 -1
  83. package/.vs/CopilotSnapshots/10B71DC3C4C1C04E8602FA06D3925F98/23B181EB1228EF40ABCEF51E89FBF6E6/45EABF6EF6BDFAA58C941A29E98C9C83 +0 -113
  84. package/.vs/CopilotSnapshots/10B71DC3C4C1C04E8602FA06D3925F98/23B181EB1228EF40ABCEF51E89FBF6E6/748E0B8859CA1A5FDCA675C9E53B6D1C +0 -1
  85. package/.vs/CopilotSnapshots/10B71DC3C4C1C04E8602FA06D3925F98/23B181EB1228EF40ABCEF51E89FBF6E6/A250FF4AD59546A65FFDC6AA92A4698E +0 -1
  86. package/.vs/CopilotSnapshots/10B71DC3C4C1C04E8602FA06D3925F98/23B181EB1228EF40ABCEF51E89FBF6E6/C42432BC73D8AA122171FAB6EEB13CBC +0 -19
  87. package/.vs/CopilotSnapshots/10B71DC3C4C1C04E8602FA06D3925F98/state.mpack +0 -1
  88. package/.vs/CopilotSnapshots/13B40109875D434BB24880356492BE7E/828B96E81CC7014B887AA519767FACC3/437DAEC1EBBAF4F25ABA1B6A25EB6933 +0 -25
  89. package/.vs/CopilotSnapshots/13B40109875D434BB24880356492BE7E/state.mpack +0 -1
  90. package/.vs/CopilotSnapshots/245168908540D646ACBD4FDE8D6DD2D4/1CDE8BAB21868E4D893E119554BA87E5/904140CF7EDF0C98AEA45F0D36062FE1 +0 -63
  91. package/.vs/CopilotSnapshots/245168908540D646ACBD4FDE8D6DD2D4/1CDE8BAB21868E4D893E119554BA87E5/DFF70C60F68ECD9A4E4C3C74E4CC4DEE +0 -1
  92. package/.vs/CopilotSnapshots/245168908540D646ACBD4FDE8D6DD2D4/1CDE8BAB21868E4D893E119554BA87E5/EF71788BE39818EEA3F0164DC15E1BD7 +0 -170
  93. package/.vs/CopilotSnapshots/245168908540D646ACBD4FDE8D6DD2D4/state.mpack +0 -1
  94. package/.vs/CopilotSnapshots/3BACC9346120824DB30006E353477163/87C831E9EA1AA249A25A44D08CF8E0B5/EF71788BE39818EEA3F0164DC15E1BD7 +0 -328
  95. package/.vs/CopilotSnapshots/3BACC9346120824DB30006E353477163/state.mpack +0 -1
  96. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/14FE66AD0B834E488EECD9594AE72472/23E7151F0483C5BB5E663F83D4962FD4 +0 -1
  97. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/14FE66AD0B834E488EECD9594AE72472/2D4DCEBC89D52B097AEEEABA23C0EB59 +0 -1
  98. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/14FE66AD0B834E488EECD9594AE72472/7C951A8A572EA5C371FDE657AF968B9C +0 -1
  99. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/14FE66AD0B834E488EECD9594AE72472/A32D1DB906C73FA74EF270AAEE165FC0 +0 -1
  100. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/14FE66AD0B834E488EECD9594AE72472/B692C85119711C76235AA5D78F9F3818 +0 -1
  101. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/14FE66AD0B834E488EECD9594AE72472/E602628EF6D764C2C267810C92906DBA +0 -1
  102. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/14FE66AD0B834E488EECD9594AE72472/E621434FB1D5415B14FBBCC11967E420 +0 -1
  103. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/9C5A45FA50D5344FBB275F406599FF4E/23E7151F0483C5BB5E663F83D4962FD4 +0 -1
  104. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/9C5A45FA50D5344FBB275F406599FF4E/2D4DCEBC89D52B097AEEEABA23C0EB59 +0 -1
  105. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/9C5A45FA50D5344FBB275F406599FF4E/7C951A8A572EA5C371FDE657AF968B9C +0 -1
  106. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/9C5A45FA50D5344FBB275F406599FF4E/A32D1DB906C73FA74EF270AAEE165FC0 +0 -1
  107. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/9C5A45FA50D5344FBB275F406599FF4E/B692C85119711C76235AA5D78F9F3818 +0 -1
  108. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/9C5A45FA50D5344FBB275F406599FF4E/E602628EF6D764C2C267810C92906DBA +0 -1
  109. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/9C5A45FA50D5344FBB275F406599FF4E/E621434FB1D5415B14FBBCC11967E420 +0 -1
  110. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/9C5A45FA50D5344FBB275F406599FF4E/EF71788BE39818EEA3F0164DC15E1BD7 +0 -489
  111. package/.vs/CopilotSnapshots/3EFABA5D1530804CA04C606F5EFDDC38/state.mpack +0 -1
  112. package/.vs/CopilotSnapshots/4C16AB71DC018C46A734FBF0BF4AEDD9/0E5F1D40C0CAE848B8F9457F29A1F3FF/D03CD05B4F5C8B7C8CDF0B5E1961B3CA +0 -42
  113. package/.vs/CopilotSnapshots/4C16AB71DC018C46A734FBF0BF4AEDD9/462A64EF41A4BF42A18708B83E02FD6F/D03CD05B4F5C8B7C8CDF0B5E1961B3CA +0 -40
  114. package/.vs/CopilotSnapshots/4C16AB71DC018C46A734FBF0BF4AEDD9/90C95C12B91FA142BEF509B6FA329DE5/A3B20E10A19C7CA170132274D2F9312B +0 -9
  115. package/.vs/CopilotSnapshots/4C16AB71DC018C46A734FBF0BF4AEDD9/90C95C12B91FA142BEF509B6FA329DE5/D03CD05B4F5C8B7C8CDF0B5E1961B3CA +0 -1
  116. package/.vs/CopilotSnapshots/4C16AB71DC018C46A734FBF0BF4AEDD9/AD7513C9BBFE904AAB7F940397B95A99/D03CD05B4F5C8B7C8CDF0B5E1961B3CA +0 -42
  117. package/.vs/CopilotSnapshots/4C16AB71DC018C46A734FBF0BF4AEDD9/state.mpack +0 -1
  118. package/.vs/CopilotSnapshots/50E0417FAD2E524D887CB5763C2FB7B4/63A4C250D9DCE04B9F61D8833B89B5BF/EF71788BE39818EEA3F0164DC15E1BD7 +0 -174
  119. package/.vs/CopilotSnapshots/50E0417FAD2E524D887CB5763C2FB7B4/state.mpack +0 -1
  120. package/.vs/CopilotSnapshots/5EF2507B002AC14EA991043C37C36551/60FF68DE489DAD4FBCBBB54AA3F6A552/EF71788BE39818EEA3F0164DC15E1BD7 +0 -496
  121. package/.vs/CopilotSnapshots/5EF2507B002AC14EA991043C37C36551/state.mpack +0 -1
  122. package/.vs/CopilotSnapshots/6AA7610F1FB2B746821E54C28A8D109B/7FB78C0F8CB04F4AA6AF3315277B80F8/FB35DD13E708043D4CD8ACD54E14708F +0 -1
  123. package/.vs/CopilotSnapshots/6AA7610F1FB2B746821E54C28A8D109B/state.mpack +0 -1
  124. package/.vs/CopilotSnapshots/7F905F8BAC0DAD49BD507CA45C569AFD/5782E13CAB03A04E9E1EC5692F892170/BA5D2B145A59265D63FA3B3584344B02 +0 -5
  125. package/.vs/CopilotSnapshots/7F905F8BAC0DAD49BD507CA45C569AFD/5782E13CAB03A04E9E1EC5692F892170/EF71788BE39818EEA3F0164DC15E1BD7 +0 -158
  126. package/.vs/CopilotSnapshots/7F905F8BAC0DAD49BD507CA45C569AFD/9886598393C89944B51920C01EB650C9/BA5D2B145A59265D63FA3B3584344B02 +0 -35
  127. package/.vs/CopilotSnapshots/7F905F8BAC0DAD49BD507CA45C569AFD/state.mpack +0 -1
  128. package/.vs/CopilotSnapshots/8492D9C7A2D9514DB8A69D304B48BF3C/D2DA3C4E2131E84EA02E321802A65254/EF71788BE39818EEA3F0164DC15E1BD7 +0 -165
  129. package/.vs/CopilotSnapshots/8492D9C7A2D9514DB8A69D304B48BF3C/state.mpack +0 -1
  130. package/.vs/CopilotSnapshots/891A2DC0E5FA424CB8BDDA4FE26ED372/E244D49DDC79514DBA322770B03AE287/1CF9939611B0D194AC81951A171DF046 +0 -43
  131. package/.vs/CopilotSnapshots/891A2DC0E5FA424CB8BDDA4FE26ED372/state.mpack +0 -1
  132. package/.vs/CopilotSnapshots/8D302F8BAE46F54EA82AE1DED1A5D240/11E6D1F8E56D734F99C5216231273E8D/E621434FB1D5415B14FBBCC11967E420 +0 -66
  133. package/.vs/CopilotSnapshots/8D302F8BAE46F54EA82AE1DED1A5D240/24C69A83160FD844B0DEFECF8E1313DB/1CF9939611B0D194AC81951A171DF046 +0 -43
  134. package/.vs/CopilotSnapshots/8D302F8BAE46F54EA82AE1DED1A5D240/24C69A83160FD844B0DEFECF8E1313DB/E621434FB1D5415B14FBBCC11967E420 +0 -53
  135. package/.vs/CopilotSnapshots/8D302F8BAE46F54EA82AE1DED1A5D240/5E6D1BCD7CE81548AB445DE97505DC62/1CF9939611B0D194AC81951A171DF046 +0 -30
  136. package/.vs/CopilotSnapshots/8D302F8BAE46F54EA82AE1DED1A5D240/5E6D1BCD7CE81548AB445DE97505DC62/E621434FB1D5415B14FBBCC11967E420 +0 -53
  137. package/.vs/CopilotSnapshots/8D302F8BAE46F54EA82AE1DED1A5D240/EC4E81E0109C8F4BA1B5D9CFE1C122BC/E621434FB1D5415B14FBBCC11967E420 +0 -54
  138. package/.vs/CopilotSnapshots/8D302F8BAE46F54EA82AE1DED1A5D240/state.mpack +0 -1
  139. package/.vs/CopilotSnapshots/90C28D332F9B2949810126139FCA2640/6139F888FA743143B8E6C99306A478A6/30F913EA337870677E7C575773ECF531 +0 -130
  140. package/.vs/CopilotSnapshots/90C28D332F9B2949810126139FCA2640/F21743E379F9C1439F6A6405A289AA99/30F913EA337870677E7C575773ECF531 +0 -160
  141. package/.vs/CopilotSnapshots/90C28D332F9B2949810126139FCA2640/state.mpack +0 -1
  142. package/.vs/CopilotSnapshots/99E22E75C8AEDF4DB3A668A9ADF0BC43/2E2EFE66C5E05C4B809986E9B23D5409/45EABF6EF6BDFAA58C941A29E98C9C83 +0 -113
  143. package/.vs/CopilotSnapshots/99E22E75C8AEDF4DB3A668A9ADF0BC43/2E2EFE66C5E05C4B809986E9B23D5409/FB35DD13E708043D4CD8ACD54E14708F +0 -2
  144. package/.vs/CopilotSnapshots/99E22E75C8AEDF4DB3A668A9ADF0BC43/BE46916E3A8F2C4284792B951B674907/FB35DD13E708043D4CD8ACD54E14708F +0 -5
  145. package/.vs/CopilotSnapshots/99E22E75C8AEDF4DB3A668A9ADF0BC43/state.mpack +0 -1
  146. package/.vs/CopilotSnapshots/A6D99EA2D3819F45AD8087D7487F9318/state.mpack +0 -1
  147. package/.vs/CopilotSnapshots/A78C77F7A237704D95BCFE1BBC39FB0F/68BA9941941DC244BC799D89DB2BF86E/7C951A8A572EA5C371FDE657AF968B9C +0 -96
  148. package/.vs/CopilotSnapshots/A78C77F7A237704D95BCFE1BBC39FB0F/state.mpack +0 -1
  149. package/.vs/CopilotSnapshots/AD2203F1B9FECE44BB6D5DC5D83E87AA/734AB1B2974F9545B7F12AAA5842524B/840203FFA9CCF5B33DFD5C7CC5B13527 +0 -125
  150. package/.vs/CopilotSnapshots/AD2203F1B9FECE44BB6D5DC5D83E87AA/state.mpack +0 -1
  151. package/.vs/CopilotSnapshots/AEC950C2FAD20147AEE8E325E2CA0A78/89CF3F527D0687479D14274E8CDF3DFF/1CF9939611B0D194AC81951A171DF046 +0 -30
  152. package/.vs/CopilotSnapshots/AEC950C2FAD20147AEE8E325E2CA0A78/89CF3F527D0687479D14274E8CDF3DFF/BA5D2B145A59265D63FA3B3584344B02 +0 -158
  153. package/.vs/CopilotSnapshots/AEC950C2FAD20147AEE8E325E2CA0A78/E495EBF64DC77A4BBD470B92DB0391C4/1CF9939611B0D194AC81951A171DF046 +0 -30
  154. package/.vs/CopilotSnapshots/AEC950C2FAD20147AEE8E325E2CA0A78/E495EBF64DC77A4BBD470B92DB0391C4/BA5D2B145A59265D63FA3B3584344B02 +0 -67
  155. package/.vs/CopilotSnapshots/AEC950C2FAD20147AEE8E325E2CA0A78/state.mpack +0 -1
  156. package/.vs/CopilotSnapshots/AF947096A34634478C5D084B8442CD81/1FCDCC65B992954DB78BD1F46892312B/44EB81A1663981E3F52FFFECE3A2918E +0 -143
  157. package/.vs/CopilotSnapshots/AF947096A34634478C5D084B8442CD81/1FCDCC65B992954DB78BD1F46892312B/E602628EF6D764C2C267810C92906DBA +0 -253
  158. package/.vs/CopilotSnapshots/AF947096A34634478C5D084B8442CD81/state.mpack +0 -1
  159. package/.vs/CopilotSnapshots/B1DED422A45D5740BA4EE745C04B2B0B/226F822A22D6BD44BCF56BAA47FA274C/EF71788BE39818EEA3F0164DC15E1BD7 +0 -174
  160. package/.vs/CopilotSnapshots/B1DED422A45D5740BA4EE745C04B2B0B/state.mpack +0 -1
  161. package/.vs/CopilotSnapshots/B5DD5E50ACD0FD4998564F0FDE7FAEE0/97908D1D83AD2D4EA7082388DE07CBB4/44EB81A1663981E3F52FFFECE3A2918E +0 -148
  162. package/.vs/CopilotSnapshots/B5DD5E50ACD0FD4998564F0FDE7FAEE0/state.mpack +0 -1
  163. package/.vs/CopilotSnapshots/B8ADCAC0C19DB14FB8388BA59A86BC74/7ED3F1557FD7BE4DBEAF9B59FD442925/44EB81A1663981E3F52FFFECE3A2918E +0 -152
  164. package/.vs/CopilotSnapshots/B8ADCAC0C19DB14FB8388BA59A86BC74/state.mpack +0 -1
  165. package/.vs/CopilotSnapshots/BDFF50BBC1A93747A0001969C3BD195F/0130610530354840BB06BF4F4E744242/D03CD05B4F5C8B7C8CDF0B5E1961B3CA +0 -138
  166. package/.vs/CopilotSnapshots/BDFF50BBC1A93747A0001969C3BD195F/5F1C58CEFBAF1B4E80C4CF38B83A0A5F/D03CD05B4F5C8B7C8CDF0B5E1961B3CA +0 -129
  167. package/.vs/CopilotSnapshots/BDFF50BBC1A93747A0001969C3BD195F/BDC3D099FCCCC147848630670EED45CF/D03CD05B4F5C8B7C8CDF0B5E1961B3CA +0 -139
  168. package/.vs/CopilotSnapshots/BDFF50BBC1A93747A0001969C3BD195F/D9E2B1CDD1E2BB468E0703BEF6706FF6/D03CD05B4F5C8B7C8CDF0B5E1961B3CA +0 -139
  169. package/.vs/CopilotSnapshots/BDFF50BBC1A93747A0001969C3BD195F/state.mpack +0 -1
  170. package/.vs/CopilotSnapshots/C1E2C1A9C1DCFA46B1D5F1C6F36A152D/BC91C0FD38D8694BB992A8DEC1833670/148399016C7971F5592DAADBB9523118 +0 -120
  171. package/.vs/CopilotSnapshots/C1E2C1A9C1DCFA46B1D5F1C6F36A152D/state.mpack +0 -1
  172. package/.vs/CopilotSnapshots/C4D8E85893425E4F86F18850F5CA5C08/6C0950E97063C547A72D737E618436B0/1CF9939611B0D194AC81951A171DF046 +0 -9
  173. package/.vs/CopilotSnapshots/C4D8E85893425E4F86F18850F5CA5C08/6C0950E97063C547A72D737E618436B0/DFF70C60F68ECD9A4E4C3C74E4CC4DEE +0 -84
  174. package/.vs/CopilotSnapshots/C4D8E85893425E4F86F18850F5CA5C08/state.mpack +0 -1
  175. package/.vs/CopilotSnapshots/C5C3CA4C37B14A47B6BC753D09F69117/03EA1376F04C0D468FD0851119159D34/44EB81A1663981E3F52FFFECE3A2918E +0 -148
  176. package/.vs/CopilotSnapshots/C5C3CA4C37B14A47B6BC753D09F69117/03EA1376F04C0D468FD0851119159D34/E602628EF6D764C2C267810C92906DBA +0 -265
  177. package/.vs/CopilotSnapshots/C5C3CA4C37B14A47B6BC753D09F69117/6887503C15557349842029E58C9C0D11/44EB81A1663981E3F52FFFECE3A2918E +0 -152
  178. package/.vs/CopilotSnapshots/C5C3CA4C37B14A47B6BC753D09F69117/6887503C15557349842029E58C9C0D11/E602628EF6D764C2C267810C92906DBA +0 -265
  179. package/.vs/CopilotSnapshots/C5C3CA4C37B14A47B6BC753D09F69117/state.mpack +0 -1
  180. package/.vs/CopilotSnapshots/C7190BBC8D95D44F9CF8E65E3E8C9CFD/4B6D07592F8EDC4AA3FF742B1F9531CC/1B80EB15A2FEBEC11C8210C5461F8DB7 +0 -43
  181. package/.vs/CopilotSnapshots/C7190BBC8D95D44F9CF8E65E3E8C9CFD/state.mpack +0 -1
  182. package/.vs/CopilotSnapshots/C79D12964917E44F9A5BB9D8FA725A0C/2071ADB146D8F7499419123B2A595A41/03E00441128DC70FFEA043158417AC9A +0 -15
  183. package/.vs/CopilotSnapshots/C79D12964917E44F9A5BB9D8FA725A0C/6ECBF707FE2A88418EA1649CE46068D5/03E00441128DC70FFEA043158417AC9A +0 -1
  184. package/.vs/CopilotSnapshots/C79D12964917E44F9A5BB9D8FA725A0C/70BAB1D82B755F47A2351CA905ACC0F1/03E00441128DC70FFEA043158417AC9A +0 -49
  185. package/.vs/CopilotSnapshots/C79D12964917E44F9A5BB9D8FA725A0C/99DDFADAEC5CA14D92CC470523A11743/03E00441128DC70FFEA043158417AC9A +0 -39
  186. package/.vs/CopilotSnapshots/C79D12964917E44F9A5BB9D8FA725A0C/state.mpack +0 -1
  187. package/.vs/CopilotSnapshots/D533D78C39683A4188A2CEC902BC03CD/2445F4111C26EB4DA5404F930E140F56/840203FFA9CCF5B33DFD5C7CC5B13527 +0 -6
  188. package/.vs/CopilotSnapshots/D533D78C39683A4188A2CEC902BC03CD/2445F4111C26EB4DA5404F930E140F56/C27E5C1787B7957BF6F0C3D417890141 +0 -1
  189. package/.vs/CopilotSnapshots/D533D78C39683A4188A2CEC902BC03CD/state.mpack +0 -1
  190. package/.vs/CopilotSnapshots/DCAA5A718EC8304685D14C52356D80E0/5FC7C36C7769414C80BFF27A07BB5063/BE400B34D9700403D2BA3A1AA6B1EF1D +0 -15
  191. package/.vs/CopilotSnapshots/DCAA5A718EC8304685D14C52356D80E0/A4DD9B92084D8E48A95435EDB2B14545/86848C7099AD75EE4E8F10E066F49671 +0 -15
  192. package/.vs/CopilotSnapshots/DCAA5A718EC8304685D14C52356D80E0/A4DD9B92084D8E48A95435EDB2B14545/BE400B34D9700403D2BA3A1AA6B1EF1D +0 -15
  193. package/.vs/CopilotSnapshots/DCAA5A718EC8304685D14C52356D80E0/state.mpack +0 -1
  194. package/.vs/CopilotSnapshots/DCF62F751B748642A0BF5D5125AB6769/5F324CB20D1B5045A13090FA9D177B74/7C951A8A572EA5C371FDE657AF968B9C +0 -96
  195. package/.vs/CopilotSnapshots/DCF62F751B748642A0BF5D5125AB6769/5F324CB20D1B5045A13090FA9D177B74/B692C85119711C76235AA5D78F9F3818 +0 -73
  196. package/.vs/CopilotSnapshots/DCF62F751B748642A0BF5D5125AB6769/5F324CB20D1B5045A13090FA9D177B74/EF71788BE39818EEA3F0164DC15E1BD7 +0 -182
  197. package/.vs/CopilotSnapshots/DCF62F751B748642A0BF5D5125AB6769/C1287B2893D30D40A46C30DC2CE05178/7C951A8A572EA5C371FDE657AF968B9C +0 -96
  198. package/.vs/CopilotSnapshots/DCF62F751B748642A0BF5D5125AB6769/C1287B2893D30D40A46C30DC2CE05178/B692C85119711C76235AA5D78F9F3818 +0 -98
  199. package/.vs/CopilotSnapshots/DCF62F751B748642A0BF5D5125AB6769/CA6304DFE7764A4C87ACE5816CDB7CD9/7C951A8A572EA5C371FDE657AF968B9C +0 -96
  200. package/.vs/CopilotSnapshots/DCF62F751B748642A0BF5D5125AB6769/CA6304DFE7764A4C87ACE5816CDB7CD9/B692C85119711C76235AA5D78F9F3818 +0 -21
  201. package/.vs/CopilotSnapshots/DCF62F751B748642A0BF5D5125AB6769/CA6304DFE7764A4C87ACE5816CDB7CD9/EF71788BE39818EEA3F0164DC15E1BD7 +0 -176
  202. package/.vs/CopilotSnapshots/DCF62F751B748642A0BF5D5125AB6769/state.mpack +0 -1
  203. package/.vs/VSWorkspaceState.json +0 -6
  204. package/.vs/slnx.sqlite +0 -0
  205. package/.vs/ts-sample/CopilotIndices/17.13.433.20974/CodeChunks.db +0 -0
  206. package/.vs/ts-sample/CopilotIndices/17.13.433.20974/SemanticSymbols.db +0 -0
  207. package/.vs/ts-sample/CopilotIndices/17.13.439.2385/CodeChunks.db +0 -0
  208. package/.vs/ts-sample/CopilotIndices/17.13.439.2385/SemanticSymbols.db +0 -0
  209. package/.vs/ts-sample/CopilotIndices/17.13.441.19478/CodeChunks.db +0 -0
  210. package/.vs/ts-sample/CopilotIndices/17.13.441.19478/SemanticSymbols.db +0 -0
  211. package/.vs/ts-sample/FileContentIndex/2fa9d8cc-9158-496d-aa9b-3a471d46a157.vsidx +0 -0
  212. package/.vs/ts-sample/FileContentIndex/5530f45b-244e-4271-b3e3-d8250f03da64.vsidx +0 -0
  213. package/.vs/ts-sample/FileContentIndex/75f95b5d-c8f7-49ca-a3d7-d1d8f63db437.vsidx +0 -0
  214. package/.vs/ts-sample/FileContentIndex/abb2aeeb-f62a-4ca7-bfbf-7a1eada625a5.vsidx +0 -0
  215. package/.vs/ts-sample/FileContentIndex/fc749b54-0f95-45f6-ac75-a8ab3409a5ce.vsidx +0 -0
  216. package/.vs/ts-sample/config/applicationhost.config +0 -1026
  217. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/0901b413-5d87-4b43-b248-80356492be7e +0 -0
  218. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/0f61a76a-b21f-46b7-821e-54c28a8d109b +0 -0
  219. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/101aef14-dd28-4de3-b2eb-e0b26d587b3a +0 -0
  220. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/22d4deb1-5da4-4057-ba4e-e745c04b2b0b +0 -0
  221. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/2a76030d-a09e-48cb-85f2-114567f23f93 +0 -0
  222. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/2c6d08ca-cb98-4233-8f7c-011c3b409234 +0 -0
  223. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/338dc290-9b2f-4929-8101-26139fca2640 +0 -0
  224. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/34c9ac3b-2061-4d82-b300-06e353477163 +0 -0
  225. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/3c01b107-5c38-4156-a5f5-100e0751210b +0 -0
  226. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/489ee702-f5df-4723-87cb-618de990598a +0 -0
  227. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/4ccac3c5-b137-474a-b6bc-753d09f69117 +0 -0
  228. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/505eddb5-d0ac-49fd-9856-4f0fde7faee0 +0 -0
  229. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/58e8d8c4-4293-4f5e-86f1-8850f5ca5c08 +0 -0
  230. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/5dbafa3e-3015-4c80-a04c-606f5efddc38 +0 -0
  231. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/5f29f527-e43a-4661-b60e-ff772041f413 +0 -0
  232. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/6248dfd7-38ae-4fa6-9176-2fdc0694c3e8 +0 -0
  233. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/66fcbd64-32dc-436d-80e6-7435a1a3ecf1 +0 -0
  234. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/6f9ad733-d555-4d2c-b073-eb6a1aada347 +0 -0
  235. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/715aaadc-c88e-4630-85d1-4c52356d80e0 +0 -0
  236. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/71ab164c-01dc-468c-a734-fbf0bf4aedd9 +0 -0
  237. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/752ee299-aec8-4ddf-b3a6-68a9adf0bc43 +0 -0
  238. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/752ff6dc-741b-4286-a0bf-5d5125ab6769 +0 -0
  239. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/7b50f25e-2a00-4ec1-a991-043c37c36551 +0 -0
  240. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/7f41e050-2ead-4d52-887c-b5763c2fb7b4 +0 -0
  241. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/85b50c9e-8895-4085-89c1-934ad2704744 +0 -0
  242. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/8b2f308d-46ae-4ef5-a82a-e1ded1a5d240 +0 -0
  243. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/8b5f907f-0dac-49ad-bd50-7ca45c569afd +0 -0
  244. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/8cd733d5-6839-413a-88a2-cec902bc03cd +0 -0
  245. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/90685124-4085-46d6-acbd-4fde8d6dd2d4 +0 -0
  246. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/96129dc7-1749-4fe4-9a5b-b9d8fa725a0c +0 -0
  247. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/967094af-46a3-4734-8c5d-084b8442cd81 +0 -0
  248. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/a29ed9a6-81d3-459f-ad80-87d7487f9318 +0 -0
  249. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/a9c1e2c1-dcc1-46fa-b1d5-f1c6f36a152d +0 -0
  250. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/badc76f4-d284-4b6c-94e9-abdbc74de540 +0 -0
  251. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/bb50ffbd-a9c1-4737-a000-1969c3bd195f +0 -0
  252. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/bc0b19c7-958d-4fd4-9cf8-e65e3e8c9cfd +0 -0
  253. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/c02d1a89-fae5-4c42-b8bd-da4fe26ed372 +0 -0
  254. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/c0caadb8-9dc1-4fb1-b838-8ba59a86bc74 +0 -0
  255. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/c250c9ae-d2fa-4701-aee8-e325e2ca0a78 +0 -0
  256. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/c31db710-c1c4-4ec0-8602-fa06d3925f98 +0 -0
  257. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/c7d99284-d9a2-4d51-b8a6-9d304b48bf3c +0 -0
  258. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/ddd1fab4-4016-4cfc-bf9f-f4a85bdfc112 +0 -0
  259. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/f10322ad-feb9-44ce-bb6d-5dc5d83e87aa +0 -0
  260. package/.vs/ts-sample/copilot-chat/3c67db7d/sessions/f7778ca7-37a2-4d70-95bc-fe1bbc39fb0f +0 -0
  261. package/.vs/ts-sample/v17/.suo +0 -0
  262. package/.vs/ts-sample/v17/.wsuo +0 -0
  263. package/.vs/ts-sample/v17/DocumentLayout.backup.json +0 -425
  264. package/.vs/ts-sample/v17/DocumentLayout.json +0 -423
  265. package/.vs/ts-sample/v17/TestStore/0/000.testlog +0 -0
  266. package/.vs/ts-sample/v17/TestStore/0/testlog.manifest +0 -0
@@ -0,0 +1,13 @@
1
+ export * from './parsers/SelectQueryParser';
2
+ export * from './models/BinarySelectQuery';
3
+ export * from './models/SelectQuery';
4
+ export * from './models/ValueComponent';
5
+ export * from './models/ValuesQuery';
6
+ export * from './transformers/CTECollector';
7
+ export * from './transformers/CTENormalizer';
8
+ export * from './transformers/Formatter';
9
+ export * from './transformers/QueryNormalizer';
10
+ export * from './transformers/SelectValueCollector';
11
+ export * from './transformers/SelectableColumnCollector';
12
+ export * from './transformers/TableSourceCollector';
13
+ export * from './transformers/UpstreamSelectQueryFinder';
@@ -0,0 +1,91 @@
1
+ import { SourceExpression } from "./Clause";
2
+ import type { SelectQuery } from "./SelectQuery";
3
+ import { SqlComponent } from "./SqlComponent";
4
+ import { RawString } from "./ValueComponent";
5
+ /**
6
+ * Represents a binary SELECT query (e.g., UNION, INTERSECT, EXCEPT).
7
+ */
8
+ export declare class BinarySelectQuery extends SqlComponent {
9
+ static kind: symbol;
10
+ left: SelectQuery;
11
+ operator: RawString;
12
+ right: SelectQuery;
13
+ constructor(left: SelectQuery, operator: string, right: SelectQuery);
14
+ /**
15
+ * Appends another query to this binary query using UNION as the operator.
16
+ * This creates a new BinarySelectQuery where the left side is this binary query
17
+ * and the right side is the provided query.
18
+ *
19
+ * @param query The query to append with UNION
20
+ * @returns A new BinarySelectQuery representing "(this) UNION query"
21
+ */
22
+ union(query: SelectQuery): BinarySelectQuery;
23
+ /**
24
+ * Appends another query to this binary query using UNION ALL as the operator.
25
+ * This creates a new BinarySelectQuery where the left side is this binary query
26
+ * and the right side is the provided query.
27
+ *
28
+ * @param query The query to append with UNION ALL
29
+ * @returns A new BinarySelectQuery representing "(this) UNION ALL query"
30
+ */
31
+ unionAll(query: SelectQuery): BinarySelectQuery;
32
+ /**
33
+ * Appends another query to this binary query using INTERSECT as the operator.
34
+ * This creates a new BinarySelectQuery where the left side is this binary query
35
+ * and the right side is the provided query.
36
+ *
37
+ * @param query The query to append with INTERSECT
38
+ * @returns A new BinarySelectQuery representing "(this) INTERSECT query"
39
+ */
40
+ intersect(query: SelectQuery): BinarySelectQuery;
41
+ /**
42
+ * Appends another query to this binary query using INTERSECT ALL as the operator.
43
+ * This creates a new BinarySelectQuery where the left side is this binary query
44
+ * and the right side is the provided query.
45
+ *
46
+ * @param query The query to append with INTERSECT ALL
47
+ * @returns A new BinarySelectQuery representing "(this) INTERSECT ALL query"
48
+ */
49
+ intersectAll(query: SelectQuery): BinarySelectQuery;
50
+ /**
51
+ * Appends another query to this binary query using EXCEPT as the operator.
52
+ * This creates a new BinarySelectQuery where the left side is this binary query
53
+ * and the right side is the provided query.
54
+ *
55
+ * @param query The query to append with EXCEPT
56
+ * @returns A new BinarySelectQuery representing "(this) EXCEPT query"
57
+ */
58
+ except(query: SelectQuery): BinarySelectQuery;
59
+ /**
60
+ * Appends another query to this binary query using EXCEPT ALL as the operator.
61
+ * This creates a new BinarySelectQuery where the left side is this binary query
62
+ * and the right side is the provided query.
63
+ *
64
+ * @param query The query to append with EXCEPT ALL
65
+ * @returns A new BinarySelectQuery representing "(this) EXCEPT ALL query"
66
+ */
67
+ exceptAll(query: SelectQuery): BinarySelectQuery;
68
+ /**
69
+ * Appends another query to this binary query using the specified operator.
70
+ * This creates a new BinarySelectQuery where the left side is this binary query
71
+ * and the right side is the provided query.
72
+ *
73
+ * @param operator SQL operator to use (e.g. 'union', 'union all', 'intersect', 'except')
74
+ * @param query The query to append with the specified operator
75
+ * @returns A new BinarySelectQuery representing "(this) [operator] query"
76
+ */
77
+ appendSelectQuery(operator: string, query: SelectQuery): BinarySelectQuery;
78
+ /**
79
+ * Appends another query to this binary query using UNION as the operator, accepting a raw SQL string.
80
+ * This method parses the SQL string and appends the resulting query using UNION.
81
+ * @param sql The SQL string to parse and union
82
+ * @returns A new BinarySelectQuery representing "(this) UNION (parsed query)"
83
+ */
84
+ unionRaw(sql: string): BinarySelectQuery;
85
+ unionAllRaw(sql: string): BinarySelectQuery;
86
+ intersectRaw(sql: string): BinarySelectQuery;
87
+ intersectAllRaw(sql: string): BinarySelectQuery;
88
+ exceptRaw(sql: string): BinarySelectQuery;
89
+ exceptAllRaw(sql: string): BinarySelectQuery;
90
+ toSource(alias?: string): SourceExpression;
91
+ }
@@ -0,0 +1,189 @@
1
+ import { SelectQuery } from "./SelectQuery";
2
+ import { SqlComponent } from "./SqlComponent";
3
+ import { IdentifierString, RawString, ValueComponent, WindowFrameExpression } from "./ValueComponent";
4
+ export type SelectComponent = SelectItem | ValueComponent;
5
+ export declare class SelectItem extends SqlComponent {
6
+ static kind: symbol;
7
+ value: ValueComponent;
8
+ identifier: IdentifierString;
9
+ constructor(value: ValueComponent, name: string);
10
+ }
11
+ export declare class SelectClause extends SqlComponent {
12
+ static kind: symbol;
13
+ items: SelectComponent[];
14
+ distinct: DistinctComponent | null;
15
+ constructor(items: SelectComponent[], distinct?: DistinctComponent | null);
16
+ }
17
+ export type DistinctComponent = Distinct | DistinctOn;
18
+ export declare class Distinct extends SqlComponent {
19
+ static kind: symbol;
20
+ constructor();
21
+ }
22
+ export declare class DistinctOn extends SqlComponent {
23
+ static kind: symbol;
24
+ value: ValueComponent;
25
+ constructor(value: ValueComponent);
26
+ }
27
+ export declare class WhereClause extends SqlComponent {
28
+ static kind: symbol;
29
+ condition: ValueComponent;
30
+ constructor(condition: ValueComponent);
31
+ }
32
+ export declare class PartitionByClause extends SqlComponent {
33
+ static kind: symbol;
34
+ value: ValueComponent;
35
+ constructor(value: ValueComponent);
36
+ }
37
+ export declare class WindowFrameClause extends SqlComponent {
38
+ static kind: symbol;
39
+ name: IdentifierString;
40
+ expression: WindowFrameExpression;
41
+ constructor(name: string, expression: WindowFrameExpression);
42
+ }
43
+ export declare enum SortDirection {
44
+ Ascending = "asc",
45
+ Descending = "desc"
46
+ }
47
+ export declare enum NullsSortDirection {
48
+ First = "first",
49
+ Last = "last"
50
+ }
51
+ export type OrderByComponent = OrderByItem | ValueComponent;
52
+ export declare class OrderByClause extends SqlComponent {
53
+ static kind: symbol;
54
+ order: OrderByComponent[];
55
+ constructor(items: OrderByComponent[]);
56
+ }
57
+ export declare class OrderByItem extends SqlComponent {
58
+ static kind: symbol;
59
+ value: ValueComponent;
60
+ sortDirection: SortDirection;
61
+ nullsPosition: NullsSortDirection | null;
62
+ constructor(expression: ValueComponent, sortDirection: SortDirection | null, nullsPosition: NullsSortDirection | null);
63
+ }
64
+ export declare class GroupByClause extends SqlComponent {
65
+ static kind: symbol;
66
+ grouping: ValueComponent[];
67
+ constructor(expression: ValueComponent[]);
68
+ }
69
+ export declare class HavingClause extends SqlComponent {
70
+ static kind: symbol;
71
+ condition: ValueComponent;
72
+ constructor(condition: ValueComponent);
73
+ }
74
+ export type SourceComponent = TableSource | FunctionSource | SubQuerySource | ParenSource;
75
+ export declare class TableSource extends SqlComponent {
76
+ static kind: symbol;
77
+ namespaces: IdentifierString[] | null;
78
+ table: IdentifierString;
79
+ identifier: IdentifierString;
80
+ constructor(namespaces: string[] | null, table: string);
81
+ getSourceName(): string;
82
+ }
83
+ export declare class FunctionSource extends SqlComponent {
84
+ static kind: symbol;
85
+ name: RawString;
86
+ argument: ValueComponent | null;
87
+ constructor(functionName: string, argument: ValueComponent | null);
88
+ }
89
+ export declare class ParenSource extends SqlComponent {
90
+ static kind: symbol;
91
+ source: SourceComponent;
92
+ constructor(source: SourceComponent);
93
+ }
94
+ export declare class SubQuerySource extends SqlComponent {
95
+ static kind: symbol;
96
+ query: SelectQuery;
97
+ constructor(query: SelectQuery);
98
+ }
99
+ export declare class SourceExpression extends SqlComponent {
100
+ static kind: symbol;
101
+ datasource: SourceComponent;
102
+ aliasExpression: SourceAliasExpression | null;
103
+ constructor(datasource: SourceComponent, aliasExpression: SourceAliasExpression | null);
104
+ getAliasName(): string | null;
105
+ }
106
+ export type JoinConditionComponent = JoinOnClause | JoinUsingClause;
107
+ export declare class JoinOnClause extends SqlComponent {
108
+ static kind: symbol;
109
+ condition: ValueComponent;
110
+ constructor(condition: ValueComponent);
111
+ }
112
+ export declare class JoinUsingClause extends SqlComponent {
113
+ static kind: symbol;
114
+ condition: ValueComponent;
115
+ constructor(condition: ValueComponent);
116
+ }
117
+ export declare class JoinClause extends SqlComponent {
118
+ static kind: symbol;
119
+ joinType: RawString;
120
+ source: SourceExpression;
121
+ condition: JoinConditionComponent | null;
122
+ lateral: boolean;
123
+ constructor(joinType: string, source: SourceExpression, condition: JoinConditionComponent | null, lateral: boolean);
124
+ getAliasSourceName(): string | null;
125
+ }
126
+ export declare class FromClause extends SqlComponent {
127
+ static kind: symbol;
128
+ source: SourceExpression;
129
+ joins: JoinClause[] | null;
130
+ constructor(source: SourceExpression, join: JoinClause[] | null);
131
+ getAliasSourceName(): string | null;
132
+ /**
133
+ * Returns all SourceExpression objects in this FROM clause, including main source and all JOIN sources.
134
+ */
135
+ getSources(): SourceExpression[];
136
+ }
137
+ export declare class CommonTable extends SqlComponent {
138
+ static kind: symbol;
139
+ query: SelectQuery;
140
+ materialized: boolean | null;
141
+ aliasExpression: SourceAliasExpression;
142
+ constructor(query: SelectQuery, aliasExpression: SourceAliasExpression | string, materialized: boolean | null);
143
+ getAliasSourceName(): string;
144
+ }
145
+ export declare class WithClause extends SqlComponent {
146
+ static kind: symbol;
147
+ recursive: boolean;
148
+ tables: CommonTable[];
149
+ constructor(recursive: boolean, tables: CommonTable[]);
150
+ }
151
+ export declare class LimitClause extends SqlComponent {
152
+ static kind: symbol;
153
+ limit: ValueComponent;
154
+ offset: ValueComponent | null;
155
+ constructor(limit: ValueComponent, offset: ValueComponent | null);
156
+ }
157
+ export declare enum FetchType {
158
+ Next = "next",
159
+ First = "first"
160
+ }
161
+ export declare enum FetchUnit {
162
+ RowsOnly = "rows only",
163
+ Percent = "percent",
164
+ PercentWithTies = "percent with ties"
165
+ }
166
+ export declare class FetchSpecification extends SqlComponent {
167
+ static kind: symbol;
168
+ type: FetchType;
169
+ count: ValueComponent;
170
+ unit: FetchUnit | null;
171
+ constructor(type: FetchType, count: ValueComponent, unit: FetchUnit | null);
172
+ }
173
+ export declare enum LockMode {
174
+ Update = "update",
175
+ Share = "share",
176
+ KeyShare = "key share",
177
+ NokeyUpdate = "no key update"
178
+ }
179
+ export declare class ForClause extends SqlComponent {
180
+ static kind: symbol;
181
+ lockMode: LockMode;
182
+ constructor(lockMode: LockMode);
183
+ }
184
+ export declare class SourceAliasExpression extends SqlComponent {
185
+ static kind: symbol;
186
+ table: IdentifierString;
187
+ columns: IdentifierString[] | null;
188
+ constructor(alias: string, columnAlias: string[] | null);
189
+ }
@@ -0,0 +1,11 @@
1
+ import { KeywordMatchResult } from "../parsers/KeywordParser";
2
+ export declare class KeywordTrie {
3
+ private root;
4
+ private currentNode;
5
+ private hasEndProperty;
6
+ private hasMoreProperties;
7
+ constructor(keywords: string[][]);
8
+ private addKeyword;
9
+ reset(): void;
10
+ pushLexeme(lexeme: string): KeywordMatchResult;
11
+ }
@@ -0,0 +1,25 @@
1
+ export declare enum TokenType {
2
+ Literal = 0,
3
+ Operator = 1,
4
+ OpenParen = 2,
5
+ CloseParen = 3,
6
+ Comma = 4,
7
+ Dot = 5,
8
+ Identifier = 6,
9
+ Command = 7,// select, from, where as, on, array etc
10
+ Parameter = 8,
11
+ OpenBracket = 9,
12
+ CloseBracket = 10,
13
+ Function = 11,// next token is open paren
14
+ StringSpecifier = 12,// next token is string literal
15
+ Type = 13
16
+ }
17
+ /**
18
+ * Represents a lexical token in SQL parsing
19
+ */
20
+ export interface Lexeme {
21
+ type: TokenType;
22
+ value: string;
23
+ comments: string[] | null;
24
+ maybeType: boolean | null;
25
+ }
@@ -0,0 +1,5 @@
1
+ import { SimpleSelectQuery } from "./SimpleSelectQuery";
2
+ import { BinarySelectQuery } from "./BinarySelectQuery";
3
+ import { ValuesQuery } from "./ValuesQuery";
4
+ export type SelectQuery = SimpleSelectQuery | BinarySelectQuery | ValuesQuery;
5
+ export { SimpleSelectQuery, BinarySelectQuery, ValuesQuery };
@@ -0,0 +1,167 @@
1
+ import { SqlComponent } from "./SqlComponent";
2
+ import { ForClause, FromClause, GroupByClause, HavingClause, LimitClause, OrderByClause, SelectClause, SourceExpression, WhereClause, WindowFrameClause, WithClause, CommonTable } from "./Clause";
3
+ import { ValueComponent } from "./ValueComponent";
4
+ import { BinarySelectQuery } from "./BinarySelectQuery";
5
+ import type { SelectQuery } from "./SelectQuery";
6
+ /**
7
+ * Represents a simple SELECT query in SQL.
8
+ */
9
+ export declare class SimpleSelectQuery extends SqlComponent {
10
+ static kind: symbol;
11
+ WithClause: WithClause | null;
12
+ selectClause: SelectClause;
13
+ fromClause: FromClause | null;
14
+ whereClause: WhereClause | null;
15
+ groupByClause: GroupByClause | null;
16
+ havingClause: HavingClause | null;
17
+ orderByClause: OrderByClause | null;
18
+ windowFrameClause: WindowFrameClause | null;
19
+ rowLimitClause: LimitClause | null;
20
+ forClause: ForClause | null;
21
+ constructor(withClause: WithClause | null, selectClause: SelectClause, fromClause: FromClause | null, whereClause: WhereClause | null, groupByClause: GroupByClause | null, havingClause: HavingClause | null, orderByClause: OrderByClause | null, windowFrameClause: WindowFrameClause | null, rowLimitClause: LimitClause | null, forClause: ForClause | null);
22
+ /**
23
+ * Creates a new BinarySelectQuery with this query as the left side and the provided query as the right side,
24
+ * using UNION as the operator.
25
+ *
26
+ * @param rightQuery The right side of the UNION
27
+ * @returns A new BinarySelectQuery representing "this UNION rightQuery"
28
+ */
29
+ toUnion(rightQuery: SelectQuery): BinarySelectQuery;
30
+ /**
31
+ * Creates a new BinarySelectQuery with this query as the left side and the provided query as the right side,
32
+ * using UNION ALL as the operator.
33
+ *
34
+ * @param rightQuery The right side of the UNION ALL
35
+ * @returns A new BinarySelectQuery representing "this UNION ALL rightQuery"
36
+ */
37
+ toUnionAll(rightQuery: SelectQuery): BinarySelectQuery;
38
+ /**
39
+ * Creates a new BinarySelectQuery with this query as the left side and the provided query as the right side,
40
+ * using INTERSECT as the operator.
41
+ *
42
+ * @param rightQuery The right side of the INTERSECT
43
+ * @returns A new BinarySelectQuery representing "this INTERSECT rightQuery"
44
+ */
45
+ toIntersect(rightQuery: SelectQuery): BinarySelectQuery;
46
+ /**
47
+ * Creates a new BinarySelectQuery with this query as the left side and the provided query as the right side,
48
+ * using INTERSECT ALL as the operator.
49
+ *
50
+ * @param rightQuery The right side of the INTERSECT ALL
51
+ * @returns A new BinarySelectQuery representing "this INTERSECT ALL rightQuery"
52
+ */
53
+ toIntersectAll(rightQuery: SelectQuery): BinarySelectQuery;
54
+ /**
55
+ * Creates a new BinarySelectQuery with this query as the left side and the provided query as the right side,
56
+ * using EXCEPT as the operator.
57
+ *
58
+ * @param rightQuery The right side of the EXCEPT
59
+ * @returns A new BinarySelectQuery representing "this EXCEPT rightQuery"
60
+ */
61
+ toExcept(rightQuery: SelectQuery): BinarySelectQuery;
62
+ /**
63
+ * Creates a new BinarySelectQuery with this query as the left side and the provided query as the right side,
64
+ * using EXCEPT ALL as the operator.
65
+ *
66
+ * @param rightQuery The right side of the EXCEPT ALL
67
+ * @returns A new BinarySelectQuery representing "this EXCEPT ALL rightQuery"
68
+ */
69
+ toExceptAll(rightQuery: SelectQuery): BinarySelectQuery;
70
+ /**
71
+ * Creates a new BinarySelectQuery with this query as the left side and the provided query as the right side,
72
+ * using the specified operator.
73
+ *
74
+ * @param operator SQL operator to use (e.g. 'union', 'union all', 'intersect', 'except')
75
+ * @param rightQuery The right side of the binary operation
76
+ * @returns A new BinarySelectQuery representing "this [operator] rightQuery"
77
+ */
78
+ toBinaryQuery(operator: string, rightQuery: SelectQuery): BinarySelectQuery;
79
+ /**
80
+ * Appends a new condition to the query's WHERE clause using AND logic.
81
+ * The condition is provided as a raw SQL string which is parsed internally.
82
+ *
83
+ * @param rawCondition Raw SQL string representing the condition (e.g. "status = 'active'")
84
+ */
85
+ appendWhereRaw(rawCondition: string): void;
86
+ /**
87
+ * Appends a new condition to the query's WHERE clause using AND logic.
88
+ * The condition is provided as a ValueComponent object.
89
+ *
90
+ * @param condition ValueComponent representing the condition
91
+ */
92
+ appendWhere(condition: ValueComponent): void;
93
+ /**
94
+ * Appends a new condition to the query's HAVING clause using AND logic.
95
+ * The condition is provided as a raw SQL string which is parsed internally.
96
+ *
97
+ * @param rawCondition Raw SQL string representing the condition (e.g. "count(*) > 5")
98
+ */
99
+ appendHavingRaw(rawCondition: string): void;
100
+ /**
101
+ * Appends a new condition to the query's HAVING clause using AND logic.
102
+ * The condition is provided as a ValueComponent object.
103
+ *
104
+ * @param condition ValueComponent representing the condition
105
+ */
106
+ appendHaving(condition: ValueComponent): void;
107
+ /**
108
+ * Appends an INNER JOIN clause to the query.
109
+ * @param joinSourceRawText The table source text to join (e.g., "my_table", "schema.my_table")
110
+ * @param alias The alias for the joined table
111
+ * @param columns The columns to use for the join condition (e.g. ["user_id"])
112
+ */
113
+ innerJoinRaw(joinSourceRawText: string, alias: string, columns: string[]): void;
114
+ /**
115
+ * Appends a LEFT JOIN clause to the query.
116
+ * @param joinSourceRawText The table source text to join
117
+ * @param alias The alias for the joined table
118
+ * @param columns The columns to use for the join condition
119
+ */
120
+ leftJoinRaw(joinSourceRawText: string, alias: string, columns: string[]): void;
121
+ /**
122
+ * Appends a RIGHT JOIN clause to the query.
123
+ * @param joinSourceRawText The table source text to join
124
+ * @param alias The alias for the joined table
125
+ * @param columns The columns to use for the join condition
126
+ */
127
+ rightJoinRaw(joinSourceRawText: string, alias: string, columns: string[]): void;
128
+ /**
129
+ * Appends an INNER JOIN clause to the query using a SourceExpression.
130
+ * @param sourceExpr The source expression to join
131
+ * @param columns The columns to use for the join condition
132
+ */
133
+ innerJoin(sourceExpr: SourceExpression, columns: string[]): void;
134
+ /**
135
+ * Appends a LEFT JOIN clause to the query using a SourceExpression.
136
+ * @param sourceExpr The source expression to join
137
+ * @param columns The columns to use for the join condition
138
+ */
139
+ leftJoin(sourceExpr: SourceExpression, columns: string[]): void;
140
+ /**
141
+ * Appends a RIGHT JOIN clause to the query using a SourceExpression.
142
+ * @param sourceExpr The source expression to join
143
+ * @param columns The columns to use for the join condition
144
+ */
145
+ rightJoin(sourceExpr: SourceExpression, columns: string[]): void;
146
+ /**
147
+ * Internal helper to append a JOIN clause.
148
+ * Parses the table source, finds the corresponding columns in the existing query context,
149
+ * and builds the JOIN condition.
150
+ * @param joinType Type of join (e.g., 'inner join', 'left join')
151
+ * @param joinSourceRawText Raw text for the table/source to join (e.g., "my_table", "schema.another_table")
152
+ * @param alias Alias for the table/source being joined
153
+ * @param columns Array of column names to join on
154
+ */
155
+ private joinSourceRaw;
156
+ private joinSource;
157
+ toSource(alias: string): SourceExpression;
158
+ appendWith(commonTable: CommonTable | CommonTable[]): void;
159
+ /**
160
+ * Appends a CommonTable (CTE) to the WITH clause from raw SQL text and alias.
161
+ * If alias is provided, it will be used as the CTE name.
162
+ *
163
+ * @param rawText Raw SQL string representing the CTE body (e.g. '(SELECT ...)')
164
+ * @param alias Optional alias for the CTE (e.g. 'cte_name')
165
+ */
166
+ appendWithRaw(rawText: string, alias: string): void;
167
+ }
@@ -0,0 +1,18 @@
1
+ export declare abstract class SqlComponent {
2
+ static kind: symbol;
3
+ getKind(): symbol;
4
+ accept<T>(visitor: SqlComponentVisitor<T>): T;
5
+ toSqlString(formatter: SqlComponentVisitor<string>): string;
6
+ comments: string[] | null;
7
+ }
8
+ export interface SqlComponentVisitor<T> {
9
+ visit(expr: SqlComponent): T;
10
+ }
11
+ export declare class SqlDialectConfiguration {
12
+ parameterSymbol: string;
13
+ identifierEscape: {
14
+ start: string;
15
+ end: string;
16
+ };
17
+ exportComment: boolean;
18
+ }
@@ -0,0 +1,158 @@
1
+ import { PartitionByClause, OrderByClause } from "./Clause";
2
+ import { SelectQuery } from "./SelectQuery";
3
+ import { SqlComponent } from "./SqlComponent";
4
+ export type ValueComponent = ValueList | ColumnReference | FunctionCall | UnaryExpression | BinaryExpression | LiteralValue | ParameterExpression | SwitchCaseArgument | CaseKeyValuePair | RawString | IdentifierString | ParenExpression | CastExpression | CaseExpression | ArrayExpression | BetweenExpression | InlineQuery | StringSpecifierExpression | TypeValue | TupleExpression;
5
+ export declare class InlineQuery extends SqlComponent {
6
+ static kind: symbol;
7
+ selectQuery: SelectQuery;
8
+ constructor(selectQuery: SelectQuery);
9
+ }
10
+ export declare class ValueList extends SqlComponent {
11
+ static kind: symbol;
12
+ values: ValueComponent[];
13
+ constructor(values: ValueComponent[]);
14
+ }
15
+ export declare class ColumnReference extends SqlComponent {
16
+ static kind: symbol;
17
+ namespaces: IdentifierString[] | null;
18
+ column: IdentifierString;
19
+ constructor(namespaces: string[] | null, column: string);
20
+ toString(): string;
21
+ getNamespace(): string;
22
+ }
23
+ export declare class FunctionCall extends SqlComponent {
24
+ static kind: symbol;
25
+ name: RawString;
26
+ argument: ValueComponent | null;
27
+ over: OverExpression | null;
28
+ constructor(name: string, argument: ValueComponent | null, over: OverExpression | null);
29
+ }
30
+ export type OverExpression = WindowFrameExpression | IdentifierString;
31
+ export declare enum WindowFrameType {
32
+ Rows = "rows",
33
+ Range = "range",
34
+ Groups = "groups"
35
+ }
36
+ export declare enum WindowFrameBound {
37
+ UnboundedPreceding = "unbounded preceding",
38
+ UnboundedFollowing = "unbounded following",
39
+ CurrentRow = "current row"
40
+ }
41
+ export type FrameBoundaryComponent = WindowFrameBoundStatic | WindowFrameBoundaryValue;
42
+ export declare class WindowFrameBoundStatic extends SqlComponent {
43
+ static kind: symbol;
44
+ bound: WindowFrameBound;
45
+ constructor(bound: WindowFrameBound);
46
+ }
47
+ export declare class WindowFrameBoundaryValue extends SqlComponent {
48
+ static kind: symbol;
49
+ value: ValueComponent;
50
+ isFollowing: boolean;
51
+ constructor(value: ValueComponent, isFollowing: boolean);
52
+ }
53
+ export declare class WindowFrameSpec extends SqlComponent {
54
+ static kind: symbol;
55
+ frameType: WindowFrameType;
56
+ startBound: FrameBoundaryComponent;
57
+ endBound: FrameBoundaryComponent | null;
58
+ constructor(frameType: WindowFrameType, startBound: FrameBoundaryComponent, endBound: FrameBoundaryComponent | null);
59
+ }
60
+ export declare class WindowFrameExpression extends SqlComponent {
61
+ static kind: symbol;
62
+ partition: PartitionByClause | null;
63
+ order: OrderByClause | null;
64
+ frameSpec: WindowFrameSpec | null;
65
+ constructor(partition: PartitionByClause | null, order: OrderByClause | null, frameSpec?: WindowFrameSpec | null);
66
+ }
67
+ export declare class UnaryExpression extends SqlComponent {
68
+ static kind: symbol;
69
+ operator: RawString;
70
+ expression: ValueComponent;
71
+ constructor(operator: string, expression: ValueComponent);
72
+ }
73
+ export declare class BinaryExpression extends SqlComponent {
74
+ static kind: symbol;
75
+ left: ValueComponent;
76
+ operator: RawString;
77
+ right: ValueComponent;
78
+ constructor(left: ValueComponent, operator: string, right: ValueComponent);
79
+ }
80
+ export declare class LiteralValue extends SqlComponent {
81
+ static kind: symbol;
82
+ value: string | number | boolean | null;
83
+ constructor(value: string | number | boolean | null);
84
+ }
85
+ export declare class ParameterExpression extends SqlComponent {
86
+ static kind: symbol;
87
+ name: RawString;
88
+ constructor(name: string);
89
+ }
90
+ export declare class SwitchCaseArgument extends SqlComponent {
91
+ static kind: symbol;
92
+ cases: CaseKeyValuePair[];
93
+ elseValue: ValueComponent | null;
94
+ constructor(cases: CaseKeyValuePair[], elseValue?: ValueComponent | null);
95
+ }
96
+ export declare class CaseKeyValuePair extends SqlComponent {
97
+ static kind: symbol;
98
+ key: ValueComponent;
99
+ value: ValueComponent;
100
+ constructor(key: ValueComponent, value: ValueComponent);
101
+ }
102
+ export declare class RawString extends SqlComponent {
103
+ static kind: symbol;
104
+ value: string;
105
+ constructor(value: string);
106
+ }
107
+ export declare class IdentifierString extends SqlComponent {
108
+ static kind: symbol;
109
+ name: string;
110
+ constructor(alias: string);
111
+ }
112
+ export declare class ParenExpression extends SqlComponent {
113
+ static kind: symbol;
114
+ expression: ValueComponent;
115
+ constructor(expression: ValueComponent);
116
+ }
117
+ export declare class CastExpression extends SqlComponent {
118
+ static kind: symbol;
119
+ input: ValueComponent;
120
+ castType: TypeValue;
121
+ constructor(input: ValueComponent, castType: TypeValue);
122
+ }
123
+ export declare class CaseExpression extends SqlComponent {
124
+ static kind: symbol;
125
+ condition: ValueComponent | null;
126
+ switchCase: SwitchCaseArgument;
127
+ constructor(condition: ValueComponent | null, switchCase: SwitchCaseArgument);
128
+ }
129
+ export declare class ArrayExpression extends SqlComponent {
130
+ static kind: symbol;
131
+ expression: ValueComponent;
132
+ constructor(expression: ValueComponent);
133
+ }
134
+ export declare class BetweenExpression extends SqlComponent {
135
+ static kind: symbol;
136
+ expression: ValueComponent;
137
+ lower: ValueComponent;
138
+ upper: ValueComponent;
139
+ negated: boolean;
140
+ constructor(expression: ValueComponent, lower: ValueComponent, upper: ValueComponent, negated: boolean);
141
+ }
142
+ export declare class StringSpecifierExpression extends SqlComponent {
143
+ static kind: symbol;
144
+ specifier: RawString;
145
+ value: ValueComponent;
146
+ constructor(specifier: string, value: string);
147
+ }
148
+ export declare class TypeValue extends SqlComponent {
149
+ static kind: symbol;
150
+ type: RawString;
151
+ argument: ValueComponent | null;
152
+ constructor(type: string, argument?: ValueComponent | null);
153
+ }
154
+ export declare class TupleExpression extends SqlComponent {
155
+ static kind: symbol;
156
+ values: ValueComponent[];
157
+ constructor(values: ValueComponent[]);
158
+ }