@dbml/parse 8.2.4-alpha.2 → 8.2.5

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 (163) hide show
  1. package/LICENSE +0 -0
  2. package/dist/dbml-parse.js +11 -11
  3. package/dist/dbml-parse.mjs +11 -15
  4. package/dist/index.d.ts +0 -0
  5. package/dist/src/compiler/index.d.ts +0 -0
  6. package/dist/src/compiler/projectLayout/index.d.ts +0 -0
  7. package/dist/src/compiler/projectLayout/layout.d.ts +0 -0
  8. package/dist/src/compiler/queries/canonicalName.d.ts +0 -0
  9. package/dist/src/compiler/queries/container/element.d.ts +0 -0
  10. package/dist/src/compiler/queries/container/index.d.ts +0 -0
  11. package/dist/src/compiler/queries/container/scope.d.ts +0 -0
  12. package/dist/src/compiler/queries/container/scopeKind.d.ts +0 -0
  13. package/dist/src/compiler/queries/container/stack.d.ts +0 -0
  14. package/dist/src/compiler/queries/container/token.d.ts +0 -0
  15. package/dist/src/compiler/queries/files/fileDependencies.d.ts +0 -0
  16. package/dist/src/compiler/queries/files/reachableFiles.d.ts +0 -0
  17. package/dist/src/compiler/queries/files/usableMembers.d.ts +0 -0
  18. package/dist/src/compiler/queries/legacy/parse.d.ts +0 -0
  19. package/dist/src/compiler/queries/legacy/symbol.d.ts +0 -0
  20. package/dist/src/compiler/queries/legacy/token.d.ts +0 -0
  21. package/dist/src/compiler/queries/nodeAtPosition.d.ts +0 -0
  22. package/dist/src/compiler/queries/pipeline/bind.d.ts +0 -0
  23. package/dist/src/compiler/queries/pipeline/index.d.ts +0 -0
  24. package/dist/src/compiler/queries/pipeline/interpret.d.ts +0 -0
  25. package/dist/src/compiler/queries/pipeline/parse.d.ts +0 -0
  26. package/dist/src/compiler/queries/pipeline/validate.d.ts +0 -0
  27. package/dist/src/compiler/queries/resolutionIndex.d.ts +0 -0
  28. package/dist/src/compiler/queries/symbol/lookupMembers.d.ts +0 -0
  29. package/dist/src/compiler/queries/symbol/symbolAliases.d.ts +0 -0
  30. package/dist/src/compiler/queries/symbol/symbolUses.d.ts +0 -0
  31. package/dist/src/compiler/queries/transform/applyTextEdits.d.ts +0 -0
  32. package/dist/src/compiler/queries/transform/index.d.ts +0 -0
  33. package/dist/src/compiler/queries/transform/renameTable.d.ts +0 -0
  34. package/dist/src/compiler/queries/transform/syncDiagramView.d.ts +2 -6
  35. package/dist/src/compiler/queries/transform/utils.d.ts +0 -0
  36. package/dist/src/compiler/queries/utils.d.ts +0 -0
  37. package/dist/src/compiler/types.d.ts +0 -0
  38. package/dist/src/constants.d.ts +0 -0
  39. package/dist/src/core/global_modules/checks/bind.d.ts +0 -0
  40. package/dist/src/core/global_modules/checks/index.d.ts +0 -0
  41. package/dist/src/core/global_modules/checks/interpret.d.ts +0 -0
  42. package/dist/src/core/global_modules/diagramView/bind.d.ts +0 -0
  43. package/dist/src/core/global_modules/diagramView/index.d.ts +0 -0
  44. package/dist/src/core/global_modules/diagramView/interpret.d.ts +0 -0
  45. package/dist/src/core/global_modules/enum/bind.d.ts +0 -0
  46. package/dist/src/core/global_modules/enum/index.d.ts +0 -0
  47. package/dist/src/core/global_modules/enum/interpret.d.ts +0 -0
  48. package/dist/src/core/global_modules/index.d.ts +0 -0
  49. package/dist/src/core/global_modules/indexes/bind.d.ts +0 -0
  50. package/dist/src/core/global_modules/indexes/index.d.ts +0 -0
  51. package/dist/src/core/global_modules/indexes/interpret.d.ts +0 -0
  52. package/dist/src/core/global_modules/note/bind.d.ts +0 -0
  53. package/dist/src/core/global_modules/note/index.d.ts +0 -0
  54. package/dist/src/core/global_modules/note/interpret.d.ts +0 -0
  55. package/dist/src/core/global_modules/program/bind.d.ts +0 -0
  56. package/dist/src/core/global_modules/program/index.d.ts +0 -0
  57. package/dist/src/core/global_modules/program/interpret.d.ts +0 -0
  58. package/dist/src/core/global_modules/program/utils.d.ts +0 -0
  59. package/dist/src/core/global_modules/project/bind.d.ts +0 -0
  60. package/dist/src/core/global_modules/project/index.d.ts +0 -0
  61. package/dist/src/core/global_modules/project/interpret.d.ts +0 -0
  62. package/dist/src/core/global_modules/records/bind.d.ts +0 -0
  63. package/dist/src/core/global_modules/records/index.d.ts +0 -0
  64. package/dist/src/core/global_modules/records/interpret.d.ts +0 -0
  65. package/dist/src/core/global_modules/records/utils/constraints/fk.d.ts +0 -0
  66. package/dist/src/core/global_modules/records/utils/constraints/helper.d.ts +0 -0
  67. package/dist/src/core/global_modules/records/utils/constraints/index.d.ts +0 -0
  68. package/dist/src/core/global_modules/records/utils/constraints/pk.d.ts +0 -0
  69. package/dist/src/core/global_modules/records/utils/constraints/unique.d.ts +0 -0
  70. package/dist/src/core/global_modules/records/utils/data/index.d.ts +0 -0
  71. package/dist/src/core/global_modules/records/utils/data/sqlTypes.d.ts +0 -0
  72. package/dist/src/core/global_modules/records/utils/data/values.d.ts +0 -0
  73. package/dist/src/core/global_modules/records/utils/index.d.ts +0 -0
  74. package/dist/src/core/global_modules/ref/bind.d.ts +0 -0
  75. package/dist/src/core/global_modules/ref/index.d.ts +0 -0
  76. package/dist/src/core/global_modules/ref/interpret.d.ts +0 -0
  77. package/dist/src/core/global_modules/schema/index.d.ts +0 -0
  78. package/dist/src/core/global_modules/table/bind.d.ts +0 -0
  79. package/dist/src/core/global_modules/table/index.d.ts +0 -0
  80. package/dist/src/core/global_modules/table/interpret.d.ts +0 -0
  81. package/dist/src/core/global_modules/table/utils.d.ts +0 -0
  82. package/dist/src/core/global_modules/tableGroup/bind.d.ts +0 -0
  83. package/dist/src/core/global_modules/tableGroup/index.d.ts +0 -0
  84. package/dist/src/core/global_modules/tableGroup/interpret.d.ts +0 -0
  85. package/dist/src/core/global_modules/tablePartial/bind.d.ts +0 -0
  86. package/dist/src/core/global_modules/tablePartial/index.d.ts +0 -0
  87. package/dist/src/core/global_modules/tablePartial/interpret.d.ts +0 -0
  88. package/dist/src/core/global_modules/types.d.ts +0 -0
  89. package/dist/src/core/global_modules/use/index.d.ts +0 -0
  90. package/dist/src/core/global_modules/utils.d.ts +0 -0
  91. package/dist/src/core/lexer/lexer.d.ts +0 -0
  92. package/dist/src/core/lexer/utils.d.ts +0 -0
  93. package/dist/src/core/local_modules/checks/index.d.ts +0 -0
  94. package/dist/src/core/local_modules/checks/validate.d.ts +0 -0
  95. package/dist/src/core/local_modules/custom/index.d.ts +0 -0
  96. package/dist/src/core/local_modules/custom/validate.d.ts +0 -0
  97. package/dist/src/core/local_modules/diagramView/index.d.ts +0 -0
  98. package/dist/src/core/local_modules/diagramView/validate.d.ts +0 -0
  99. package/dist/src/core/local_modules/enum/index.d.ts +0 -0
  100. package/dist/src/core/local_modules/enum/validate.d.ts +0 -0
  101. package/dist/src/core/local_modules/index.d.ts +0 -0
  102. package/dist/src/core/local_modules/indexes/index.d.ts +0 -0
  103. package/dist/src/core/local_modules/indexes/validate.d.ts +0 -0
  104. package/dist/src/core/local_modules/note/index.d.ts +0 -0
  105. package/dist/src/core/local_modules/note/validate.d.ts +0 -0
  106. package/dist/src/core/local_modules/program/index.d.ts +0 -0
  107. package/dist/src/core/local_modules/program/validate.d.ts +0 -0
  108. package/dist/src/core/local_modules/project/index.d.ts +0 -0
  109. package/dist/src/core/local_modules/project/validate.d.ts +0 -0
  110. package/dist/src/core/local_modules/records/index.d.ts +0 -0
  111. package/dist/src/core/local_modules/records/validate.d.ts +0 -0
  112. package/dist/src/core/local_modules/ref/index.d.ts +0 -0
  113. package/dist/src/core/local_modules/ref/validate.d.ts +0 -0
  114. package/dist/src/core/local_modules/table/index.d.ts +0 -0
  115. package/dist/src/core/local_modules/table/validate.d.ts +0 -0
  116. package/dist/src/core/local_modules/tableGroup/index.d.ts +0 -0
  117. package/dist/src/core/local_modules/tableGroup/validate.d.ts +0 -0
  118. package/dist/src/core/local_modules/tablePartial/index.d.ts +0 -0
  119. package/dist/src/core/local_modules/tablePartial/validate.d.ts +0 -0
  120. package/dist/src/core/local_modules/types.d.ts +0 -0
  121. package/dist/src/core/local_modules/use/index.d.ts +0 -0
  122. package/dist/src/core/local_modules/use/validate.d.ts +0 -0
  123. package/dist/src/core/parser/contextStack.d.ts +0 -0
  124. package/dist/src/core/parser/factory.d.ts +0 -0
  125. package/dist/src/core/parser/parser.d.ts +0 -0
  126. package/dist/src/core/parser/utils.d.ts +0 -0
  127. package/dist/src/core/types/errors.d.ts +0 -0
  128. package/dist/src/core/types/filepath.d.ts +0 -0
  129. package/dist/src/core/types/index.d.ts +0 -0
  130. package/dist/src/core/types/internable.d.ts +0 -0
  131. package/dist/src/core/types/keywords.d.ts +0 -0
  132. package/dist/src/core/types/module.d.ts +0 -0
  133. package/dist/src/core/types/nodes.d.ts +0 -0
  134. package/dist/src/core/types/position.d.ts +0 -0
  135. package/dist/src/core/types/report.d.ts +0 -0
  136. package/dist/src/core/types/schemaJson.d.ts +0 -0
  137. package/dist/src/core/types/symbol/factory.d.ts +0 -0
  138. package/dist/src/core/types/symbol/index.d.ts +0 -0
  139. package/dist/src/core/types/symbol/metadata.d.ts +0 -0
  140. package/dist/src/core/types/symbol/symbols.d.ts +0 -0
  141. package/dist/src/core/types/tokens.d.ts +0 -0
  142. package/dist/src/core/utils/chars.d.ts +0 -0
  143. package/dist/src/core/utils/expression.d.ts +0 -0
  144. package/dist/src/core/utils/interpret.d.ts +0 -0
  145. package/dist/src/core/utils/numbers.d.ts +0 -0
  146. package/dist/src/core/utils/span.d.ts +0 -0
  147. package/dist/src/core/utils/tokens.d.ts +0 -0
  148. package/dist/src/core/utils/validate.d.ts +0 -0
  149. package/dist/src/index.d.ts +0 -0
  150. package/dist/src/services/definition/provider.d.ts +0 -0
  151. package/dist/src/services/diagnostics/provider.d.ts +0 -0
  152. package/dist/src/services/index.d.ts +0 -0
  153. package/dist/src/services/monarch.d.ts +0 -0
  154. package/dist/src/services/references/provider.d.ts +0 -0
  155. package/dist/src/services/suggestions/crossFile.d.ts +0 -0
  156. package/dist/src/services/suggestions/provider.d.ts +0 -0
  157. package/dist/src/services/suggestions/recordRowSnippet.d.ts +0 -0
  158. package/dist/src/services/suggestions/use.d.ts +0 -0
  159. package/dist/src/services/suggestions/utils/index.d.ts +0 -0
  160. package/dist/src/services/suggestions/utils/useMerger.d.ts +0 -0
  161. package/dist/src/services/types.d.ts +0 -0
  162. package/dist/src/services/utils.d.ts +0 -0
  163. package/package.json +2 -2
@@ -14705,35 +14705,31 @@ function findDiagramViewBlocks(r) {
14705
14705
  }
14706
14706
  return j;
14707
14707
  }
14708
- function emitListSubBlock(r, j, M, N) {
14709
- r.push(` ${j} {`), M.forEach((j) => r.push(` ${N(j)}`)), r.push(" }");
14708
+ function emitListSubBlock(r, j, M) {
14709
+ r.push(` ${j} {`), M.forEach((j) => r.push(` ${j}`)), r.push(" }");
14710
14710
  }
14711
14711
  function emitWildcardSubBlock(r, j) {
14712
14712
  r.push(` ${j} { * }`);
14713
14713
  }
14714
- function formatTableRef(r) {
14715
- let j = addDoubleQuoteIfNeeded(r.name);
14716
- return r.schemaName === "public" ? j : `${addDoubleQuoteIfNeeded(r.schemaName)}.${j}`;
14717
- }
14718
- function formatNamed(r) {
14719
- return addDoubleQuoteIfNeeded(r.name);
14720
- }
14721
14714
  function classifyDim(r) {
14722
14715
  return r == null ? "null" : r.length === 0 ? "empty" : "items";
14723
14716
  }
14724
14717
  function generateDiagramViewBlock(r, j) {
14725
- let M = `DiagramView ${addDoubleQuoteIfNeeded(r)} {`;
14718
+ let M = `DiagramView ${addDoubleQuoteIfNeeded(r)} {`, N = (r) => addDoubleQuoteIfNeeded(r.name), P = j?.tables?.map((r) => {
14719
+ let j = addDoubleQuoteIfNeeded(r.name);
14720
+ return r.schemaName === "public" ? j : `${addDoubleQuoteIfNeeded(r.schemaName)}.${j}`;
14721
+ }) ?? [], F = j?.tableGroups?.map(N) ?? [], I = j?.schemas?.map(N) ?? [], L = j?.stickyNotes?.map(N) ?? [];
14726
14722
  if (!j) return `${M}\n}`;
14727
- let N = {
14723
+ let R = {
14728
14724
  tables: classifyDim(j.tables),
14729
14725
  tableGroups: classifyDim(j.tableGroups),
14730
14726
  schemas: classifyDim(j.schemas),
14731
14727
  stickyNotes: classifyDim(j.stickyNotes)
14732
14728
  };
14733
- if (Object.values(N).every((r) => r === "null")) return `${M}\n}`;
14734
- if (Object.values(N).every((r) => r === "empty")) return `${M}\n *\n}`;
14735
- let P = N.tables === "items" || N.tableGroups === "items" || N.schemas === "items", F = N.tables === "empty" && N.tableGroups === "empty" && N.schemas === "empty", I = [M];
14736
- return P ? (N.tables === "items" && emitListSubBlock(I, "Tables", j.tables, formatTableRef), N.tableGroups === "items" && emitListSubBlock(I, "TableGroups", j.tableGroups, formatNamed), N.schemas === "items" && emitListSubBlock(I, "Schemas", j.schemas, formatNamed)) : F && emitWildcardSubBlock(I, "Tables"), N.stickyNotes === "items" ? emitListSubBlock(I, "Notes", j.stickyNotes, formatNamed) : N.stickyNotes === "empty" && !P && !F && emitWildcardSubBlock(I, "Notes"), I.push("}"), I.join("\n");
14729
+ if (Object.values(R).every((r) => r === "null")) return `${M}\n}`;
14730
+ if (Object.values(R).every((r) => r === "empty")) return `${M}\n *\n}`;
14731
+ let z = R.tables === "items" || R.tableGroups === "items" || R.schemas === "items", B = R.tables === "empty" && R.tableGroups === "empty" && R.schemas === "empty", V = [M];
14732
+ return z ? (R.tables === "items" && emitListSubBlock(V, "Tables", P), R.tableGroups === "items" && emitListSubBlock(V, "TableGroups", F), R.schemas === "items" && emitListSubBlock(V, "Schemas", I)) : B && emitWildcardSubBlock(V, "Tables"), R.stickyNotes === "items" ? emitListSubBlock(V, "Notes", L) : R.stickyNotes === "empty" && emitWildcardSubBlock(V, "Notes"), V.push("}"), V.join("\n");
14737
14733
  }
14738
14734
  function syncDiagramView(r, j, M) {
14739
14735
  let N = this.getSource(r) ?? "", P = M ?? findDiagramViewBlocks(N), F = [];
package/dist/index.d.ts CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -27,12 +27,8 @@ export interface DiagramViewBlock {
27
27
  endIndex: number;
28
28
  }
29
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.
30
+ * Returns the position of every DiagramView block in `source`
31
+ * Note that onany lex or parse errors, we return [], as there's no reliable way to detect diagram views from malformed DBML
36
32
  */
37
33
  export declare function findDiagramViewBlocks(source: string): DiagramViewBlock[];
38
34
  /**
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@dbml/parse",
4
- "version": "8.2.4-alpha.2",
4
+ "version": "8.2.5",
5
5
  "description": "DBML parser v2",
6
6
  "author": "Holistics <dev@holistics.io>",
7
7
  "license": "Apache-2.0",
@@ -46,5 +46,5 @@
46
46
  "engines": {
47
47
  "node": ">=18"
48
48
  },
49
- "gitHead": "71bfaf1080111ff376b3bf69acfe905847e4b1c4"
49
+ "gitHead": "4593cadfa6fc22c3fad2acbdefb839e118aa0c53"
50
50
  }