@dbml/parse 7.1.2 → 8.0.0-alpha.10

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 (202) hide show
  1. package/dist/dbml-parse.js +25 -19
  2. package/dist/dbml-parse.mjs +11321 -7514
  3. package/dist/src/compiler/index.d.ts +93 -53
  4. package/dist/src/compiler/projectLayout/index.d.ts +1 -0
  5. package/dist/src/compiler/projectLayout/layout.d.ts +23 -0
  6. package/dist/src/compiler/queries/canonicalName.d.ts +9 -0
  7. package/dist/src/compiler/queries/container/element.d.ts +2 -1
  8. package/dist/src/compiler/queries/container/index.d.ts +5 -5
  9. package/dist/src/compiler/queries/container/scope.d.ts +3 -2
  10. package/dist/src/compiler/queries/container/scopeKind.d.ts +2 -1
  11. package/dist/src/compiler/queries/container/stack.d.ts +2 -1
  12. package/dist/src/compiler/queries/container/token.d.ts +2 -1
  13. package/dist/src/compiler/queries/files/fileDependencies.d.ts +3 -0
  14. package/dist/src/compiler/queries/files/reachableFiles.d.ts +4 -0
  15. package/dist/src/compiler/queries/files/usableMembers.d.ts +34 -0
  16. package/dist/src/compiler/queries/legacy/parse.d.ts +10 -9
  17. package/dist/src/compiler/queries/legacy/symbol.d.ts +1 -10
  18. package/dist/src/compiler/queries/legacy/token.d.ts +3 -2
  19. package/dist/src/compiler/queries/nodeAtPosition.d.ts +5 -0
  20. package/dist/src/compiler/queries/pipeline/bind.d.ts +5 -0
  21. package/dist/src/compiler/queries/pipeline/index.d.ts +2 -0
  22. package/dist/src/compiler/queries/pipeline/interpret.d.ts +6 -0
  23. package/dist/src/compiler/queries/pipeline/parse.d.ts +12 -0
  24. package/dist/src/compiler/queries/pipeline/validate.d.ts +4 -0
  25. package/dist/src/compiler/queries/resolutionIndex.d.ts +13 -0
  26. package/dist/src/compiler/queries/symbol/lookupMembers.d.ts +4 -0
  27. package/dist/src/compiler/queries/symbol/symbolAliases.d.ts +4 -0
  28. package/dist/src/compiler/queries/symbol/symbolUses.d.ts +4 -0
  29. package/dist/src/compiler/queries/transform/index.d.ts +3 -3
  30. package/dist/src/compiler/queries/transform/renameTable.d.ts +19 -16
  31. package/dist/src/compiler/queries/transform/syncDiagramView.d.ts +19 -6
  32. package/dist/src/compiler/queries/transform/utils.d.ts +5 -4
  33. package/dist/src/compiler/queries/utils.d.ts +6 -0
  34. package/dist/src/constants.d.ts +1 -2
  35. package/dist/src/core/global_modules/checks/bind.d.ts +9 -0
  36. package/dist/src/core/global_modules/checks/index.d.ts +2 -0
  37. package/dist/src/core/global_modules/checks/interpret.d.ts +10 -0
  38. package/dist/src/core/global_modules/diagramView/bind.d.ts +18 -0
  39. package/dist/src/core/global_modules/diagramView/index.d.ts +8 -0
  40. package/dist/src/core/global_modules/diagramView/interpret.d.ts +37 -0
  41. package/dist/src/core/global_modules/enum/bind.d.ts +11 -0
  42. package/dist/src/core/global_modules/enum/index.d.ts +8 -0
  43. package/dist/src/core/global_modules/enum/interpret.d.ts +15 -0
  44. package/dist/src/core/global_modules/index.d.ts +17 -0
  45. package/dist/src/core/global_modules/indexes/bind.d.ts +12 -0
  46. package/dist/src/core/global_modules/indexes/index.d.ts +2 -0
  47. package/dist/src/core/global_modules/indexes/interpret.d.ts +10 -0
  48. package/dist/src/core/global_modules/note/bind.d.ts +11 -0
  49. package/dist/src/core/global_modules/note/index.d.ts +2 -0
  50. package/dist/src/core/global_modules/note/interpret.d.ts +17 -0
  51. package/dist/src/core/global_modules/program/bind.d.ts +17 -0
  52. package/dist/src/core/global_modules/program/index.d.ts +2 -0
  53. package/dist/src/core/global_modules/program/interpret.d.ts +23 -0
  54. package/dist/src/core/global_modules/program/utils.d.ts +3 -0
  55. package/dist/src/core/global_modules/project/bind.d.ts +11 -0
  56. package/dist/src/core/global_modules/project/index.d.ts +2 -0
  57. package/dist/src/core/global_modules/project/interpret.d.ts +16 -0
  58. package/dist/src/core/global_modules/records/bind.d.ts +17 -0
  59. package/dist/src/core/global_modules/records/index.d.ts +2 -0
  60. package/dist/src/core/global_modules/records/interpret.d.ts +13 -0
  61. package/dist/src/core/global_modules/records/utils/constraints/fk.d.ts +13 -0
  62. package/dist/src/core/global_modules/records/utils/constraints/helper.d.ts +26 -0
  63. package/dist/src/core/global_modules/records/utils/constraints/pk.d.ts +6 -0
  64. package/dist/src/core/global_modules/records/utils/constraints/unique.d.ts +5 -0
  65. package/dist/src/core/{interpreter → global_modules}/records/utils/data/sqlTypes.d.ts +0 -8
  66. package/dist/src/core/{interpreter → global_modules}/records/utils/data/values.d.ts +1 -1
  67. package/dist/src/core/global_modules/ref/bind.d.ts +15 -0
  68. package/dist/src/core/global_modules/ref/index.d.ts +7 -0
  69. package/dist/src/core/global_modules/ref/interpret.d.ts +15 -0
  70. package/dist/src/core/global_modules/schema/index.d.ts +2 -0
  71. package/dist/src/core/global_modules/table/bind.d.ts +18 -0
  72. package/dist/src/core/global_modules/table/index.d.ts +9 -0
  73. package/dist/src/core/global_modules/table/interpret.d.ts +26 -0
  74. package/dist/src/core/global_modules/table/utils.d.ts +4 -0
  75. package/dist/src/core/global_modules/tableGroup/bind.d.ts +15 -0
  76. package/dist/src/core/global_modules/tableGroup/index.d.ts +8 -0
  77. package/dist/src/core/global_modules/tableGroup/interpret.d.ts +18 -0
  78. package/dist/src/core/global_modules/tablePartial/bind.d.ts +17 -0
  79. package/dist/src/core/global_modules/tablePartial/index.d.ts +7 -0
  80. package/dist/src/core/global_modules/tablePartial/interpret.d.ts +23 -0
  81. package/dist/src/core/global_modules/types.d.ts +17 -0
  82. package/dist/src/core/global_modules/use/index.d.ts +8 -0
  83. package/dist/src/core/global_modules/utils.d.ts +17 -0
  84. package/dist/src/core/local_modules/checks/index.d.ts +2 -0
  85. package/dist/src/core/local_modules/checks/validate.d.ts +17 -0
  86. package/dist/src/core/local_modules/custom/index.d.ts +2 -0
  87. package/dist/src/core/local_modules/custom/validate.d.ts +14 -0
  88. package/dist/src/core/local_modules/diagramView/index.d.ts +2 -0
  89. package/dist/src/core/local_modules/diagramView/validate.d.ts +24 -0
  90. package/dist/src/core/local_modules/enum/index.d.ts +2 -0
  91. package/dist/src/core/local_modules/enum/validate.d.ts +17 -0
  92. package/dist/src/core/local_modules/index.d.ts +10 -0
  93. package/dist/src/core/local_modules/indexes/index.d.ts +2 -0
  94. package/dist/src/core/local_modules/indexes/validate.d.ts +18 -0
  95. package/dist/src/core/local_modules/note/index.d.ts +2 -0
  96. package/dist/src/core/local_modules/note/validate.d.ts +16 -0
  97. package/dist/src/core/local_modules/program/index.d.ts +2 -0
  98. package/dist/src/core/local_modules/program/validate.d.ts +9 -0
  99. package/dist/src/core/local_modules/project/index.d.ts +2 -0
  100. package/dist/src/core/local_modules/project/validate.d.ts +15 -0
  101. package/dist/src/core/local_modules/records/index.d.ts +2 -0
  102. package/dist/src/core/local_modules/records/validate.d.ts +20 -0
  103. package/dist/src/core/local_modules/ref/index.d.ts +2 -0
  104. package/dist/src/core/local_modules/ref/validate.d.ts +20 -0
  105. package/dist/src/core/local_modules/table/index.d.ts +2 -0
  106. package/dist/src/core/local_modules/table/validate.d.ts +21 -0
  107. package/dist/src/core/local_modules/tableGroup/index.d.ts +2 -0
  108. package/dist/src/core/local_modules/tableGroup/validate.d.ts +19 -0
  109. package/dist/src/core/local_modules/tablePartial/index.d.ts +2 -0
  110. package/dist/src/core/local_modules/tablePartial/validate.d.ts +21 -0
  111. package/dist/src/core/local_modules/types.d.ts +12 -0
  112. package/dist/src/core/local_modules/use/index.d.ts +2 -0
  113. package/dist/src/core/local_modules/use/validate.d.ts +12 -0
  114. package/dist/src/core/parser/parser.d.ts +8 -0
  115. package/dist/src/core/parser/utils.d.ts +2 -49
  116. package/dist/src/core/types/errors.d.ts +9 -5
  117. package/dist/src/core/types/filepath.d.ts +8 -2
  118. package/dist/src/core/types/index.d.ts +2 -0
  119. package/dist/src/core/types/internable.d.ts +0 -12
  120. package/dist/src/core/{analyzer/types.d.ts → types/keywords.d.ts} +6 -2
  121. package/dist/src/core/types/nodes.d.ts +61 -16
  122. package/dist/src/core/types/report.d.ts +3 -3
  123. package/dist/src/core/types/schemaJson.d.ts +14 -5
  124. package/dist/src/core/types/symbol/factory.d.ts +3 -2
  125. package/dist/src/core/types/symbol/index.d.ts +3 -4
  126. package/dist/src/core/types/symbol/metadata.d.ts +80 -0
  127. package/dist/src/core/types/symbol/symbols.d.ts +277 -86
  128. package/dist/src/core/{analyzer/utils.d.ts → utils/expression.d.ts} +10 -21
  129. package/dist/src/core/utils/interpret.d.ts +16 -0
  130. package/dist/src/core/utils/numbers.d.ts +1 -1
  131. package/dist/src/core/utils/span.d.ts +2 -4
  132. package/dist/src/core/utils/tokens.d.ts +15 -0
  133. package/dist/src/core/utils/validate.d.ts +103 -0
  134. package/dist/src/index.d.ts +13 -9
  135. package/dist/src/services/diagnostics/provider.d.ts +7 -6
  136. package/dist/src/services/index.d.ts +2 -1
  137. package/dist/src/services/monarch.d.ts +4 -3
  138. package/dist/src/services/suggestions/crossFile.d.ts +6 -0
  139. package/dist/src/services/suggestions/provider.d.ts +4 -1
  140. package/dist/src/services/suggestions/recordRowSnippet.d.ts +2 -1
  141. package/dist/src/services/suggestions/use.d.ts +5 -0
  142. package/dist/src/services/suggestions/utils/index.d.ts +10 -0
  143. package/dist/src/services/suggestions/utils/useMerger.d.ts +29 -0
  144. package/dist/src/services/types.d.ts +4 -0
  145. package/dist/src/services/utils.d.ts +4 -1
  146. package/package.json +4 -3
  147. package/dist/src/core/analyzer/analyzer.d.ts +0 -10
  148. package/dist/src/core/analyzer/binder/binder.d.ts +0 -10
  149. package/dist/src/core/analyzer/binder/elementBinder/checks.d.ts +0 -13
  150. package/dist/src/core/analyzer/binder/elementBinder/custom.d.ts +0 -16
  151. package/dist/src/core/analyzer/binder/elementBinder/diagramView.d.ts +0 -20
  152. package/dist/src/core/analyzer/binder/elementBinder/enum.d.ts +0 -16
  153. package/dist/src/core/analyzer/binder/elementBinder/indexes.d.ts +0 -17
  154. package/dist/src/core/analyzer/binder/elementBinder/note.d.ts +0 -16
  155. package/dist/src/core/analyzer/binder/elementBinder/project.d.ts +0 -16
  156. package/dist/src/core/analyzer/binder/elementBinder/records.d.ts +0 -22
  157. package/dist/src/core/analyzer/binder/elementBinder/ref.d.ts +0 -17
  158. package/dist/src/core/analyzer/binder/elementBinder/table.d.ts +0 -21
  159. package/dist/src/core/analyzer/binder/elementBinder/tableGroup.d.ts +0 -17
  160. package/dist/src/core/analyzer/binder/elementBinder/tablePartial.d.ts +0 -19
  161. package/dist/src/core/analyzer/binder/types.d.ts +0 -4
  162. package/dist/src/core/analyzer/binder/utils.d.ts +0 -33
  163. package/dist/src/core/analyzer/validator/elementValidators/checks.d.ts +0 -26
  164. package/dist/src/core/analyzer/validator/elementValidators/custom.d.ts +0 -23
  165. package/dist/src/core/analyzer/validator/elementValidators/diagramView.d.ts +0 -31
  166. package/dist/src/core/analyzer/validator/elementValidators/enum.d.ts +0 -28
  167. package/dist/src/core/analyzer/validator/elementValidators/indexes.d.ts +0 -27
  168. package/dist/src/core/analyzer/validator/elementValidators/note.d.ts +0 -25
  169. package/dist/src/core/analyzer/validator/elementValidators/project.d.ts +0 -24
  170. package/dist/src/core/analyzer/validator/elementValidators/records.d.ts +0 -29
  171. package/dist/src/core/analyzer/validator/elementValidators/ref.d.ts +0 -26
  172. package/dist/src/core/analyzer/validator/elementValidators/table.d.ts +0 -28
  173. package/dist/src/core/analyzer/validator/elementValidators/tableGroup.d.ts +0 -27
  174. package/dist/src/core/analyzer/validator/elementValidators/tablePartial.d.ts +0 -28
  175. package/dist/src/core/analyzer/validator/types.d.ts +0 -7
  176. package/dist/src/core/analyzer/validator/utils.d.ts +0 -65
  177. package/dist/src/core/analyzer/validator/validator.d.ts +0 -10
  178. package/dist/src/core/interpreter/elementInterpreter/diagramView.d.ts +0 -13
  179. package/dist/src/core/interpreter/elementInterpreter/enum.d.ts +0 -12
  180. package/dist/src/core/interpreter/elementInterpreter/project.d.ts +0 -12
  181. package/dist/src/core/interpreter/elementInterpreter/ref.d.ts +0 -14
  182. package/dist/src/core/interpreter/elementInterpreter/sticky_note.d.ts +0 -14
  183. package/dist/src/core/interpreter/elementInterpreter/table.d.ts +0 -22
  184. package/dist/src/core/interpreter/elementInterpreter/tableGroup.d.ts +0 -15
  185. package/dist/src/core/interpreter/elementInterpreter/tablePartial.d.ts +0 -19
  186. package/dist/src/core/interpreter/interpreter.d.ts +0 -10
  187. package/dist/src/core/interpreter/records/index.d.ts +0 -10
  188. package/dist/src/core/interpreter/records/utils/constraints/fk.d.ts +0 -3
  189. package/dist/src/core/interpreter/records/utils/constraints/helper.d.ts +0 -11
  190. package/dist/src/core/interpreter/records/utils/constraints/pk.d.ts +0 -3
  191. package/dist/src/core/interpreter/records/utils/constraints/unique.d.ts +0 -3
  192. package/dist/src/core/interpreter/types.d.ts +0 -47
  193. package/dist/src/core/interpreter/utils.d.ts +0 -37
  194. package/dist/src/core/types/symbol/symbolIndex.d.ts +0 -33
  195. package/dist/src/core/types/symbol/symbolTable.d.ts +0 -12
  196. package/dist/src/core/types/symbol/utils.d.ts +0 -4
  197. package/dist/src/core/utils/array.d.ts +0 -1
  198. package/dist/src/core/utils/enum.d.ts +0 -1
  199. package/dist/src/services/suggestions/utils.d.ts +0 -34
  200. /package/dist/src/core/{interpreter → global_modules}/records/utils/constraints/index.d.ts +0 -0
  201. /package/dist/src/core/{interpreter → global_modules}/records/utils/data/index.d.ts +0 -0
  202. /package/dist/src/core/{interpreter → global_modules}/records/utils/index.d.ts +0 -0
@@ -1,72 +1,112 @@
1
- import { ProgramNode } from '../core/types/nodes';
2
- import { default as Report } from '../core/types/report';
3
- import { Database } from '../core/types/schemaJson';
4
- import { SyntaxToken } from '../core/types/tokens';
1
+ import { Filepath } from '../core/types/filepath';
2
+ import { SyntaxNode, SyntaxNodeIdGenerator } from '../core/types/nodes';
3
+ import { NodeSymbolIdGenerator, SymbolFactory } from '../core/types/symbol';
5
4
  import { DBMLCompletionItemProvider, DBMLDefinitionProvider, DBMLDiagnosticsProvider, DBMLReferencesProvider } from '../services/index';
6
- import { DiagramViewBlock, DiagramViewSyncOperation, TableNameInput, TextEdit } from './queries/transform';
5
+ import { DbmlProjectLayout } from './projectLayout';
6
+ import { DiagramViewBlock, findDiagramViewBlocks } from './queries/transform';
7
7
  import { addDoubleQuoteIfNeeded, escapeString, formatRecordValue, isValidIdentifier, splitQualifiedIdentifier, unescapeString } from './queries/utils';
8
- export { ScopeKind, } from './types';
9
- export type { TextEdit, TableNameInput, DiagramViewSyncOperation, DiagramViewBlock, };
10
- export { splitQualifiedIdentifier, unescapeString, escapeString, formatRecordValue, isValidIdentifier, addDoubleQuoteIfNeeded, };
8
+ export { ScopeKind } from './types';
9
+ export type { DiagramViewBlock, TableNameInput, TextEdit } from './queries/transform';
10
+ export { addDoubleQuoteIfNeeded, escapeString, formatRecordValue, isValidIdentifier, splitQualifiedIdentifier, unescapeString, findDiagramViewBlocks, };
11
11
  export default class Compiler {
12
- private source;
13
- private cache;
14
- private nodeIdGenerator;
15
- private symbolIdGenerator;
16
- setSource(source: string): void;
17
- private query;
18
- private interpret;
19
- renameTable(oldName: TableNameInput, newName: TableNameInput): string;
20
- syncDiagramView(operations: DiagramViewSyncOperation[], blocks?: DiagramViewBlock[]): {
12
+ readonly nodeIdGenerator: SyntaxNodeIdGenerator;
13
+ readonly symbolIdGenerator: NodeSymbolIdGenerator;
14
+ readonly symbolFactory: SymbolFactory;
15
+ layout: DbmlProjectLayout;
16
+ constructor(layout?: DbmlProjectLayout);
17
+ getSource(filepath: Filepath): string | undefined;
18
+ private sourceSnapshot;
19
+ private cleanStaleLocalCache;
20
+ private entrypointsSnapshot;
21
+ private cleanStaleGlobalCache;
22
+ private globalCache;
23
+ private globalQuery;
24
+ private localCache;
25
+ private localQuery;
26
+ parseFile: (filepath: Filepath) => import('../core/types/report').default<import('./queries/pipeline/parse').FileParseIndex>;
27
+ parseProject: () => Map<string, import('../core/types/report').default<import('./queries/pipeline/parse').FileParseIndex>>;
28
+ validateNode: (node: SyntaxNode) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<void>;
29
+ validateFile: (filepath: Filepath) => import('../core/types/report').default<void>;
30
+ nodeFullname: (node: SyntaxNode) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<string[] | undefined>;
31
+ nodeAlias: (node: SyntaxNode) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<string | undefined>;
32
+ nodeSettings: (node: SyntaxNode) => import('../core/types/report').default<import('../core/utils/validate').Settings> | import('../core/types/report').default<typeof import('..').UNHANDLED>;
33
+ canonicalName: (filepath: Filepath, symbol: import('../core/types/symbol').NodeSymbol) => import('../core/types/report').default<import('./queries/canonicalName').CanonicalName | undefined>;
34
+ bindNode: (node: SyntaxNode) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<void>;
35
+ bindFile: (filepath: Filepath) => import('../core/types/report').default<void>;
36
+ bindProject: () => Map<string, import('../core/types/report').default<void>>;
37
+ interpretSymbol: (symbol: import('../core/types/symbol').NodeSymbol, filepath: Filepath) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<import('..').SchemaElement | import('..').SchemaElement[] | undefined>;
38
+ interpretMetadata: (metadata: import('../core/types/symbol').NodeMetadata, filepath: Filepath) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<import('..').SchemaElement | import('..').SchemaElement[] | undefined>;
39
+ interpretFile: (filepath: Filepath) => import('../core/types/report').default<Readonly<import('..').Database> | undefined>;
40
+ interpretProject: () => import('../core/types/report').default<import('..').MasterDatabase>;
41
+ nodeSymbol: (node: SyntaxNode) => import('../core/types/report').default<import('../core/types/symbol').NodeSymbol> | import('../core/types/report').default<typeof import('..').UNHANDLED>;
42
+ nodeMetadata: (node: SyntaxNode) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<import('../core/types/symbol').NodeMetadata>;
43
+ symbolMembers: (symbol: import('../core/types/symbol').NodeSymbol) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<import('../core/types/symbol').NodeSymbol[]>;
44
+ lookupMembers: (symbolOrNode: import('../core/types/symbol').NodeSymbol | SyntaxNode, targetKinds: import('../core/types/symbol').SymbolKind | import('../core/types/symbol').SymbolKind[], targetName: string) => import('../core/types/symbol').NodeSymbol | undefined;
45
+ nodeReferee: (node: SyntaxNode) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<import('../core/types/symbol').NodeSymbol | undefined>;
46
+ resolutionIndex: () => import('./queries/resolutionIndex').ResolutionIndex;
47
+ symbolReferences: (symbol: import('../core/types/symbol').NodeSymbol) => SyntaxNode[];
48
+ symbolParent: (symbol: import('../core/types/symbol').NodeSymbol) => import('../core/types/symbol').NodeSymbol[];
49
+ symbolMetadata: (symbol: import('../core/types/symbol').NodeSymbol) => import('../core/types/symbol').NodeMetadata[];
50
+ symbolAliases: (symbol: import('../core/types/symbol').NodeSymbol) => import('../core/types/report').default<import('../core/types/symbol').AliasSymbol[]>;
51
+ symbolUses: (symbol: import('../core/types/symbol').NodeSymbol) => import('../core/types/report').default<import('../core/types/symbol').UseSymbol[]>;
52
+ fileDependencies: (filepath: Filepath) => Filepath[];
53
+ reachableFiles: (entry?: Filepath | undefined) => Filepath[];
54
+ usableMembers: (symbolOrFilepath: Filepath | import('../core/types/symbol').ProgramSymbol | import('../core/types/symbol').SchemaSymbol) => import('../core/types/report').default<{
55
+ nonSchemaMembers: import('../core/types/symbol').NodeSymbol[];
56
+ schemaMembers: import('../core/types/symbol').SchemaSymbol[];
57
+ reuses: {
58
+ selective: import('../core/types/nodes').UseSpecifierNode[];
59
+ wildcard: {
60
+ importPath: Filepath;
61
+ node: import('../core/types/nodes').WildcardNode;
62
+ }[];
63
+ };
64
+ uses: {
65
+ selective: import('../core/types/nodes').UseSpecifierNode[];
66
+ wildcard: {
67
+ importPath: Filepath;
68
+ node: import('../core/types/nodes').WildcardNode;
69
+ }[];
70
+ };
71
+ }>;
72
+ nodeAtPosition: (filepath: Filepath, offset: number) => SyntaxNode | import('..').SyntaxToken | undefined;
73
+ renameTable: (filepath: Filepath, oldName: import('.').TableNameInput, newName: import('.').TableNameInput) => Map<string, string>;
74
+ syncDiagramView: (filepath: Filepath, operations: import('..').DiagramViewSyncOperation[], blocks?: DiagramViewBlock[] | undefined) => {
21
75
  newDbml: string;
22
- edits: TextEdit[];
76
+ edits: import('.').TextEdit[];
23
77
  };
24
- findDiagramViewBlocks(): DiagramViewBlock[];
25
- applyTextEdits(edits: TextEdit[]): string;
78
+ findDiagramViewBlocks(filepath: Filepath): DiagramViewBlock[];
26
79
  readonly token: {
27
- invalidStream: () => readonly SyntaxToken[];
28
- flatStream: () => readonly SyntaxToken[];
80
+ invalidStream: (filepath: Filepath) => readonly import('..').SyntaxToken[];
81
+ flatStream: (filepath: Filepath) => readonly import('..').SyntaxToken[];
29
82
  };
30
83
  readonly parse: {
31
- source: () => Readonly<string>;
32
- _: () => Report<{
33
- ast: ProgramNode;
34
- tokens: SyntaxToken[];
35
- rawDb?: Database;
36
- }>;
37
- ast: () => Readonly<ProgramNode>;
38
- errors: () => readonly Readonly<import('..').CompileError>[];
39
- warnings: () => readonly Readonly<import('../core/types').CompileWarning>[];
40
- tokens: () => Readonly<SyntaxToken>[];
41
- rawDb: () => Readonly<Database> | undefined;
42
- publicSymbolTable: () => Readonly<import('../core/types/symbol/symbolTable').default>;
84
+ source: (filepath: Filepath) => string;
85
+ ast: (filepath?: Filepath) => Readonly<import('../core/types/nodes').ProgramNode>;
86
+ errors: (filepath?: Filepath) => readonly Readonly<import('..').CompileError>[];
87
+ warnings: (filepath?: Filepath) => readonly Readonly<import('../core/types').CompileWarning>[];
88
+ tokens: (filepath?: Filepath) => readonly Readonly<import('..').SyntaxToken>[];
89
+ rawDb: (filepath?: Filepath) => Readonly<import('..').Database> | undefined;
90
+ publicSymbolTable: (filepath?: Filepath) => readonly Readonly<import('../core/types/symbol').NodeSymbol>[] | undefined;
43
91
  };
44
92
  readonly container: {
45
- stack: (offset: number) => readonly Readonly<import('../core/types/nodes').SyntaxNode>[];
46
- token: (offset: number) => {
47
- token: SyntaxToken;
93
+ stack: (filepath: Filepath, offset: number) => readonly Readonly<SyntaxNode>[];
94
+ token: (filepath: Filepath, offset: number) => {
95
+ token: import('..').SyntaxToken;
48
96
  index: number;
49
97
  } | {
50
98
  token: undefined;
51
99
  index: undefined;
52
100
  };
53
- element: (offset: number) => Readonly<ProgramNode | import('../core/types/nodes').ElementDeclarationNode>;
54
- scope: (offset: number) => Readonly<import('../core/types/symbol/symbolTable').default> | undefined;
55
- scopeKind: (offset: number) => import('./types').ScopeKind;
101
+ element: (filepath: Filepath, offset: number) => Readonly<import('../core/types/nodes').ElementDeclarationNode | import('../core/types/nodes').ProgramNode>;
102
+ scope: (filepath: Filepath, offset: number) => import('../core/types/symbol').NodeSymbol[] | undefined;
103
+ scopeKind: (filepath: Filepath, offset: number) => import('./types').ScopeKind;
56
104
  };
57
- readonly symbol: {
58
- ofName: (nameStack: string[], owner: ProgramNode | import('../core/types/nodes').ElementDeclarationNode) => {
59
- symbol: import('../core/types/symbol/symbols').NodeSymbol;
60
- kind: import('../core/types').SymbolKind;
61
- name: string;
62
- }[];
63
- members: (ownerSymbol: import('../core/types/symbol/symbols').NodeSymbol) => {
64
- symbol: import('../core/types/symbol/symbols').NodeSymbol;
65
- name: string;
66
- kind: import('../core/types').SymbolKind;
67
- }[];
68
- };
69
- initMonacoServices(): {
105
+ initMonacoServices(options?: {
106
+ autocompletion?: {
107
+ triggerCharacters?: string[];
108
+ };
109
+ }): {
70
110
  definitionProvider: DBMLDefinitionProvider;
71
111
  referenceProvider: DBMLReferencesProvider;
72
112
  autocompletionProvider: DBMLCompletionItemProvider;
@@ -0,0 +1 @@
1
+ export * from './layout';
@@ -0,0 +1,23 @@
1
+ import { Filepath } from '../../core/types/filepath';
2
+ export interface DbmlProjectLayout {
3
+ getSource(filePath: Filepath): string | undefined;
4
+ exists(filePath: Filepath): boolean;
5
+ isFile(filePath: Filepath): boolean;
6
+ isDirectory(filePath: Filepath): boolean;
7
+ listDirectory(dirPath?: Filepath): Filepath[];
8
+ getEntrypoints(): Filepath[];
9
+ }
10
+ export declare class MemoryProjectLayout implements DbmlProjectLayout {
11
+ private files;
12
+ constructor(files?: Map<string, string> | Record<string, string>);
13
+ setSource(filePath: Filepath, content: string): void;
14
+ getSource(filePath: Filepath): string | undefined;
15
+ deleteSource(filePath: Filepath): void;
16
+ clearSource(): void;
17
+ exists(filePath: Filepath): boolean;
18
+ isFile(filePath: Filepath): boolean;
19
+ isDirectory(filePath: Filepath): boolean;
20
+ listDirectory(dirPath?: Filepath): Filepath[];
21
+ getEntrypoints(): Filepath[];
22
+ clone(): MemoryProjectLayout;
23
+ }
@@ -0,0 +1,9 @@
1
+ import { default as Report } from '../../core/types/report';
2
+ import { Filepath } from '../../core/types/filepath';
3
+ import { NodeSymbol } from '../../core/types/symbol';
4
+ import { default as Compiler } from '../index';
5
+ export interface CanonicalName {
6
+ schema: string;
7
+ name: string;
8
+ }
9
+ export declare function canonicalName(this: Compiler, filepath: Filepath, symbol: NodeSymbol): Report<CanonicalName | undefined>;
@@ -1,3 +1,4 @@
1
+ import { Filepath } from '../../../core/types/filepath';
1
2
  import { ElementDeclarationNode, ProgramNode } from '../../../core/types/nodes';
2
3
  import { default as Compiler } from '../../index';
3
- export declare function containerElement(this: Compiler, offset: number): Readonly<ElementDeclarationNode | ProgramNode>;
4
+ export declare function containerElement(this: Compiler, filepath: Filepath, offset: number): Readonly<ElementDeclarationNode | ProgramNode>;
@@ -1,5 +1,5 @@
1
- export { containerStack, } from './stack';
2
- export { containerToken, } from './token';
3
- export { containerElement, } from './element';
4
- export { containerScope, } from './scope';
5
- export { containerScopeKind, } from './scopeKind';
1
+ export { containerStack } from './stack';
2
+ export { containerToken } from './token';
3
+ export { containerElement } from './element';
4
+ export { containerScope } from './scope';
5
+ export { containerScopeKind } from './scopeKind';
@@ -1,3 +1,4 @@
1
- import { default as SymbolTable } from '../../../core/types/symbol/symbolTable';
1
+ import { Filepath } from '../../../core/types/filepath';
2
+ import { NodeSymbol } from '../../../core/types/symbol';
2
3
  import { default as Compiler } from '../../index';
3
- export declare function containerScope(this: Compiler, offset: number): Readonly<SymbolTable> | undefined;
4
+ export declare function containerScope(this: Compiler, filepath: Filepath, offset: number): NodeSymbol[] | undefined;
@@ -1,3 +1,4 @@
1
+ import { Filepath } from '../../../core/types/filepath';
1
2
  import { default as Compiler } from '../../index';
2
3
  import { ScopeKind } from '../../types';
3
- export declare function containerScopeKind(this: Compiler, offset: number): ScopeKind;
4
+ export declare function containerScopeKind(this: Compiler, filepath: Filepath, offset: number): ScopeKind;
@@ -1,3 +1,4 @@
1
+ import { Filepath } from '../../../core/types/filepath';
1
2
  import { SyntaxNode } from '../../../core/types/nodes';
2
3
  import { default as Compiler } from '../../index';
3
- export declare function containerStack(this: Compiler, offset: number): readonly Readonly<SyntaxNode>[];
4
+ export declare function containerStack(this: Compiler, filepath: Filepath, offset: number): readonly Readonly<SyntaxNode>[];
@@ -1,6 +1,7 @@
1
+ import { Filepath } from '../../../core/types';
1
2
  import { SyntaxToken } from '../../../core/types/tokens';
2
3
  import { default as Compiler } from '../../index';
3
- export declare function containerToken(this: Compiler, offset: number): {
4
+ export declare function containerToken(this: Compiler, filepath: Filepath, offset: number): {
4
5
  token: SyntaxToken;
5
6
  index: number;
6
7
  } | {
@@ -0,0 +1,3 @@
1
+ import { default as Compiler } from '../../index';
2
+ import { Filepath } from '../../../core/types/filepath';
3
+ export declare function fileDependencies(this: Compiler, filepath: Filepath): Filepath[];
@@ -0,0 +1,4 @@
1
+ import { default as Compiler } from '../../index';
2
+ import { Filepath } from '../../../core/types/filepath';
3
+ export declare function walkDependencies(compiler: Compiler, roots: Filepath[]): Filepath[];
4
+ export declare function reachableFiles(this: Compiler, entry?: Filepath): Filepath[];
@@ -0,0 +1,34 @@
1
+ import { default as Compiler } from '../..';
2
+ import { Filepath } from '../../../core/types/filepath';
3
+ import { ElementDeclarationNode, UseSpecifierNode, WildcardNode } from '../../../core/types/nodes';
4
+ import { default as Report } from '../../../core/types/report';
5
+ import { NodeSymbol, SchemaSymbol, ProgramSymbol } from '../../../core/types/symbol';
6
+ type UsableResult = {
7
+ nonSchemaMembers: NodeSymbol[];
8
+ schemaMembers: SchemaSymbol[];
9
+ reuses: {
10
+ selective: UseSpecifierNode[];
11
+ wildcard: {
12
+ importPath: Filepath;
13
+ node: WildcardNode;
14
+ }[];
15
+ };
16
+ uses: {
17
+ selective: UseSpecifierNode[];
18
+ wildcard: {
19
+ importPath: Filepath;
20
+ node: WildcardNode;
21
+ }[];
22
+ };
23
+ };
24
+ export declare function usableMembers(this: Compiler, symbolOrFilepath: SchemaSymbol | ProgramSymbol | Filepath): Report<UsableResult>;
25
+ export type SchemaMembership = {
26
+ kind: 'direct';
27
+ } | {
28
+ kind: 'child';
29
+ schemaName: string;
30
+ } | {
31
+ kind: 'none';
32
+ };
33
+ export declare function schemaMembership(compiler: Compiler, schema: SchemaSymbol, element: ElementDeclarationNode | UseSpecifierNode): SchemaMembership;
34
+ export {};
@@ -1,12 +1,13 @@
1
+ import { default as Compiler } from '../..';
2
+ import { Database } from '../../../core/types';
1
3
  import { CompileError, CompileWarning } from '../../../core/types/errors';
4
+ import { Filepath } from '../../../core/types/filepath';
2
5
  import { ProgramNode } from '../../../core/types/nodes';
3
- import { Database } from '../../../core/types/schemaJson';
4
- import { default as SymbolTable } from '../../../core/types/symbol/symbolTable';
6
+ import { NodeSymbol } from '../../../core/types/symbol';
5
7
  import { SyntaxToken } from '../../../core/types/tokens';
6
- import { default as Compiler } from '../../index';
7
- export declare function ast(this: Compiler): Readonly<ProgramNode>;
8
- export declare function errors(this: Compiler): readonly Readonly<CompileError>[];
9
- export declare function warnings(this: Compiler): readonly Readonly<CompileWarning>[];
10
- export declare function tokens(this: Compiler): Readonly<SyntaxToken>[];
11
- export declare function rawDb(this: Compiler): Readonly<Database> | undefined;
12
- export declare function publicSymbolTable(this: Compiler): Readonly<SymbolTable>;
8
+ export declare function ast(this: Compiler, filepath: Filepath): Readonly<ProgramNode>;
9
+ export declare function errors(this: Compiler, filepath: Filepath): readonly Readonly<CompileError>[];
10
+ export declare function warnings(this: Compiler, filepath: Filepath): readonly Readonly<CompileWarning>[];
11
+ export declare function tokens(this: Compiler, filepath: Filepath): readonly Readonly<SyntaxToken>[];
12
+ export declare function rawDb(this: Compiler, filepath: Filepath): Readonly<Database> | undefined;
13
+ export declare function publicSymbolTable(this: Compiler, filepath: Filepath): readonly Readonly<NodeSymbol>[] | undefined;
@@ -1,17 +1,8 @@
1
1
  import { ElementDeclarationNode, ProgramNode } from '../../../core/types/nodes';
2
- import { SymbolKind } from '../../../core/types/symbol';
3
- import { NodeSymbol } from '../../../core/types/symbol/symbols';
2
+ import { NodeSymbol, SymbolKind } from '../../../core/types/symbol';
4
3
  import { default as Compiler } from '../../index';
5
- export declare function symbolMembers(this: Compiler, ownerSymbol: NodeSymbol): {
6
- symbol: NodeSymbol;
7
- name: string;
8
- kind: SymbolKind;
9
- }[];
10
4
  export declare function symbolOfName(this: Compiler, nameStack: string[], owner: ElementDeclarationNode | ProgramNode): {
11
5
  symbol: NodeSymbol;
12
6
  kind: SymbolKind;
13
7
  name: string;
14
8
  }[];
15
- export declare function symbolOfNameToKey(nameStack: string[], owner: {
16
- id: number;
17
- }): string;
@@ -1,4 +1,5 @@
1
+ import { Filepath } from '../../../core/types';
1
2
  import { SyntaxToken } from '../../../core/types/tokens';
2
3
  import { default as Compiler } from '../../index';
3
- export declare function flatStream(this: Compiler): readonly SyntaxToken[];
4
- export declare function invalidStream(this: Compiler): readonly SyntaxToken[];
4
+ export declare function flatStream(this: Compiler, filepath: Filepath): readonly SyntaxToken[];
5
+ export declare function invalidStream(this: Compiler, filepath: Filepath): readonly SyntaxToken[];
@@ -0,0 +1,5 @@
1
+ import { Filepath } from '../../core/types/filepath';
2
+ import { SyntaxNode } from '../../core/types/nodes';
3
+ import { SyntaxToken } from '../../core/types/tokens';
4
+ import { default as Compiler } from '../index';
5
+ export declare function nodeAtPosition(this: Compiler, filepath: Filepath, offset: number): SyntaxNode | SyntaxToken | undefined;
@@ -0,0 +1,5 @@
1
+ import { Filepath } from '../../../core/types/filepath';
2
+ import { default as Report } from '../../../core/types/report';
3
+ import { default as Compiler } from '../../index';
4
+ export declare function bindFile(this: Compiler, filepath: Filepath): Report<void>;
5
+ export declare function bindProject(this: Compiler): Map<string, Report<void>>;
@@ -0,0 +1,2 @@
1
+ export { parseFile } from './parse';
2
+ export { interpretFile } from './interpret';
@@ -0,0 +1,6 @@
1
+ import { default as Compiler } from '../..';
2
+ import { Database, MasterDatabase } from '../../../core/types/schemaJson';
3
+ import { Filepath } from '../../../core/types/filepath';
4
+ import { default as Report } from '../../../core/types/report';
5
+ export declare function interpretFile(this: Compiler, filepath: Filepath): Report<Readonly<Database> | undefined>;
6
+ export declare function interpretProject(this: Compiler): Report<MasterDatabase>;
@@ -0,0 +1,12 @@
1
+ import { Filepath } from '../../../core/types/filepath';
2
+ import { ProgramNode } from '../../../core/types/nodes';
3
+ import { default as Report } from '../../../core/types/report';
4
+ import { SyntaxToken } from '../../../core/types/tokens';
5
+ import { default as Compiler } from '../../index';
6
+ export type FileParseIndex = {
7
+ readonly path: Readonly<Filepath>;
8
+ readonly ast: Readonly<ProgramNode>;
9
+ readonly tokens: readonly Readonly<SyntaxToken>[];
10
+ };
11
+ export declare function parseFile(this: Compiler, filepath: Filepath): Report<FileParseIndex>;
12
+ export declare function parseProject(this: Compiler): Map<string, Report<FileParseIndex>>;
@@ -0,0 +1,4 @@
1
+ import { Filepath } from '../../../core/types/filepath';
2
+ import { default as Report } from '../../../core/types/report';
3
+ import { default as Compiler } from '../../index';
4
+ export declare function validateFile(this: Compiler, filepath: Filepath): Report<void>;
@@ -0,0 +1,13 @@
1
+ import { NodeMetadata } from '../../core/types/symbol/metadata';
2
+ import { SyntaxNode } from '../../core/types/nodes';
3
+ import { InternedNodeSymbol, NodeSymbol } from '../../core/types/symbol';
4
+ import { default as Compiler } from '../index';
5
+ export interface ResolutionIndex {
6
+ references: Map<InternedNodeSymbol, SyntaxNode[]>;
7
+ metadata: Map<InternedNodeSymbol, NodeMetadata[]>;
8
+ parents: Map<InternedNodeSymbol, NodeSymbol[]>;
9
+ }
10
+ export declare function resolutionIndex(this: Compiler): ResolutionIndex;
11
+ export declare function symbolParent(this: Compiler, symbol: NodeSymbol): NodeSymbol[];
12
+ export declare function symbolReferences(this: Compiler, symbol: NodeSymbol): SyntaxNode[];
13
+ export declare function symbolMetadata(this: Compiler, symbol: NodeSymbol): NodeMetadata[];
@@ -0,0 +1,4 @@
1
+ import { SyntaxNode } from '../../../core/types/nodes';
2
+ import { NodeSymbol, SymbolKind } from '../../../core/types/symbol';
3
+ import { default as Compiler } from '../../index';
4
+ export declare function lookupMembers(this: Compiler, symbolOrNode: NodeSymbol | SyntaxNode, targetKinds: SymbolKind | SymbolKind[], targetName: string): NodeSymbol | undefined;
@@ -0,0 +1,4 @@
1
+ import { default as Report } from '../../../core/types/report';
2
+ import { AliasSymbol, NodeSymbol } from '../../../core/types/symbol';
3
+ import { default as Compiler } from '../../index';
4
+ export declare function symbolAliases(this: Compiler, symbol: NodeSymbol): Report<AliasSymbol[]>;
@@ -0,0 +1,4 @@
1
+ import { default as Report } from '../../../core/types/report';
2
+ import { NodeSymbol, UseSymbol } from '../../../core/types/symbol';
3
+ import { default as Compiler } from '../../index';
4
+ export declare function symbolUses(this: Compiler, symbol: NodeSymbol): Report<UseSymbol[]>;
@@ -1,4 +1,4 @@
1
- export { renameTable, } from './renameTable';
2
- export { applyTextEdits, type TextEdit, } from './applyTextEdits';
3
- export { type TableNameInput, } from './utils';
1
+ export { renameTable } from './renameTable';
4
2
  export { syncDiagramView, findDiagramViewBlocks, type DiagramViewSyncOperation, type DiagramViewBlock, } from './syncDiagramView';
3
+ export { applyTextEdits, type TextEdit } from './applyTextEdits';
4
+ export { type TableNameInput } from './utils';
@@ -1,23 +1,26 @@
1
+ import { Filepath } from '../../../core/types/filepath';
1
2
  import { default as Compiler } from '../../index';
2
3
  import { TableNameInput } from './utils';
3
4
  /**
4
- * Renames a table in the DBML source code.
5
+ * Renames a table across every file in the project layout.
5
6
  *
6
- * @param oldName - The current table name as string or object (schema defaults to 'public')
7
- * @param newName - The new table name as string or object (schema defaults to 'public')
8
- * @returns The updated DBML source code with the table renamed
7
+ * Resolution starts in `filepath`'s scope. Two paths:
9
8
  *
10
- * @example
11
- * // String format
12
- * compiler.renameTable('users', 'customers');
13
- * compiler.renameTable('public.users', 'auth.customers');
9
+ * 1. **Alias rename.** `filepath` introduces a use specifier with an alias
10
+ * whose name matches `oldName` (e.g. `use { table users as u }` and
11
+ * `oldName === 'u'`). Only `filepath` is rewritten - the alias token is
12
+ * replaced and every reference to the alias inside `filepath` is updated.
13
+ * The original declaration in another file is left alone.
14
14
  *
15
- * @example
16
- * // Object format
17
- * compiler.renameTable({ table: 'users' }, { table: 'customers' });
18
- * compiler.renameTable(
19
- * { schema: 'auth', table: 'users' },
20
- * { schema: 'auth', table: 'customers' }
21
- * );
15
+ * 2. **Real-declaration rename.** Otherwise the resolved symbol is the real
16
+ * table (or a `UseSymbol` that imports the source name without an alias).
17
+ * Both the declaring file and every file that imports the table by its
18
+ * direct name are rewritten - declaration name, in-scope refs, use
19
+ * specifier source-name tokens, and refs that flow through unaliased
20
+ * imports.
21
+ *
22
+ * Returns a map of absolute file paths to new source content, containing
23
+ * only the files that were actually changed by the rename. An empty map
24
+ * indicates a no-op (lookup miss, name collision, or alias rename attempt).
22
25
  */
23
- export declare function renameTable(this: Compiler, oldName: TableNameInput, newName: TableNameInput): string;
26
+ export declare function renameTable(this: Compiler, filepath: Filepath, oldName: TableNameInput, newName: TableNameInput): Map<string, string>;
@@ -1,3 +1,5 @@
1
+ import { Filepath } from '../../../core/types/filepath';
2
+ import { default as Compiler } from '../../index';
1
3
  import { TextEdit } from './applyTextEdits';
2
4
  export interface DiagramViewSyncOperation {
3
5
  operation: 'create' | 'update' | 'delete';
@@ -24,16 +26,27 @@ export interface DiagramViewBlock {
24
26
  startIndex: number;
25
27
  endIndex: number;
26
28
  }
29
+ /**
30
+ * Returns the start/end byte positions of every DiagramView block in `source`.
31
+ *
32
+ * Returns an empty array on any lex or parse error - callers cannot
33
+ * distinguish "no DiagramView blocks present" from "malformed DBML" based on
34
+ * the return value alone. If you need to detect malformed input, lex/parse
35
+ * the source separately and check for errors before calling this function.
36
+ */
27
37
  export declare function findDiagramViewBlocks(source: string): DiagramViewBlock[];
28
38
  /**
29
- * Synchronizes DiagramView blocks in DBML source code.
39
+ * Synchronizes DiagramView blocks in the DBML source at `filepath`.
30
40
  *
31
- * @param dbml - The original DBML source code
32
- * @param operations - Array of operations to apply (create, update, delete)
33
- * @param blocks - Optional pre-parsed blocks from findDiagramViewBlocks. If not provided, parses internally.
34
- * @returns Object containing the new DBML source code and the text edits applied
41
+ * @param filepath The file whose source should be rewritten. Source is
42
+ * read from the compiler's project layout, which makes the
43
+ * query multifile-aware.
44
+ * @param operations Array of operations to apply (create, update, delete).
45
+ * @param blocks Optional pre-parsed blocks from findDiagramViewBlocks. If
46
+ * not provided, parses internally.
47
+ * @returns Object containing the new DBML source code and the text edits applied.
35
48
  */
36
- export declare function syncDiagramView(dbml: string, operations: DiagramViewSyncOperation[], blocks?: DiagramViewBlock[]): {
49
+ export declare function syncDiagramView(this: Compiler, filepath: Filepath, operations: DiagramViewSyncOperation[], blocks?: DiagramViewBlock[]): {
37
50
  newDbml: string;
38
51
  edits: TextEdit[];
39
52
  };
@@ -1,5 +1,6 @@
1
- import { default as SymbolTable } from '../../../core/types/symbol/symbolTable';
2
- import { TableSymbol } from '../../../core/types/symbol/symbols';
1
+ import { Filepath } from '../../../core/types/filepath';
2
+ import { NodeSymbol } from '../../../core/types/symbol';
3
+ import { default as Compiler } from '../../index';
3
4
  export type TableNameInput = string | {
4
5
  schema?: string;
5
6
  table: string;
@@ -13,9 +14,9 @@ export declare function normalizeTableName(input: TableNameInput): {
13
14
  table: string;
14
15
  };
15
16
  /**
16
- * Looks up a table symbol from the symbol table.
17
+ * Looks up a table symbol by matching its full qualified name.
17
18
  */
18
- export declare function lookupTableSymbol(symbolTable: Readonly<SymbolTable>, schema: string, table: string): TableSymbol | null;
19
+ export declare function lookupTableSymbol(compiler: Compiler, filepath: Filepath, schema: string, table: string): NodeSymbol | null;
19
20
  /**
20
21
  * Removes surrounding double quotes from a string if present.
21
22
  */
@@ -1,3 +1,7 @@
1
+ import { Filepath } from '../../core/types/filepath';
2
+ import { default as Report } from '../../core/types/report';
3
+ import { NodeSymbol } from '../../core/types/symbol';
4
+ import { default as Compiler } from '..';
1
5
  /**
2
6
  * Checks if an identifier is valid (can be used without quotes in DBML).
3
7
  * Valid identifiers must:
@@ -93,3 +97,5 @@ export declare function formatRecordValue(recordValue: {
93
97
  * @returns Array of unquoted identifier components
94
98
  */
95
99
  export declare function splitQualifiedIdentifier(identifier: string): string[];
100
+ export declare function collectTransitiveDependencies(compiler: Compiler, entrypoints: Filepath[]): Filepath[];
101
+ export declare function allVisibleMembers(compiler: Compiler): Report<NodeSymbol[]>;
@@ -2,6 +2,5 @@ import { Filepath } from './core/types/filepath';
2
2
  export declare const KEYWORDS_OF_DEFAULT_SETTING: readonly string[];
3
3
  export declare const DBML_EXT = ".dbml";
4
4
  export declare const NUMERIC_LITERAL_PREFIX: readonly string[];
5
- export declare const DEFAULT_SCHEMA_NAME = "public";
5
+ export declare const DEFAULT_SCHEMA_NAME: "public";
6
6
  export declare const DEFAULT_ENTRY: Filepath;
7
- export declare const ROOT: Filepath;
@@ -0,0 +1,9 @@
1
+ import { default as Compiler } from '../../../compiler';
2
+ import { CompileError } from '../../types/errors';
3
+ import { ElementDeclarationNode } from '../../types/nodes';
4
+ export default class ChecksBinder {
5
+ private compiler;
6
+ private declarationNode;
7
+ constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
8
+ bind(): CompileError[];
9
+ }
@@ -0,0 +1,2 @@
1
+ import { GlobalModule } from '../types';
2
+ export declare const checksModule: GlobalModule;
@@ -0,0 +1,10 @@
1
+ import { default as Compiler } from '../../../compiler/index';
2
+ import { ElementDeclarationNode } from '../../types/nodes';
3
+ import { default as Report } from '../../types/report';
4
+ import { SchemaElement } from '../../types/schemaJson';
5
+ export default class ChecksInterpreter {
6
+ private compiler;
7
+ private declarationNode;
8
+ constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
9
+ interpret(): Report<SchemaElement | SchemaElement[] | undefined>;
10
+ }