@dbml/core 11.0.2-arch.0.0 → 11.0.2-arch.0.2

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 (360) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/lib/_virtual/_rolldown/runtime.cjs +1 -1
  4. package/lib/_virtual/_rolldown/runtime.mjs +2 -3
  5. package/lib/export/DbmlExporter.cjs +1 -1
  6. package/lib/export/DbmlExporter.mjs +2 -3
  7. package/lib/export/JsonExporter.mjs +1 -2
  8. package/lib/export/ModelExporter.cjs +1 -1
  9. package/lib/export/ModelExporter.mjs +9 -10
  10. package/lib/export/MysqlExporter.mjs +1 -2
  11. package/lib/export/OracleExporter.mjs +1 -2
  12. package/lib/export/PostgresExporter.cjs +8 -8
  13. package/lib/export/PostgresExporter.mjs +30 -31
  14. package/lib/export/SqlServerExporter.mjs +1 -2
  15. package/lib/export/index.cjs +1 -1
  16. package/lib/export/index.mjs +5 -6
  17. package/lib/export/utils.mjs +1 -2
  18. package/lib/import/index.cjs +1 -1
  19. package/lib/import/index.mjs +10 -11
  20. package/lib/index.cjs +1 -1
  21. package/lib/index.mjs +6 -6
  22. package/lib/model_structure/check.mjs +1 -2
  23. package/lib/model_structure/config.mjs +1 -2
  24. package/lib/model_structure/database.cjs +1 -1
  25. package/lib/model_structure/database.mjs +14 -15
  26. package/lib/model_structure/dbState.mjs +1 -2
  27. package/lib/model_structure/dep.cjs +1 -1
  28. package/lib/model_structure/dep.mjs +6 -7
  29. package/lib/model_structure/depEdge.cjs +1 -1
  30. package/lib/model_structure/depEdge.mjs +10 -11
  31. package/lib/model_structure/element.mjs +1 -2
  32. package/lib/model_structure/endpoint.cjs +1 -1
  33. package/lib/model_structure/endpoint.mjs +17 -18
  34. package/lib/model_structure/enum.cjs +1 -1
  35. package/lib/model_structure/enum.mjs +8 -9
  36. package/lib/model_structure/enumValue.mjs +1 -2
  37. package/lib/model_structure/field.cjs +1 -1
  38. package/lib/model_structure/field.mjs +5 -6
  39. package/lib/model_structure/group.mjs +1 -2
  40. package/lib/model_structure/indexColumn.mjs +1 -2
  41. package/lib/model_structure/indexes.mjs +1 -2
  42. package/lib/model_structure/link.mjs +1 -2
  43. package/lib/model_structure/node.mjs +1 -2
  44. package/lib/model_structure/ref.mjs +1 -2
  45. package/lib/model_structure/schema.cjs +1 -1
  46. package/lib/model_structure/schema.mjs +15 -16
  47. package/lib/model_structure/stickyNote.mjs +1 -2
  48. package/lib/model_structure/table.cjs +1 -1
  49. package/lib/model_structure/table.mjs +28 -29
  50. package/lib/model_structure/tableGroup.cjs +1 -1
  51. package/lib/model_structure/tableGroup.mjs +5 -6
  52. package/lib/model_structure/tablePartial.mjs +1 -2
  53. package/lib/model_structure/utils.mjs +1 -2
  54. package/lib/node_modules/antlr4/dist/antlr4.web.mjs +1 -2
  55. package/lib/node_modules/lodash-es/_DataView.cjs +1 -1
  56. package/lib/node_modules/lodash-es/_DataView.mjs +4 -5
  57. package/lib/node_modules/lodash-es/_Hash.mjs +1 -2
  58. package/lib/node_modules/lodash-es/_ListCache.mjs +1 -2
  59. package/lib/node_modules/lodash-es/_Map.cjs +1 -1
  60. package/lib/node_modules/lodash-es/_Map.mjs +4 -5
  61. package/lib/node_modules/lodash-es/_MapCache.mjs +1 -2
  62. package/lib/node_modules/lodash-es/_Promise.cjs +1 -1
  63. package/lib/node_modules/lodash-es/_Promise.mjs +4 -5
  64. package/lib/node_modules/lodash-es/_Set.cjs +1 -1
  65. package/lib/node_modules/lodash-es/_Set.mjs +4 -5
  66. package/lib/node_modules/lodash-es/_SetCache.mjs +1 -2
  67. package/lib/node_modules/lodash-es/_Stack.mjs +1 -2
  68. package/lib/node_modules/lodash-es/_Symbol.mjs +1 -2
  69. package/lib/node_modules/lodash-es/_Uint8Array.mjs +1 -2
  70. package/lib/node_modules/lodash-es/_WeakMap.cjs +1 -1
  71. package/lib/node_modules/lodash-es/_WeakMap.mjs +4 -5
  72. package/lib/node_modules/lodash-es/_arrayAggregator.mjs +1 -2
  73. package/lib/node_modules/lodash-es/_arrayEach.mjs +1 -2
  74. package/lib/node_modules/lodash-es/_arrayFilter.mjs +1 -2
  75. package/lib/node_modules/lodash-es/_arrayLikeKeys.cjs +1 -1
  76. package/lib/node_modules/lodash-es/_arrayLikeKeys.mjs +9 -10
  77. package/lib/node_modules/lodash-es/_arrayMap.mjs +1 -2
  78. package/lib/node_modules/lodash-es/_arrayPush.mjs +1 -2
  79. package/lib/node_modules/lodash-es/_arrayReduce.mjs +1 -2
  80. package/lib/node_modules/lodash-es/_arraySome.mjs +1 -2
  81. package/lib/node_modules/lodash-es/_asciiToArray.mjs +1 -2
  82. package/lib/node_modules/lodash-es/_assocIndexOf.mjs +1 -2
  83. package/lib/node_modules/lodash-es/_baseAggregator.mjs +1 -2
  84. package/lib/node_modules/lodash-es/_baseAssignValue.mjs +1 -2
  85. package/lib/node_modules/lodash-es/_baseEach.mjs +1 -2
  86. package/lib/node_modules/lodash-es/_baseFlatten.mjs +1 -2
  87. package/lib/node_modules/lodash-es/_baseFor.mjs +1 -2
  88. package/lib/node_modules/lodash-es/_baseForOwn.cjs +1 -1
  89. package/lib/node_modules/lodash-es/_baseForOwn.mjs +5 -6
  90. package/lib/node_modules/lodash-es/_baseGet.mjs +1 -2
  91. package/lib/node_modules/lodash-es/_baseGetAllKeys.cjs +1 -1
  92. package/lib/node_modules/lodash-es/_baseGetAllKeys.mjs +5 -6
  93. package/lib/node_modules/lodash-es/_baseGetTag.mjs +1 -2
  94. package/lib/node_modules/lodash-es/_baseHasIn.mjs +1 -2
  95. package/lib/node_modules/lodash-es/_baseIsArguments.mjs +1 -2
  96. package/lib/node_modules/lodash-es/_baseIsEqual.cjs +1 -1
  97. package/lib/node_modules/lodash-es/_baseIsEqual.mjs +5 -6
  98. package/lib/node_modules/lodash-es/_baseIsEqualDeep.cjs +1 -1
  99. package/lib/node_modules/lodash-es/_baseIsEqualDeep.mjs +15 -16
  100. package/lib/node_modules/lodash-es/_baseIsMatch.mjs +1 -2
  101. package/lib/node_modules/lodash-es/_baseIsNative.cjs +1 -1
  102. package/lib/node_modules/lodash-es/_baseIsNative.mjs +6 -7
  103. package/lib/node_modules/lodash-es/_baseIsTypedArray.cjs +1 -1
  104. package/lib/node_modules/lodash-es/_baseIsTypedArray.mjs +5 -6
  105. package/lib/node_modules/lodash-es/_baseIteratee.cjs +1 -1
  106. package/lib/node_modules/lodash-es/_baseIteratee.mjs +7 -8
  107. package/lib/node_modules/lodash-es/_baseKeys.mjs +1 -2
  108. package/lib/node_modules/lodash-es/_baseMatches.mjs +1 -2
  109. package/lib/node_modules/lodash-es/_baseMatchesProperty.cjs +1 -1
  110. package/lib/node_modules/lodash-es/_baseMatchesProperty.mjs +10 -11
  111. package/lib/node_modules/lodash-es/_baseNth.mjs +1 -2
  112. package/lib/node_modules/lodash-es/_baseProperty.mjs +1 -2
  113. package/lib/node_modules/lodash-es/_basePropertyDeep.mjs +1 -2
  114. package/lib/node_modules/lodash-es/_baseReduce.mjs +1 -2
  115. package/lib/node_modules/lodash-es/_baseSlice.mjs +1 -2
  116. package/lib/node_modules/lodash-es/_baseTimes.mjs +1 -2
  117. package/lib/node_modules/lodash-es/_baseToString.cjs +1 -1
  118. package/lib/node_modules/lodash-es/_baseToString.mjs +7 -8
  119. package/lib/node_modules/lodash-es/_baseTrim.mjs +1 -2
  120. package/lib/node_modules/lodash-es/_baseUnary.mjs +1 -2
  121. package/lib/node_modules/lodash-es/_cacheHas.mjs +1 -2
  122. package/lib/node_modules/lodash-es/_castFunction.mjs +1 -2
  123. package/lib/node_modules/lodash-es/_castPath.mjs +1 -2
  124. package/lib/node_modules/lodash-es/_castSlice.mjs +1 -2
  125. package/lib/node_modules/lodash-es/_copyArray.mjs +1 -2
  126. package/lib/node_modules/lodash-es/_coreJsData.mjs +1 -2
  127. package/lib/node_modules/lodash-es/_createAggregator.cjs +1 -1
  128. package/lib/node_modules/lodash-es/_createAggregator.mjs +8 -9
  129. package/lib/node_modules/lodash-es/_createBaseEach.mjs +1 -2
  130. package/lib/node_modules/lodash-es/_createBaseFor.mjs +1 -2
  131. package/lib/node_modules/lodash-es/_createCaseFirst.cjs +1 -1
  132. package/lib/node_modules/lodash-es/_createCaseFirst.mjs +8 -9
  133. package/lib/node_modules/lodash-es/_defineProperty.mjs +1 -2
  134. package/lib/node_modules/lodash-es/_equalArrays.mjs +1 -2
  135. package/lib/node_modules/lodash-es/_equalByTag.cjs +1 -1
  136. package/lib/node_modules/lodash-es/_equalByTag.mjs +6 -7
  137. package/lib/node_modules/lodash-es/_equalObjects.mjs +1 -2
  138. package/lib/node_modules/lodash-es/_freeGlobal.mjs +1 -2
  139. package/lib/node_modules/lodash-es/_getAllKeys.cjs +1 -1
  140. package/lib/node_modules/lodash-es/_getAllKeys.mjs +5 -6
  141. package/lib/node_modules/lodash-es/_getMapData.mjs +1 -2
  142. package/lib/node_modules/lodash-es/_getMatchData.cjs +1 -1
  143. package/lib/node_modules/lodash-es/_getMatchData.mjs +6 -7
  144. package/lib/node_modules/lodash-es/_getNative.mjs +1 -2
  145. package/lib/node_modules/lodash-es/_getRawTag.mjs +1 -2
  146. package/lib/node_modules/lodash-es/_getSymbols.mjs +1 -2
  147. package/lib/node_modules/lodash-es/_getTag.cjs +1 -1
  148. package/lib/node_modules/lodash-es/_getTag.mjs +12 -13
  149. package/lib/node_modules/lodash-es/_getValue.mjs +1 -2
  150. package/lib/node_modules/lodash-es/_hasPath.cjs +1 -1
  151. package/lib/node_modules/lodash-es/_hasPath.mjs +9 -10
  152. package/lib/node_modules/lodash-es/_hasUnicode.mjs +1 -2
  153. package/lib/node_modules/lodash-es/_hashClear.mjs +1 -2
  154. package/lib/node_modules/lodash-es/_hashDelete.mjs +1 -2
  155. package/lib/node_modules/lodash-es/_hashGet.mjs +1 -2
  156. package/lib/node_modules/lodash-es/_hashHas.mjs +1 -2
  157. package/lib/node_modules/lodash-es/_hashSet.mjs +1 -2
  158. package/lib/node_modules/lodash-es/_isFlattenable.cjs +1 -1
  159. package/lib/node_modules/lodash-es/_isFlattenable.mjs +5 -6
  160. package/lib/node_modules/lodash-es/_isIndex.mjs +1 -2
  161. package/lib/node_modules/lodash-es/_isKey.cjs +1 -1
  162. package/lib/node_modules/lodash-es/_isKey.mjs +6 -7
  163. package/lib/node_modules/lodash-es/_isKeyable.mjs +1 -2
  164. package/lib/node_modules/lodash-es/_isMasked.mjs +1 -2
  165. package/lib/node_modules/lodash-es/_isPrototype.mjs +1 -2
  166. package/lib/node_modules/lodash-es/_isStrictComparable.mjs +1 -2
  167. package/lib/node_modules/lodash-es/_listCacheClear.mjs +1 -2
  168. package/lib/node_modules/lodash-es/_listCacheDelete.mjs +1 -2
  169. package/lib/node_modules/lodash-es/_listCacheGet.mjs +1 -2
  170. package/lib/node_modules/lodash-es/_listCacheHas.mjs +1 -2
  171. package/lib/node_modules/lodash-es/_listCacheSet.mjs +1 -2
  172. package/lib/node_modules/lodash-es/_mapCacheClear.mjs +1 -2
  173. package/lib/node_modules/lodash-es/_mapCacheDelete.mjs +1 -2
  174. package/lib/node_modules/lodash-es/_mapCacheGet.mjs +1 -2
  175. package/lib/node_modules/lodash-es/_mapCacheHas.mjs +1 -2
  176. package/lib/node_modules/lodash-es/_mapCacheSet.mjs +1 -2
  177. package/lib/node_modules/lodash-es/_mapToArray.mjs +1 -2
  178. package/lib/node_modules/lodash-es/_matchesStrictComparable.mjs +1 -2
  179. package/lib/node_modules/lodash-es/_memoizeCapped.mjs +1 -2
  180. package/lib/node_modules/lodash-es/_nativeCreate.mjs +1 -2
  181. package/lib/node_modules/lodash-es/_nativeKeys.mjs +1 -2
  182. package/lib/node_modules/lodash-es/_nodeUtil.mjs +1 -2
  183. package/lib/node_modules/lodash-es/_objectToString.mjs +1 -2
  184. package/lib/node_modules/lodash-es/_overArg.mjs +1 -2
  185. package/lib/node_modules/lodash-es/_root.mjs +1 -2
  186. package/lib/node_modules/lodash-es/_setCacheAdd.mjs +1 -2
  187. package/lib/node_modules/lodash-es/_setCacheHas.mjs +1 -2
  188. package/lib/node_modules/lodash-es/_setToArray.mjs +1 -2
  189. package/lib/node_modules/lodash-es/_stackClear.mjs +1 -2
  190. package/lib/node_modules/lodash-es/_stackDelete.mjs +1 -2
  191. package/lib/node_modules/lodash-es/_stackGet.mjs +1 -2
  192. package/lib/node_modules/lodash-es/_stackHas.mjs +1 -2
  193. package/lib/node_modules/lodash-es/_stackSet.mjs +1 -2
  194. package/lib/node_modules/lodash-es/_stringToArray.cjs +1 -1
  195. package/lib/node_modules/lodash-es/_stringToArray.mjs +5 -6
  196. package/lib/node_modules/lodash-es/_stringToPath.mjs +1 -2
  197. package/lib/node_modules/lodash-es/_toKey.mjs +1 -2
  198. package/lib/node_modules/lodash-es/_toSource.mjs +1 -2
  199. package/lib/node_modules/lodash-es/_trimmedEndIndex.mjs +1 -2
  200. package/lib/node_modules/lodash-es/_unicodeToArray.mjs +1 -2
  201. package/lib/node_modules/lodash-es/capitalize.mjs +1 -2
  202. package/lib/node_modules/lodash-es/concat.cjs +1 -1
  203. package/lib/node_modules/lodash-es/concat.mjs +7 -8
  204. package/lib/node_modules/lodash-es/eq.mjs +1 -2
  205. package/lib/node_modules/lodash-es/first.mjs +1 -1
  206. package/lib/node_modules/lodash-es/flatten.mjs +1 -2
  207. package/lib/node_modules/lodash-es/flattenDeep.mjs +1 -2
  208. package/lib/node_modules/lodash-es/flattenDepth.cjs +1 -1
  209. package/lib/node_modules/lodash-es/flattenDepth.mjs +5 -6
  210. package/lib/node_modules/lodash-es/forEach.cjs +1 -1
  211. package/lib/node_modules/lodash-es/forEach.mjs +7 -8
  212. package/lib/node_modules/lodash-es/get.mjs +1 -2
  213. package/lib/node_modules/lodash-es/groupBy.mjs +1 -2
  214. package/lib/node_modules/lodash-es/hasIn.mjs +1 -2
  215. package/lib/node_modules/lodash-es/head.mjs +1 -2
  216. package/lib/node_modules/lodash-es/identity.mjs +1 -2
  217. package/lib/node_modules/lodash-es/isArguments.cjs +1 -1
  218. package/lib/node_modules/lodash-es/isArguments.mjs +6 -7
  219. package/lib/node_modules/lodash-es/isArray.mjs +1 -2
  220. package/lib/node_modules/lodash-es/isArrayLike.mjs +1 -2
  221. package/lib/node_modules/lodash-es/isBuffer.mjs +1 -2
  222. package/lib/node_modules/lodash-es/isEmpty.cjs +1 -1
  223. package/lib/node_modules/lodash-es/isEmpty.mjs +13 -14
  224. package/lib/node_modules/lodash-es/isFunction.mjs +1 -2
  225. package/lib/node_modules/lodash-es/isLength.mjs +1 -2
  226. package/lib/node_modules/lodash-es/isNil.mjs +1 -2
  227. package/lib/node_modules/lodash-es/isObject.mjs +1 -2
  228. package/lib/node_modules/lodash-es/isObjectLike.mjs +1 -2
  229. package/lib/node_modules/lodash-es/isSymbol.mjs +1 -2
  230. package/lib/node_modules/lodash-es/isTypedArray.mjs +1 -2
  231. package/lib/node_modules/lodash-es/keys.cjs +1 -1
  232. package/lib/node_modules/lodash-es/keys.mjs +6 -7
  233. package/lib/node_modules/lodash-es/last.mjs +1 -2
  234. package/lib/node_modules/lodash-es/lodash.cjs +1 -1
  235. package/lib/node_modules/lodash-es/lodash.mjs +19 -19
  236. package/lib/node_modules/lodash-es/memoize.mjs +1 -2
  237. package/lib/node_modules/lodash-es/nth.cjs +1 -1
  238. package/lib/node_modules/lodash-es/nth.mjs +5 -6
  239. package/lib/node_modules/lodash-es/property.cjs +1 -1
  240. package/lib/node_modules/lodash-es/property.mjs +7 -8
  241. package/lib/node_modules/lodash-es/reduce.cjs +1 -1
  242. package/lib/node_modules/lodash-es/reduce.mjs +8 -9
  243. package/lib/node_modules/lodash-es/stubArray.mjs +1 -2
  244. package/lib/node_modules/lodash-es/stubFalse.mjs +1 -2
  245. package/lib/node_modules/lodash-es/toFinite.mjs +1 -2
  246. package/lib/node_modules/lodash-es/toInteger.mjs +1 -2
  247. package/lib/node_modules/lodash-es/toNumber.cjs +1 -1
  248. package/lib/node_modules/lodash-es/toNumber.mjs +9 -10
  249. package/lib/node_modules/lodash-es/toString.mjs +1 -2
  250. package/lib/node_modules/lodash-es/upperFirst.mjs +1 -2
  251. package/lib/node_modules/luxon/build/es6/luxon.mjs +1 -2
  252. package/lib/node_modules/parsimmon/build/parsimmon.umd.min.cjs +1 -1
  253. package/lib/node_modules/parsimmon/build/parsimmon.umd.min.mjs +3 -4
  254. package/lib/node_modules/pluralize/pluralize.cjs +1 -1
  255. package/lib/node_modules/pluralize/pluralize.mjs +3 -4
  256. package/lib/packages/dbml-core/node_modules/lodash/lodash.cjs +2 -2
  257. package/lib/packages/dbml-core/node_modules/lodash/lodash.mjs +3 -4
  258. package/lib/packages/dbml-core/package.json.cjs +1 -1
  259. package/lib/packages/dbml-core/package.json.mjs +2 -3
  260. package/lib/parse/ANTLR/ASTGeneration/AST.mjs +1 -2
  261. package/lib/parse/ANTLR/ASTGeneration/ParserErrorListener.mjs +1 -2
  262. package/lib/parse/ANTLR/ASTGeneration/SyntaxError.mjs +1 -2
  263. package/lib/parse/ANTLR/ASTGeneration/constants.mjs +1 -2
  264. package/lib/parse/ANTLR/ASTGeneration/helpers.mjs +1 -2
  265. package/lib/parse/ANTLR/ASTGeneration/index.mjs +1 -2
  266. package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.mjs +1 -2
  267. package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.cjs +1 -1
  268. package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.mjs +2 -3
  269. package/lib/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.cjs +1 -1
  270. package/lib/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.mjs +57 -58
  271. package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.cjs +1 -1
  272. package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.mjs +2 -3
  273. package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.mjs +1 -2
  274. package/lib/parse/ANTLR/parsers/mssql/TSqlLexer.mjs +1 -2
  275. package/lib/parse/ANTLR/parsers/mssql/TSqlParser.mjs +1 -2
  276. package/lib/parse/ANTLR/parsers/mssql/TSqlParserVisitor.mjs +1 -2
  277. package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.mjs +1 -2
  278. package/lib/parse/ANTLR/parsers/mysql/MySqlLexerBase.mjs +1 -2
  279. package/lib/parse/ANTLR/parsers/mysql/MySqlParser.mjs +1 -2
  280. package/lib/parse/ANTLR/parsers/mysql/MySqlParserVisitor.mjs +1 -2
  281. package/lib/parse/ANTLR/parsers/oraclesql/OracleSqlLexer.mjs +1 -2
  282. package/lib/parse/ANTLR/parsers/oraclesql/OracleSqlLexerBase.mjs +1 -2
  283. package/lib/parse/ANTLR/parsers/oraclesql/OracleSqlParser.mjs +1 -2
  284. package/lib/parse/ANTLR/parsers/oraclesql/OracleSqlParserBase.mjs +1 -2
  285. package/lib/parse/ANTLR/parsers/oraclesql/OracleSqlParserVisitor.mjs +1 -2
  286. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexer.mjs +1 -2
  287. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexerBase.mjs +1 -2
  288. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParser.mjs +1 -2
  289. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParserBase.mjs +1 -2
  290. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParserVisitor.mjs +1 -2
  291. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeLexer.mjs +1 -2
  292. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParser.mjs +1 -2
  293. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParserVisitor.mjs +1 -2
  294. package/lib/parse/Parser.cjs +1 -1
  295. package/lib/parse/Parser.mjs +37 -38
  296. package/lib/parse/databaseGenerator.mjs +1 -2
  297. package/lib/parse/deprecated/dbmlParser.mjs +1 -2
  298. package/lib/parse/deprecated/mssql/base_parsers.cjs +1 -1
  299. package/lib/parse/deprecated/mssql/base_parsers.mjs +27 -28
  300. package/lib/parse/deprecated/mssql/column_definition/actions.mjs +1 -2
  301. package/lib/parse/deprecated/mssql/column_definition/index.cjs +1 -1
  302. package/lib/parse/deprecated/mssql/column_definition/index.mjs +19 -19
  303. package/lib/parse/deprecated/mssql/constraint_definition/actions.mjs +1 -2
  304. package/lib/parse/deprecated/mssql/constraint_definition/index.cjs +1 -1
  305. package/lib/parse/deprecated/mssql/constraint_definition/index.mjs +10 -10
  306. package/lib/parse/deprecated/mssql/expression.cjs +1 -1
  307. package/lib/parse/deprecated/mssql/expression.mjs +17 -18
  308. package/lib/parse/deprecated/mssql/fk_definition/actions.mjs +1 -2
  309. package/lib/parse/deprecated/mssql/fk_definition/index.cjs +1 -1
  310. package/lib/parse/deprecated/mssql/fk_definition/index.mjs +7 -8
  311. package/lib/parse/deprecated/mssql/index.mjs +1 -2
  312. package/lib/parse/deprecated/mssql/index_definition/actions.mjs +1 -2
  313. package/lib/parse/deprecated/mssql/index_definition/index.cjs +1 -1
  314. package/lib/parse/deprecated/mssql/index_definition/index.mjs +13 -14
  315. package/lib/parse/deprecated/mssql/keyword_parsers.mjs +1 -2
  316. package/lib/parse/deprecated/mssql/keyword_utils.mjs +1 -2
  317. package/lib/parse/deprecated/mssql/statements/actions.mjs +1 -2
  318. package/lib/parse/deprecated/mssql/statements/index.cjs +1 -1
  319. package/lib/parse/deprecated/mssql/statements/index.mjs +23 -24
  320. package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/actions.mjs +1 -2
  321. package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/add/actions.mjs +1 -1
  322. package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/add/index.cjs +1 -1
  323. package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/add/index.mjs +13 -14
  324. package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/index.mjs +1 -2
  325. package/lib/parse/deprecated/mssql/statements/statement_types/comments/actions.mjs +1 -2
  326. package/lib/parse/deprecated/mssql/statements/statement_types/comments/index.cjs +1 -1
  327. package/lib/parse/deprecated/mssql/statements/statement_types/comments/index.mjs +5 -6
  328. package/lib/parse/deprecated/mssql/statements/statement_types/create_index/actions.mjs +1 -2
  329. package/lib/parse/deprecated/mssql/statements/statement_types/create_index/index.cjs +1 -1
  330. package/lib/parse/deprecated/mssql/statements/statement_types/create_index/index.mjs +11 -12
  331. package/lib/parse/deprecated/mssql/statements/statement_types/create_table/actions.mjs +1 -2
  332. package/lib/parse/deprecated/mssql/statements/statement_types/create_table/index.cjs +1 -1
  333. package/lib/parse/deprecated/mssql/statements/statement_types/create_table/index.mjs +11 -12
  334. package/lib/parse/deprecated/mssql/statements/statement_types/index.mjs +1 -1
  335. package/lib/parse/deprecated/mssql/utils.cjs +1 -1
  336. package/lib/parse/deprecated/mssql/utils.mjs +10 -11
  337. package/lib/parse/deprecated/mssql/whitespaces.mjs +1 -2
  338. package/lib/parse/deprecated/mssqlParser.mjs +1 -2
  339. package/lib/parse/deprecated/mysqlParser.mjs +1 -2
  340. package/lib/parse/deprecated/postgresParser.mjs +1 -2
  341. package/lib/parse/deprecated/schemarbParser.mjs +1 -2
  342. package/lib/parse/error.mjs +1 -2
  343. package/lib/transform/index.mjs +1 -2
  344. package/lib/transform/relations.mjs +1 -2
  345. package/lib/utils/version.mjs +1 -2
  346. package/package.json +3 -3
  347. package/types/export/DbmlExporter.d.ts +0 -0
  348. package/types/export/JsonExporter.d.ts +0 -0
  349. package/types/export/ModelExporter.d.ts +0 -0
  350. package/types/export/index.d.ts +0 -0
  351. package/types/index.d.ts +3 -3
  352. package/types/model_structure/check.d.ts +0 -0
  353. package/types/model_structure/element.d.ts +0 -0
  354. package/types/model_structure/enum.d.ts +0 -0
  355. package/types/model_structure/enumValue.d.ts +0 -0
  356. package/types/model_structure/index.d.ts +0 -0
  357. package/types/model_structure/indexes.d.ts +0 -0
  358. package/types/model_structure/ref.d.ts +0 -0
  359. package/types/model_structure/tablePartial.d.ts +0 -0
  360. package/types/parse/Parser.d.ts +0 -0
@@ -3,22 +3,22 @@ import t from "../node_modules/lodash-es/capitalize.mjs";
3
3
  import { init_lodash as n } from "../node_modules/lodash-es/lodash.mjs";
4
4
  import { DEFAULT_SCHEMA_NAME as r, ENUM as i, NOTE as a, TABLE as o, TABLE_GROUP as s } from "./config.mjs";
5
5
  import c from "./dbState.mjs";
6
- import l from "./element.mjs";
7
- import u from "./dep.mjs";
6
+ import l from "./dep.mjs";
7
+ import u from "./element.mjs";
8
8
  import d from "./enum.mjs";
9
9
  import f from "./ref.mjs";
10
- import p from "./table.mjs";
11
- import m from "./tableGroup.mjs";
12
- import h from "./schema.mjs";
13
- import g from "./stickyNote.mjs";
10
+ import p from "./schema.mjs";
11
+ import m from "./stickyNote.mjs";
12
+ import h from "./table.mjs";
13
+ import g from "./tableGroup.mjs";
14
14
  import _ from "./tablePartial.mjs";
15
15
  import v from "./node.mjs";
16
16
  import y from "./group.mjs";
17
17
  import b from "./link.mjs";
18
18
  import { makeCardinalityRequired as x, parseCardinality as S } from "@dbml/parse";
19
- //#region src/model_structure/database.ts
19
+ // src/model_structure/database.ts
20
20
  n();
21
- var C = class extends l {
21
+ var C = class extends u {
22
22
  constructor({ schemas: t = [], tables: n = [], notes: l = [], enums: u = [], refs: d = [], deps: p = [], tableGroups: m = [], project: h = {}, aliases: g = [], records: _ = [], tablePartials: v = [], diagramViews: y = [], nodes: b = [], groups: x = [], links: S = [], frontMatter: C, diagramType: w } = {}) {
23
23
  super(), this.dbState = new c(), this.generateId(), this.hasDefaultSchema = !1, this.schemas = [], this.notes = [], this.note = h.note ? e(h, "note.value", typeof h.note == "string" ? h.note : null) : null, this.noteToken = h.note ? e(h, "note.token", h.noteToken) : null, this.databaseType = h.database_type, this.name = h.name, this.token = h.token, this.aliases = g, this.records = [], this.tablePartials = [], this.diagramViews = y, this.injectedRawRefs = [], this.processNotes(l), this.processRecords(_), this.processTablePartials(v), this.processSchemas(t), this.processSchemaElements(u, i), this.processSchemaElements(n, o), this.linkRecordsToTables(), this.processSchemaElements(l, a), this.processSchemaElements(d, "ref"), this.processSchemaElements(p, "dep"), this.processSchemaElements(m, s), this.injectedRawRefs.forEach((e) => {
24
24
  let t = this.findOrCreateSchema(r), n = new f({
@@ -65,7 +65,7 @@ var C = class extends l {
65
65
  }
66
66
  processNotes(e) {
67
67
  e.forEach((e) => {
68
- this.pushNote(new g({
68
+ this.pushNote(new m({
69
69
  ...e,
70
70
  database: this
71
71
  }));
@@ -100,7 +100,7 @@ var C = class extends l {
100
100
  }
101
101
  processSchemas(e) {
102
102
  e.forEach((e) => {
103
- this.pushSchema(new h({
103
+ this.pushSchema(new p({
104
104
  ...e,
105
105
  database: this
106
106
  }));
@@ -117,7 +117,7 @@ var C = class extends l {
117
117
  e.forEach((e) => {
118
118
  switch (e.schemaName ? (n = this.findOrCreateSchema(e.schemaName), e.schemaName) : n = this.findOrCreateSchema(r), t) {
119
119
  case o:
120
- n.pushTable(new p({
120
+ n.pushTable(new h({
121
121
  ...e,
122
122
  schema: n
123
123
  }));
@@ -129,7 +129,7 @@ var C = class extends l {
129
129
  }));
130
130
  break;
131
131
  case s:
132
- n.pushTableGroup(new m({
132
+ n.pushTableGroup(new g({
133
133
  ...e,
134
134
  schema: n
135
135
  }));
@@ -140,7 +140,7 @@ var C = class extends l {
140
140
  schema: n
141
141
  }));
142
142
  break;
143
- case "dep": n.pushDep(new u({
143
+ case "dep": n.pushDep(new l({
144
144
  ...e,
145
145
  schema: n
146
146
  }));
@@ -160,7 +160,7 @@ var C = class extends l {
160
160
  }
161
161
  findOrCreateSchema(e) {
162
162
  let n = this.schemas.find((t) => t.name === e || t.alias === e);
163
- return n || (n = new h({
163
+ return n || (n = new p({
164
164
  name: e,
165
165
  note: { value: e === "public" ? `Default ${t(r)} Schema` : null },
166
166
  database: this
@@ -274,5 +274,4 @@ var C = class extends l {
274
274
  }), e;
275
275
  }
276
276
  };
277
- //#endregion
278
277
  export { C as default };
@@ -1,4 +1,4 @@
1
- //#region src/model_structure/dbState.ts
1
+ // src/model_structure/dbState.ts
2
2
  var e = class {
3
3
  constructor() {
4
4
  this.dbId = 1, this.schemaId = 1, this.enumId = 1, this.tableGroupId = 1, this.refId = 1, this.depId = 1, this.depEdgeId = 1, this.tableId = 1, this.noteId = 1, this.enumValueId = 1, this.endpointId = 1, this.indexId = 1, this.checkId = 1, this.fieldId = 1, this.indexColumnId = 1, this.recordId = 1, this.tablePartialId = 1, this.nodeId = 1, this.groupId = 1, this.linkId = 1;
@@ -8,5 +8,4 @@ var e = class {
8
8
  return this[e] += 1, t;
9
9
  }
10
10
  };
11
- //#endregion
12
11
  export { e as default };
@@ -1 +1 @@
1
- require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs");require("./config.cjs");const n=require("./element.cjs"),r=require("./depEdge.cjs");t.init_lodash();var i=class extends n.default{constructor({name:t,color:n,note:r,metadata:i,edges:a,token:o,schema:s={}}){super(o),this.name=t??null,this.color=n,this.note=r?e.default(r,`value`,r):null,this.noteToken=r?e.default(r,`token`,null):null,this.metadata=i??null,this.edges=[],this.schema=s,this.dbState=this.schema.dbState,this.generateId(),this.processEdges(a??[])}generateId(){this.id=this.dbState.generateId(`depId`)}processEdges(e){e.forEach(e=>{let t=e.upstream?.schemaName||`public`,n=e.downstream?.schemaName||`public`,i=e.upstream?.tableName,a=e.downstream?.tableName,o=e.upstream?.fieldNames?.join(`,`),s=e.downstream?.fieldNames?.join(`,`);t===n&&i===a&&o===s&&o&&this.error(`Self-loop Dep edge not allowed: "${t}"."${i}" columns cannot depend on itself`),this.edges.push(new r.default({...e,dep:this}))})}export(){return{...this.shallowExport(),...this.exportChild()}}shallowExport(){return{name:this.name,color:this.color,note:this.note,metadata:this.metadata}}exportChild(){return{edges:this.edges.map(e=>e.export())}}exportChildIds(){return{edgeIds:this.edges.map(e=>e.id)}}exportParentIds(){return{schemaId:this.schema.id}}normalize(e){e.deps[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.edges.forEach(t=>t.normalize(e))}};exports.default=i;
1
+ require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs");require("./config.cjs");const n=require("./depEdge.cjs"),r=require("./element.cjs");t.init_lodash();var i=class extends r.default{constructor({name:t,color:n,note:r,metadata:i,edges:a,token:o,schema:s={}}){super(o),this.name=t??null,this.color=n,this.note=r?e.default(r,`value`,r):null,this.noteToken=r?e.default(r,`token`,null):null,this.metadata=i??null,this.edges=[],this.schema=s,this.dbState=this.schema.dbState,this.generateId(),this.processEdges(a??[])}generateId(){this.id=this.dbState.generateId(`depId`)}processEdges(e){e.forEach(e=>{let t=e.upstream?.schemaName||`public`,r=e.downstream?.schemaName||`public`,i=e.upstream?.tableName,a=e.downstream?.tableName,o=e.upstream?.fieldNames?.join(`,`),s=e.downstream?.fieldNames?.join(`,`);t===r&&i===a&&o===s&&o&&this.error(`Self-loop Dep edge not allowed: "${t}"."${i}" columns cannot depend on itself`),this.edges.push(new n.default({...e,dep:this}))})}export(){return{...this.shallowExport(),...this.exportChild()}}shallowExport(){return{name:this.name,color:this.color,note:this.note,metadata:this.metadata}}exportChild(){return{edges:this.edges.map(e=>e.export())}}exportChildIds(){return{edgeIds:this.edges.map(e=>e.id)}}exportParentIds(){return{schemaId:this.schema.id}}normalize(e){e.deps[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.edges.forEach(t=>t.normalize(e))}};exports.default=i;
@@ -1,11 +1,11 @@
1
1
  import e from "../node_modules/lodash-es/get.mjs";
2
2
  import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
3
3
  import "./config.mjs";
4
- import n from "./element.mjs";
5
- import r from "./depEdge.mjs";
6
- //#region src/model_structure/dep.ts
4
+ import n from "./depEdge.mjs";
5
+ import r from "./element.mjs";
6
+ // src/model_structure/dep.ts
7
7
  t();
8
- var i = class extends n {
8
+ var i = class extends r {
9
9
  constructor({ name: t, color: n, note: r, metadata: i, edges: a, token: o, schema: s = {} }) {
10
10
  super(o), this.name = t ?? null, this.color = n, this.note = r ? e(r, "value", r) : null, this.noteToken = r ? e(r, "token", null) : null, this.metadata = i ?? null, this.edges = [], this.schema = s, this.dbState = this.schema.dbState, this.generateId(), this.processEdges(a ?? []);
11
11
  }
@@ -14,8 +14,8 @@ var i = class extends n {
14
14
  }
15
15
  processEdges(e) {
16
16
  e.forEach((e) => {
17
- let t = e.upstream?.schemaName || "public", n = e.downstream?.schemaName || "public", i = e.upstream?.tableName, a = e.downstream?.tableName, o = e.upstream?.fieldNames?.join(","), s = e.downstream?.fieldNames?.join(",");
18
- t === n && i === a && o === s && o && this.error(`Self-loop Dep edge not allowed: "${t}"."${i}" columns cannot depend on itself`), this.edges.push(new r({
17
+ let t = e.upstream?.schemaName || "public", r = e.downstream?.schemaName || "public", i = e.upstream?.tableName, a = e.downstream?.tableName, o = e.upstream?.fieldNames?.join(","), s = e.downstream?.fieldNames?.join(",");
18
+ t === r && i === a && o === s && o && this.error(`Self-loop Dep edge not allowed: "${t}"."${i}" columns cannot depend on itself`), this.edges.push(new n({
19
19
  ...e,
20
20
  dep: this
21
21
  }));
@@ -53,5 +53,4 @@ var i = class extends n {
53
53
  }, this.edges.forEach((t) => t.normalize(e));
54
54
  }
55
55
  };
56
- //#endregion
57
56
  export { i as default };
@@ -1 +1 @@
1
- require("../_virtual/_rolldown/runtime.cjs"),require("./config.cjs");const e=require("./utils.cjs"),t=require("./element.cjs");var n=class extends t.default{constructor({upstream:e,downstream:t,token:n,dep:r}){super(n),this.upstream={schemaName:e.schemaName??null,tableName:e.tableName,fieldNames:e.fieldNames??[]},this.downstream={schemaName:t.schemaName??null,tableName:t.tableName,fieldNames:t.fieldNames??[]},this.dep=r,this.dbState=this.dep.dbState,this.generateId();let i=this.dep.schema.database,a=this.resolveEndpoint(this.upstream,i),o=this.resolveEndpoint(this.downstream,i);this.upstreamTable=a.table,this.upstreamFields=a.fields,this.downstreamTable=o.table,this.downstreamFields=o.fields,this.upstreamFields.forEach(e=>e.pushDepEdge(this)),this.downstreamFields.forEach(e=>e.pushDepEdge(this))}resolveEndpoint(t,n){let r=t.schemaName||`public`,i=n.findTable(r,t.tableName);return i||this.error(`Can't find table ${e.shouldPrintSchemaName(r)?`"${r}".`:``}"${t.tableName}" referenced in Dep edge`),{table:i,fields:(t.fieldNames??[]).map(t=>{let n=i.findField(t);return n||this.error(`Can't find field ${e.shouldPrintSchema(i.schema)?`"${i.schema.name}".`:``}"${t}" in table "${i.name}" referenced in Dep edge`),n})}}generateId(){this.id=this.dbState.generateId(`depEdgeId`)}export(){return this.shallowExport()}shallowExport(){return{upstream:this.upstream,downstream:this.downstream}}exportParentIds(){return{depId:this.dep.id,upstreamTableId:this.upstreamTable?this.upstreamTable.id:null,upstreamFieldIds:this.upstreamFields.map(e=>e.id),downstreamTableId:this.downstreamTable?this.downstreamTable.id:null,downstreamFieldIds:this.downstreamFields.map(e=>e.id)}}normalize(e){e.depEdges||={},e.depEdges[this.id]={id:this.id,...this.shallowExport(),...this.exportParentIds()}}};exports.default=n;
1
+ require("../_virtual/_rolldown/runtime.cjs"),require("./config.cjs");const e=require("./element.cjs"),t=require("./utils.cjs");var n=class extends e.default{constructor({upstream:e,downstream:t,token:n,dep:r}){super(n),this.upstream={schemaName:e.schemaName??null,tableName:e.tableName,fieldNames:e.fieldNames??[]},this.downstream={schemaName:t.schemaName??null,tableName:t.tableName,fieldNames:t.fieldNames??[]},this.dep=r,this.dbState=this.dep.dbState,this.generateId();let i=this.dep.schema.database,a=this.resolveEndpoint(this.upstream,i),o=this.resolveEndpoint(this.downstream,i);this.upstreamTable=a.table,this.upstreamFields=a.fields,this.downstreamTable=o.table,this.downstreamFields=o.fields,this.upstreamFields.forEach(e=>e.pushDepEdge(this)),this.downstreamFields.forEach(e=>e.pushDepEdge(this))}resolveEndpoint(e,n){let r=e.schemaName||`public`,i=n.findTable(r,e.tableName);return i||this.error(`Can't find table ${t.shouldPrintSchemaName(r)?`"${r}".`:``}"${e.tableName}" referenced in Dep edge`),{table:i,fields:(e.fieldNames??[]).map(e=>{let n=i.findField(e);return n||this.error(`Can't find field ${t.shouldPrintSchema(i.schema)?`"${i.schema.name}".`:``}"${e}" in table "${i.name}" referenced in Dep edge`),n})}}generateId(){this.id=this.dbState.generateId(`depEdgeId`)}export(){return this.shallowExport()}shallowExport(){return{upstream:this.upstream,downstream:this.downstream}}exportParentIds(){return{depId:this.dep.id,upstreamTableId:this.upstreamTable?this.upstreamTable.id:null,upstreamFieldIds:this.upstreamFields.map(e=>e.id),downstreamTableId:this.downstreamTable?this.downstreamTable.id:null,downstreamFieldIds:this.downstreamFields.map(e=>e.id)}}normalize(e){e.depEdges||={},e.depEdges[this.id]={id:this.id,...this.shallowExport(),...this.exportParentIds()}}};exports.default=n;
@@ -1,8 +1,8 @@
1
1
  import "./config.mjs";
2
- import { shouldPrintSchema as e, shouldPrintSchemaName as t } from "./utils.mjs";
3
- import n from "./element.mjs";
4
- //#region src/model_structure/depEdge.ts
5
- var r = class extends n {
2
+ import e from "./element.mjs";
3
+ import { shouldPrintSchema as t, shouldPrintSchemaName as n } from "./utils.mjs";
4
+ // src/model_structure/depEdge.ts
5
+ var r = class extends e {
6
6
  constructor({ upstream: e, downstream: t, token: n, dep: r }) {
7
7
  super(n), this.upstream = {
8
8
  schemaName: e.schemaName ?? null,
@@ -16,13 +16,13 @@ var r = class extends n {
16
16
  let i = this.dep.schema.database, a = this.resolveEndpoint(this.upstream, i), o = this.resolveEndpoint(this.downstream, i);
17
17
  this.upstreamTable = a.table, this.upstreamFields = a.fields, this.downstreamTable = o.table, this.downstreamFields = o.fields, this.upstreamFields.forEach((e) => e.pushDepEdge(this)), this.downstreamFields.forEach((e) => e.pushDepEdge(this));
18
18
  }
19
- resolveEndpoint(n, r) {
20
- let i = n.schemaName || "public", a = r.findTable(i, n.tableName);
21
- return a || this.error(`Can't find table ${t(i) ? `"${i}".` : ""}"${n.tableName}" referenced in Dep edge`), {
19
+ resolveEndpoint(e, r) {
20
+ let i = e.schemaName || "public", a = r.findTable(i, e.tableName);
21
+ return a || this.error(`Can't find table ${n(i) ? `"${i}".` : ""}"${e.tableName}" referenced in Dep edge`), {
22
22
  table: a,
23
- fields: (n.fieldNames ?? []).map((t) => {
24
- let n = a.findField(t);
25
- return n || this.error(`Can't find field ${e(a.schema) ? `"${a.schema.name}".` : ""}"${t}" in table "${a.name}" referenced in Dep edge`), n;
23
+ fields: (e.fieldNames ?? []).map((e) => {
24
+ let n = a.findField(e);
25
+ return n || this.error(`Can't find field ${t(a.schema) ? `"${a.schema.name}".` : ""}"${e}" in table "${a.name}" referenced in Dep edge`), n;
26
26
  })
27
27
  };
28
28
  }
@@ -55,5 +55,4 @@ var r = class extends n {
55
55
  };
56
56
  }
57
57
  };
58
- //#endregion
59
58
  export { r as default };
@@ -1,4 +1,4 @@
1
- //#region src/model_structure/element.js
1
+ // src/model_structure/element.js
2
2
  var e = class extends Error {
3
3
  constructor(e, t = { start: {
4
4
  line: 1,
@@ -17,5 +17,4 @@ var e = class extends Error {
17
17
  throw new e(t, this.token);
18
18
  }
19
19
  };
20
- //#endregion
21
20
  export { t as default };
@@ -1 +1 @@
1
- require("../_virtual/_rolldown/runtime.cjs"),require("./config.cjs");const e=require("./utils.cjs"),t=require("./element.cjs");var n=class extends t.default{constructor({tableName:t,schemaName:n,fieldNames:r,relation:i,token:a,ref:o}){super(a),this.relation=i,this.schemaName=n,this.tableName=t,this.fieldNames=r,this.fields=[],this.ref=o,this.dbState=this.ref.dbState,this.generateId();let s=o.schema.database.findOrCreateSchema(n||`public`).database.findTable(n,t);s||this.error(`Can't find table ${e.shouldPrintSchemaName(n)?`"${n}".`:``}"${t}"`),this.setFields(r,s)}generateId(){this.id=this.dbState.generateId(`endpointId`)}equals(e){return this.fields.length===e.fields.length&&this.compareFields(e)}compareFields(e){let t=this.fields.map(e=>e.id).sort(),n=e.fields.map(e=>e.id).sort();for(let e=0;e<t.length;e+=1)if(t[e]!==n[e])return!1;return!0}export(){return{...this.shallowExport()}}exportParentIds(){return{refId:this.ref.id,fieldIds:this.fields.map(e=>e.id)}}shallowExport(){return{schemaName:this.schemaName,tableName:this.tableName,fieldNames:this.fieldNames,relation:this.relation}}setFields(t,n){let r=t&&t.length?[...t]:[];if(!r.length){let t=n.fields.find(e=>e.pk);if(t)r.push(t.name);else{let t=n.indexes.find(e=>e.pk);t?r=t.columns.map(e=>e.value):this.error(`Can't find primary or composite key in table ${e.shouldPrintSchema(n.schema)?`"${n.schema.name}".`:``}"${n.name}"`)}}r.forEach(t=>{let r=n.findField(t);r||this.error(`Can't find field ${e.shouldPrintSchema(n.schema)?`"${n.schema.name}".`:``}"${t}" in table "${n.name}"`),this.fields.push(r),r.pushEndpoint(this)})}normalize(e){e.endpoints[this.id]={id:this.id,...this.shallowExport(),...this.exportParentIds()}}};exports.default=n;
1
+ require("../_virtual/_rolldown/runtime.cjs"),require("./config.cjs");const e=require("./element.cjs"),t=require("./utils.cjs");var n=class extends e.default{constructor({tableName:e,schemaName:n,fieldNames:r,relation:i,token:a,ref:o}){super(a),this.relation=i,this.schemaName=n,this.tableName=e,this.fieldNames=r,this.fields=[],this.ref=o,this.dbState=this.ref.dbState,this.generateId();let s=o.schema.database.findOrCreateSchema(n||`public`).database.findTable(n,e);s||this.error(`Can't find table ${t.shouldPrintSchemaName(n)?`"${n}".`:``}"${e}"`),this.setFields(r,s)}generateId(){this.id=this.dbState.generateId(`endpointId`)}equals(e){return this.fields.length===e.fields.length&&this.compareFields(e)}compareFields(e){let t=this.fields.map(e=>e.id).sort(),n=e.fields.map(e=>e.id).sort();for(let e=0;e<t.length;e+=1)if(t[e]!==n[e])return!1;return!0}export(){return{...this.shallowExport()}}exportParentIds(){return{refId:this.ref.id,fieldIds:this.fields.map(e=>e.id)}}shallowExport(){return{schemaName:this.schemaName,tableName:this.tableName,fieldNames:this.fieldNames,relation:this.relation}}setFields(e,n){let r=e&&e.length?[...e]:[];if(!r.length){let e=n.fields.find(e=>e.pk);if(e)r.push(e.name);else{let e=n.indexes.find(e=>e.pk);e?r=e.columns.map(e=>e.value):this.error(`Can't find primary or composite key in table ${t.shouldPrintSchema(n.schema)?`"${n.schema.name}".`:``}"${n.name}"`)}}r.forEach(e=>{let r=n.findField(e);r||this.error(`Can't find field ${t.shouldPrintSchema(n.schema)?`"${n.schema.name}".`:``}"${e}" in table "${n.name}"`),this.fields.push(r),r.pushEndpoint(this)})}normalize(e){e.endpoints[this.id]={id:this.id,...this.shallowExport(),...this.exportParentIds()}}};exports.default=n;
@@ -1,12 +1,12 @@
1
1
  import "./config.mjs";
2
- import { shouldPrintSchema as e, shouldPrintSchemaName as t } from "./utils.mjs";
3
- import n from "./element.mjs";
4
- //#region src/model_structure/endpoint.js
5
- var r = class extends n {
6
- constructor({ tableName: e, schemaName: n, fieldNames: r, relation: i, token: a, ref: o }) {
7
- super(a), this.relation = i, this.schemaName = n, this.tableName = e, this.fieldNames = r, this.fields = [], this.ref = o, this.dbState = this.ref.dbState, this.generateId();
8
- let s = o.schema.database.findOrCreateSchema(n || "public").database.findTable(n, e);
9
- s || this.error(`Can't find table ${t(n) ? `"${n}".` : ""}"${e}"`), this.setFields(r, s);
2
+ import e from "./element.mjs";
3
+ import { shouldPrintSchema as t, shouldPrintSchemaName as n } from "./utils.mjs";
4
+ // src/model_structure/endpoint.js
5
+ var r = class extends e {
6
+ constructor({ tableName: e, schemaName: t, fieldNames: r, relation: i, token: a, ref: o }) {
7
+ super(a), this.relation = i, this.schemaName = t, this.tableName = e, this.fieldNames = r, this.fields = [], this.ref = o, this.dbState = this.ref.dbState, this.generateId();
8
+ let s = o.schema.database.findOrCreateSchema(t || "public").database.findTable(t, e);
9
+ s || this.error(`Can't find table ${n(t) ? `"${t}".` : ""}"${e}"`), this.setFields(r, s);
10
10
  }
11
11
  generateId() {
12
12
  this.id = this.dbState.generateId("endpointId");
@@ -36,19 +36,19 @@ var r = class extends n {
36
36
  relation: this.relation
37
37
  };
38
38
  }
39
- setFields(t, n) {
40
- let r = t && t.length ? [...t] : [];
39
+ setFields(e, n) {
40
+ let r = e && e.length ? [...e] : [];
41
41
  if (!r.length) {
42
- let t = n.fields.find((e) => e.pk);
43
- if (t) r.push(t.name);
42
+ let e = n.fields.find((e) => e.pk);
43
+ if (e) r.push(e.name);
44
44
  else {
45
- let t = n.indexes.find((e) => e.pk);
46
- t ? r = t.columns.map((e) => e.value) : this.error(`Can't find primary or composite key in table ${e(n.schema) ? `"${n.schema.name}".` : ""}"${n.name}"`);
45
+ let e = n.indexes.find((e) => e.pk);
46
+ e ? r = e.columns.map((e) => e.value) : this.error(`Can't find primary or composite key in table ${t(n.schema) ? `"${n.schema.name}".` : ""}"${n.name}"`);
47
47
  }
48
48
  }
49
- r.forEach((t) => {
50
- let r = n.findField(t);
51
- r || this.error(`Can't find field ${e(n.schema) ? `"${n.schema.name}".` : ""}"${t}" in table "${n.name}"`), this.fields.push(r), r.pushEndpoint(this);
49
+ r.forEach((e) => {
50
+ let r = n.findField(e);
51
+ r || this.error(`Can't find field ${t(n.schema) ? `"${n.schema.name}".` : ""}"${e}" in table "${n.name}"`), this.fields.push(r), r.pushEndpoint(this);
52
52
  });
53
53
  }
54
54
  normalize(e) {
@@ -59,5 +59,4 @@ var r = class extends n {
59
59
  };
60
60
  }
61
61
  };
62
- //#endregion
63
62
  export { r as default };
@@ -1 +1 @@
1
- require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs"),n=require("./utils.cjs"),r=require("./element.cjs"),i=require("./enumValue.cjs");t.init_lodash();var a=class extends r.default{constructor({name:t,token:n,values:r,note:i,schema:a,noteToken:o=null}={}){super(n),t||this.error(`Enum must have a name`),this.name=t,this.note=i?e.default(i,`value`,i):null,this.noteToken=i?e.default(i,`token`,o):null,this.values=[],this.fields=[],this.schema=a,this.dbState=this.schema.dbState,this.generateId(),this.processValues(r)}generateId(){this.id=this.dbState.generateId(`enumId`)}processValues(e){e.forEach(e=>{this.pushValue(new i.default({...e,_enum:this}))})}pushValue(e){this.checkValue(e),this.values.push(e)}checkValue(e){this.values.some(t=>t.name===e.name)&&e.error(`Enum value "${e.name}" existed in enum ${n.shouldPrintSchema(this.schema)?`"${this.schema.name}".`:``}"${this.name}"`)}pushField(e){this.checkField(e),this.fields.push(e)}checkField(e){this.fields.some(t=>t.id===e.id)&&this.error(`Field ${n.shouldPrintSchema(e.table.schema)?`"${e.table.schema.name}".`:``}"${e.table.name}"."${e.name}" already associated with enum ${n.shouldPrintSchema(this.schema)?`"${this.schema.name}".`:``}${this.name}"`)}export(){return{...this.shallowExport(),...this.exportChild()}}exportChild(){return{values:this.values.map(e=>e.export())}}exportChildIds(){return{valueIds:this.values.map(e=>e.id),fieldIds:this.fields.map(e=>e.id)}}exportParentIds(){return{schemaId:this.schema.id}}shallowExport(){return{name:this.name,note:this.note}}normalize(e){e.enums[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.values.forEach(t=>t.normalize(e))}};exports.default=a;
1
+ require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs"),n=require("./element.cjs"),r=require("./enumValue.cjs"),i=require("./utils.cjs");t.init_lodash();var a=class extends n.default{constructor({name:t,token:n,values:r,note:i,schema:a,noteToken:o=null}={}){super(n),t||this.error(`Enum must have a name`),this.name=t,this.note=i?e.default(i,`value`,i):null,this.noteToken=i?e.default(i,`token`,o):null,this.values=[],this.fields=[],this.schema=a,this.dbState=this.schema.dbState,this.generateId(),this.processValues(r)}generateId(){this.id=this.dbState.generateId(`enumId`)}processValues(e){e.forEach(e=>{this.pushValue(new r.default({...e,_enum:this}))})}pushValue(e){this.checkValue(e),this.values.push(e)}checkValue(e){this.values.some(t=>t.name===e.name)&&e.error(`Enum value "${e.name}" existed in enum ${i.shouldPrintSchema(this.schema)?`"${this.schema.name}".`:``}"${this.name}"`)}pushField(e){this.checkField(e),this.fields.push(e)}checkField(e){this.fields.some(t=>t.id===e.id)&&this.error(`Field ${i.shouldPrintSchema(e.table.schema)?`"${e.table.schema.name}".`:``}"${e.table.name}"."${e.name}" already associated with enum ${i.shouldPrintSchema(this.schema)?`"${this.schema.name}".`:``}${this.name}"`)}export(){return{...this.shallowExport(),...this.exportChild()}}exportChild(){return{values:this.values.map(e=>e.export())}}exportChildIds(){return{valueIds:this.values.map(e=>e.id),fieldIds:this.fields.map(e=>e.id)}}exportParentIds(){return{schemaId:this.schema.id}}shallowExport(){return{name:this.name,note:this.note}}normalize(e){e.enums[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.values.forEach(t=>t.normalize(e))}};exports.default=a;
@@ -1,11 +1,11 @@
1
1
  import e from "../node_modules/lodash-es/get.mjs";
2
2
  import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
3
- import { shouldPrintSchema as n } from "./utils.mjs";
4
- import r from "./element.mjs";
5
- import i from "./enumValue.mjs";
6
- //#region src/model_structure/enum.js
3
+ import n from "./element.mjs";
4
+ import r from "./enumValue.mjs";
5
+ import { shouldPrintSchema as i } from "./utils.mjs";
6
+ // src/model_structure/enum.js
7
7
  t();
8
- var a = class extends r {
8
+ var a = class extends n {
9
9
  constructor({ name: t, token: n, values: r, note: i, schema: a, noteToken: o = null } = {}) {
10
10
  super(n), t || this.error("Enum must have a name"), this.name = t, this.note = i ? e(i, "value", i) : null, this.noteToken = i ? e(i, "token", o) : null, this.values = [], this.fields = [], this.schema = a, this.dbState = this.schema.dbState, this.generateId(), this.processValues(r);
11
11
  }
@@ -14,7 +14,7 @@ var a = class extends r {
14
14
  }
15
15
  processValues(e) {
16
16
  e.forEach((e) => {
17
- this.pushValue(new i({
17
+ this.pushValue(new r({
18
18
  ...e,
19
19
  _enum: this
20
20
  }));
@@ -24,13 +24,13 @@ var a = class extends r {
24
24
  this.checkValue(e), this.values.push(e);
25
25
  }
26
26
  checkValue(e) {
27
- this.values.some((t) => t.name === e.name) && e.error(`Enum value "${e.name}" existed in enum ${n(this.schema) ? `"${this.schema.name}".` : ""}"${this.name}"`);
27
+ this.values.some((t) => t.name === e.name) && e.error(`Enum value "${e.name}" existed in enum ${i(this.schema) ? `"${this.schema.name}".` : ""}"${this.name}"`);
28
28
  }
29
29
  pushField(e) {
30
30
  this.checkField(e), this.fields.push(e);
31
31
  }
32
32
  checkField(e) {
33
- this.fields.some((t) => t.id === e.id) && this.error(`Field ${n(e.table.schema) ? `"${e.table.schema.name}".` : ""}"${e.table.name}"."${e.name}" already associated with enum ${n(this.schema) ? `"${this.schema.name}".` : ""}${this.name}"`);
33
+ this.fields.some((t) => t.id === e.id) && this.error(`Field ${i(e.table.schema) ? `"${e.table.schema.name}".` : ""}"${e.table.name}"."${e.name}" already associated with enum ${i(this.schema) ? `"${this.schema.name}".` : ""}${this.name}"`);
34
34
  }
35
35
  export() {
36
36
  return {
@@ -65,5 +65,4 @@ var a = class extends r {
65
65
  }, this.values.forEach((t) => t.normalize(e));
66
66
  }
67
67
  };
68
- //#endregion
69
68
  export { a as default };
@@ -1,7 +1,7 @@
1
1
  import e from "../node_modules/lodash-es/get.mjs";
2
2
  import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
3
3
  import n from "./element.mjs";
4
- //#region src/model_structure/enumValue.js
4
+ // src/model_structure/enumValue.js
5
5
  t();
6
6
  var r = class extends n {
7
7
  constructor({ name: t, token: n, note: r, _enum: i, noteToken: a = null } = {}) {
@@ -30,5 +30,4 @@ var r = class extends n {
30
30
  };
31
31
  }
32
32
  };
33
- //#endregion
34
33
  export { r as default };
@@ -1 +1 @@
1
- require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs");require("./config.cjs");const n=require("./element.cjs"),r=require("./check.cjs");t.init_lodash();var i=class extends n.default{constructor({name:t,type:n,unique:r,pk:i,token:a,not_null:o,note:s,dbdefault:c,increment:l,checks:u=[],table:d={},noteToken:f=null,injectedPartial:p=null,injectedToken:m=null,metadata:h={}}){super(a),t||this.error(`Field must have a name`),n||this.error(`Field must have a type`),this.name=t,this.type=n,this.unique=r,this.pk=i,this.not_null=o,this.note=s?e.default(s,`value`,s):null,this.noteToken=s?e.default(s,`token`,f):null,this.dbdefault=c,this.increment=l,this.checks=[],this.endpoints=[],this.depEdges=[],this.table=d,this.injectedPartial=p,this.injectedToken=m,this.dbState=this.table.dbState,this.metadata=h,this.generateId(),this.bindType(),this.processChecks(u)}generateId(){this.id=this.dbState.generateId(`fieldId`)}bindType(){let e=this.type.type_name,t=this.type.schemaName||`public`;if(this.type.schemaName){let n=this.table.schema.database.findEnum(t,e);if(!n){this.type.type_name=`${t}.${e}`,this.type.originalTypeName=e;return}this._enum=n,n.pushField(this)}else{let n=this.table.schema.database.findEnum(t,e);if(!n)return;this._enum=n,n.pushField(this)}}pushEndpoint(e){this.endpoints.push(e)}pushDepEdge(e){this.depEdges.push(e)}export(){return{...this.shallowExport()}}exportParentIds(){return{tableId:this.table.id,enumId:this._enum?this._enum.id:null}}exportChildIds(){return{endpointIds:this.endpoints.map(e=>e.id),depEdgeIds:this.depEdges.map(e=>e.id)}}shallowExport(){return{name:this.name,type:this.type,unique:this.unique,pk:this.pk,not_null:this.not_null,note:this.note,dbdefault:this.dbdefault,increment:this.increment,injectedPartialId:this.injectedPartial?.id??null,checkIds:this.checks.map(e=>e.id),metadata:this.metadata}}normalize(e){e.fields[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.checks.forEach(t=>t.normalize(e))}processChecks(e){e.forEach(e=>{this.checks.push(new r.default({...e,table:this.table,column:this}))})}};exports.default=i;
1
+ require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs"),n=require("./check.cjs");require("./config.cjs");const r=require("./element.cjs");t.init_lodash();var i=class extends r.default{constructor({name:t,type:n,unique:r,pk:i,token:a,not_null:o,note:s,dbdefault:c,increment:l,checks:u=[],table:d={},noteToken:f=null,injectedPartial:p=null,injectedToken:m=null,metadata:h={}}){super(a),t||this.error(`Field must have a name`),n||this.error(`Field must have a type`),this.name=t,this.type=n,this.unique=r,this.pk=i,this.not_null=o,this.note=s?e.default(s,`value`,s):null,this.noteToken=s?e.default(s,`token`,f):null,this.dbdefault=c,this.increment=l,this.checks=[],this.endpoints=[],this.depEdges=[],this.table=d,this.injectedPartial=p,this.injectedToken=m,this.dbState=this.table.dbState,this.metadata=h,this.generateId(),this.bindType(),this.processChecks(u)}generateId(){this.id=this.dbState.generateId(`fieldId`)}bindType(){let e=this.type.type_name,t=this.type.schemaName||`public`;if(this.type.schemaName){let n=this.table.schema.database.findEnum(t,e);if(!n){this.type.type_name=`${t}.${e}`,this.type.originalTypeName=e;return}this._enum=n,n.pushField(this)}else{let n=this.table.schema.database.findEnum(t,e);if(!n)return;this._enum=n,n.pushField(this)}}pushEndpoint(e){this.endpoints.push(e)}pushDepEdge(e){this.depEdges.push(e)}export(){return{...this.shallowExport()}}exportParentIds(){return{tableId:this.table.id,enumId:this._enum?this._enum.id:null}}exportChildIds(){return{endpointIds:this.endpoints.map(e=>e.id),depEdgeIds:this.depEdges.map(e=>e.id)}}shallowExport(){return{name:this.name,type:this.type,unique:this.unique,pk:this.pk,not_null:this.not_null,note:this.note,dbdefault:this.dbdefault,increment:this.increment,injectedPartialId:this.injectedPartial?.id??null,checkIds:this.checks.map(e=>e.id),metadata:this.metadata}}normalize(e){e.fields[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.checks.forEach(t=>t.normalize(e))}processChecks(e){e.forEach(e=>{this.checks.push(new n.default({...e,table:this.table,column:this}))})}};exports.default=i;
@@ -1,11 +1,11 @@
1
1
  import e from "../node_modules/lodash-es/get.mjs";
2
2
  import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
3
+ import n from "./check.mjs";
3
4
  import "./config.mjs";
4
- import n from "./element.mjs";
5
- import r from "./check.mjs";
6
- //#region src/model_structure/field.ts
5
+ import r from "./element.mjs";
6
+ // src/model_structure/field.ts
7
7
  t();
8
- var i = class extends n {
8
+ var i = class extends r {
9
9
  constructor({ name: t, type: n, unique: r, pk: i, token: a, not_null: o, note: s, dbdefault: c, increment: l, checks: u = [], table: d = {}, noteToken: f = null, injectedPartial: p = null, injectedToken: m = null, metadata: h = {} }) {
10
10
  super(a), t || this.error("Field must have a name"), n || this.error("Field must have a type"), this.name = t, this.type = n, this.unique = r, this.pk = i, this.not_null = o, this.note = s ? e(s, "value", s) : null, this.noteToken = s ? e(s, "token", f) : null, this.dbdefault = c, this.increment = l, this.checks = [], this.endpoints = [], this.depEdges = [], this.table = d, this.injectedPartial = p, this.injectedToken = m, this.dbState = this.table.dbState, this.metadata = h, this.generateId(), this.bindType(), this.processChecks(u);
11
11
  }
@@ -73,7 +73,7 @@ var i = class extends n {
73
73
  }
74
74
  processChecks(e) {
75
75
  e.forEach((e) => {
76
- this.checks.push(new r({
76
+ this.checks.push(new n({
77
77
  ...e,
78
78
  table: this.table,
79
79
  column: this
@@ -81,5 +81,4 @@ var i = class extends n {
81
81
  });
82
82
  }
83
83
  };
84
- //#endregion
85
84
  export { i as default };
@@ -1,5 +1,5 @@
1
1
  import e from "./element.mjs";
2
- //#region src/model_structure/group.ts
2
+ // src/model_structure/group.ts
3
3
  var t = class extends e {
4
4
  constructor({ name: e, alias: t, children: n, settings: r, metadata: i = {}, note: a, token: o, database: s }) {
5
5
  super(o), this.name = e, this.alias = t, this.children = n, this.childIds = [], this.childTypes = [], this.settings = r, this.metadata = i, this.note = a?.value ?? null, this.noteToken = a?.token ?? null, this.groupId = null, this.database = s, this.dbState = s.dbState, this.generateId();
@@ -26,5 +26,4 @@ var t = class extends e {
26
26
  };
27
27
  }
28
28
  };
29
- //#endregion
30
29
  export { t as default };
@@ -1,5 +1,5 @@
1
1
  import e from "./element.mjs";
2
- //#region src/model_structure/indexColumn.js
2
+ // src/model_structure/indexColumn.js
3
3
  var t = class extends e {
4
4
  constructor({ type: e, value: t, sortOrder: n, index: r, token: i }) {
5
5
  super(), this.type = e, this.value = t, this.sortOrder = n, this.index = r, this.token = i, this.dbState = this.index.dbState, this.generateId();
@@ -28,5 +28,4 @@ var t = class extends e {
28
28
  };
29
29
  }
30
30
  };
31
- //#endregion
32
31
  export { t as default };
@@ -1,6 +1,6 @@
1
1
  import e from "./element.mjs";
2
2
  import t from "./indexColumn.mjs";
3
- //#region src/model_structure/indexes.js
3
+ // src/model_structure/indexes.js
4
4
  var n = class extends e {
5
5
  constructor({ columns: e, type: t, unique: n, pk: r, token: i, name: a, note: o, table: s = {}, injectedPartial: c = null } = {}) {
6
6
  super(i), this.name = a, this.type = t, this.unique = n, this.note = o ? o.value : null, this.noteToken = o ? o.token : null, this.pk = r, this.columns = [], this.table = s, this.injectedPartial = c, this.dbState = this.table.dbState, this.generateId(), this.processIndexColumns(e);
@@ -58,5 +58,4 @@ var n = class extends e {
58
58
  }, this.columns.forEach((t) => t.normalize(e));
59
59
  }
60
60
  };
61
- //#endregion
62
61
  export { n as default };
@@ -1,5 +1,5 @@
1
1
  import e from "./element.mjs";
2
- //#region src/model_structure/link.ts
2
+ // src/model_structure/link.ts
3
3
  var t = class extends e {
4
4
  constructor({ fromId: e, fromType: t, toId: n, toType: r, op: i, settings: a, token: o, database: s }) {
5
5
  super(o), this.fromId = e, this.fromType = t, this.toId = n, this.toType = r, this.op = i, this.settings = a, this.database = s, this.dbState = s.dbState, this.generateId();
@@ -24,5 +24,4 @@ var t = class extends e {
24
24
  };
25
25
  }
26
26
  };
27
- //#endregion
28
27
  export { t as default };
@@ -1,5 +1,5 @@
1
1
  import e from "./element.mjs";
2
- //#region src/model_structure/node.ts
2
+ // src/model_structure/node.ts
3
3
  var t = class extends e {
4
4
  constructor({ name: e, alias: t, role: n, type: r, icon: i, settings: a, metadata: o = {}, note: s, token: c, database: l }) {
5
5
  super(c), this.name = e, this.alias = t, this.role = n, this.type = r, this.icon = i, this.settings = a, this.metadata = o, this.note = s?.value ?? null, this.noteToken = s?.token ?? null, this.groupId = null, this.database = l, this.dbState = l.dbState, this.generateId();
@@ -27,5 +27,4 @@ var t = class extends e {
27
27
  };
28
28
  }
29
29
  };
30
- //#endregion
31
30
  export { t as default };
@@ -1,7 +1,7 @@
1
1
  import "./config.mjs";
2
2
  import e from "./element.mjs";
3
3
  import t from "./endpoint.mjs";
4
- //#region src/model_structure/ref.js
4
+ // src/model_structure/ref.js
5
5
  function n(e, t) {
6
6
  return e[0].equals(t[0]) && e[1].equals(t[1]);
7
7
  }
@@ -57,5 +57,4 @@ var r = class extends e {
57
57
  }, this.endpoints.forEach((t) => t.normalize(e));
58
58
  }
59
59
  };
60
- //#endregion
61
60
  export { r as default };
@@ -1 +1 @@
1
- require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs"),n=require("./utils.cjs"),r=require("./element.cjs"),i=require("./dep.cjs"),a=require("./enum.cjs"),o=require("./ref.cjs"),s=require("./table.cjs"),c=require("./tableGroup.cjs");t.init_lodash();var l=class extends r.default{constructor({name:t,alias:n,note:r,tables:i=[],refs:a=[],deps:o=[],enums:s=[],tableGroups:c=[],token:l,database:u={},noteToken:d=null}={}){super(l),this.tables=[],this.enums=[],this.tableGroups=[],this.refs=[],this.deps=[],this.name=t,this.note=r?e.default(r,`value`,typeof r==`string`?r:null):null,this.noteToken=r?e.default(r,`token`,d):null,this.alias=n,this.database=u,this.dbState=this.database.dbState,this.generateId(),this.processEnums(s),this.processTables(i),this.processRefs(a),this.processDeps(o),this.processTableGroups(c)}generateId(){this.id=this.dbState.generateId(`schemaId`)}processTables(e){e.forEach(e=>{this.pushTable(new s.default({...e,schema:this}))})}pushTable(e){this.checkTable(e),this.tables.push(e)}checkTable(e){this.tables.some(t=>t.name===e.name)&&e.error(`Table ${n.shouldPrintSchema(this)?`"${this.name}".`:``}"${e.name}" existed`)}findTable(e){return this.tables.find(t=>t.name===e)}processEnums(e){e.forEach(e=>{this.pushEnum(new a.default({...e,schema:this}))})}pushEnum(e){this.checkEnum(e),this.enums.push(e)}checkEnum(e){this.enums.some(t=>t.name===e.name)&&e.error(`Enum ${n.shouldPrintSchema(this)?`"${this.name}".`:``}"${e.name}" existed`)}processRefs(e){e.forEach(e=>{this.pushRef(new o.default({...e,schema:this}))})}pushRef(e){this.checkRef(e),this.refs.push(e)}checkRef(e){if(this.refs.some(t=>t.equals(e))){let t=e.endpoints[0],n=t.fieldNames.map(e=>JSON.stringify(e)).join(`, `),r=e.endpoints[1],i=r.fieldNames.map(e=>JSON.stringify(e)).join(`, `),a=`"${t.schemaName?`${t.schemaName}"."`:``}${t.tableName}"(${n})`,o=`"${r.schemaName?`${r.schemaName}"."`:``}${r.tableName}"(${i})`;e.error(`Reference with the same endpoints already exists: ${a} references ${o}`)}}processDeps(e){e.forEach(e=>{this.pushDep(new i.default({...e,schema:this}))})}pushDep(e){this.deps.push(e)}processTableGroups(e){e.forEach(e=>{this.pushTableGroup(new c.default({...e,schema:this}))})}pushTableGroup(e){this.checkTableGroup(e),this.tableGroups.push(e)}checkTableGroup(e){this.tableGroups.some(t=>t.name===e.name)&&e.error(`Table Group ${n.shouldPrintSchema(this)?`"${this.name}".`:``}"${e.name}" existed`)}checkSameId(e){return this.name===e.name||this.alias===e.name||this.name===e.alias||!!this.alias&&this.alias===e.alias}export(){return{...this.shallowExport(),...this.exportChild()}}exportChild(){return{tables:this.tables.map(e=>e.export()),enums:this.enums.map(e=>e.export()),tableGroups:this.tableGroups.map(e=>e.export()),refs:this.refs.map(e=>e.export()),deps:this.deps.map(e=>e.export())}}exportChildIds(){return{tableIds:this.tables.map(e=>e.id),enumIds:this.enums.map(e=>e.id),tableGroupIds:this.tableGroups.map(e=>e.id),refIds:this.refs.map(e=>e.id),depIds:this.deps.map(e=>e.id)}}exportParentIds(){return{databaseId:this.database.id}}shallowExport(){return{name:this.name,note:this.note,alias:this.alias}}normalize(e){e.schemas[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.tables.forEach(t=>t.normalize(e)),this.enums.forEach(t=>t.normalize(e)),this.tableGroups.forEach(t=>t.normalize(e)),this.refs.forEach(t=>t.normalize(e)),this.deps.forEach(t=>t.normalize(e))}};exports.default=l;
1
+ require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs"),n=require("./dep.cjs"),r=require("./element.cjs"),i=require("./enum.cjs"),a=require("./ref.cjs"),o=require("./table.cjs"),s=require("./tableGroup.cjs"),c=require("./utils.cjs");t.init_lodash();var l=class extends r.default{constructor({name:t,alias:n,note:r,tables:i=[],refs:a=[],deps:o=[],enums:s=[],tableGroups:c=[],token:l,database:u={},noteToken:d=null}={}){super(l),this.tables=[],this.enums=[],this.tableGroups=[],this.refs=[],this.deps=[],this.name=t,this.note=r?e.default(r,`value`,typeof r==`string`?r:null):null,this.noteToken=r?e.default(r,`token`,d):null,this.alias=n,this.database=u,this.dbState=this.database.dbState,this.generateId(),this.processEnums(s),this.processTables(i),this.processRefs(a),this.processDeps(o),this.processTableGroups(c)}generateId(){this.id=this.dbState.generateId(`schemaId`)}processTables(e){e.forEach(e=>{this.pushTable(new o.default({...e,schema:this}))})}pushTable(e){this.checkTable(e),this.tables.push(e)}checkTable(e){this.tables.some(t=>t.name===e.name)&&e.error(`Table ${c.shouldPrintSchema(this)?`"${this.name}".`:``}"${e.name}" existed`)}findTable(e){return this.tables.find(t=>t.name===e)}processEnums(e){e.forEach(e=>{this.pushEnum(new i.default({...e,schema:this}))})}pushEnum(e){this.checkEnum(e),this.enums.push(e)}checkEnum(e){this.enums.some(t=>t.name===e.name)&&e.error(`Enum ${c.shouldPrintSchema(this)?`"${this.name}".`:``}"${e.name}" existed`)}processRefs(e){e.forEach(e=>{this.pushRef(new a.default({...e,schema:this}))})}pushRef(e){this.checkRef(e),this.refs.push(e)}checkRef(e){if(this.refs.some(t=>t.equals(e))){let t=e.endpoints[0],n=t.fieldNames.map(e=>JSON.stringify(e)).join(`, `),r=e.endpoints[1],i=r.fieldNames.map(e=>JSON.stringify(e)).join(`, `),a=`"${t.schemaName?`${t.schemaName}"."`:``}${t.tableName}"(${n})`,o=`"${r.schemaName?`${r.schemaName}"."`:``}${r.tableName}"(${i})`;e.error(`Reference with the same endpoints already exists: ${a} references ${o}`)}}processDeps(e){e.forEach(e=>{this.pushDep(new n.default({...e,schema:this}))})}pushDep(e){this.deps.push(e)}processTableGroups(e){e.forEach(e=>{this.pushTableGroup(new s.default({...e,schema:this}))})}pushTableGroup(e){this.checkTableGroup(e),this.tableGroups.push(e)}checkTableGroup(e){this.tableGroups.some(t=>t.name===e.name)&&e.error(`Table Group ${c.shouldPrintSchema(this)?`"${this.name}".`:``}"${e.name}" existed`)}checkSameId(e){return this.name===e.name||this.alias===e.name||this.name===e.alias||!!this.alias&&this.alias===e.alias}export(){return{...this.shallowExport(),...this.exportChild()}}exportChild(){return{tables:this.tables.map(e=>e.export()),enums:this.enums.map(e=>e.export()),tableGroups:this.tableGroups.map(e=>e.export()),refs:this.refs.map(e=>e.export()),deps:this.deps.map(e=>e.export())}}exportChildIds(){return{tableIds:this.tables.map(e=>e.id),enumIds:this.enums.map(e=>e.id),tableGroupIds:this.tableGroups.map(e=>e.id),refIds:this.refs.map(e=>e.id),depIds:this.deps.map(e=>e.id)}}exportParentIds(){return{databaseId:this.database.id}}shallowExport(){return{name:this.name,note:this.note,alias:this.alias}}normalize(e){e.schemas[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.tables.forEach(t=>t.normalize(e)),this.enums.forEach(t=>t.normalize(e)),this.tableGroups.forEach(t=>t.normalize(e)),this.refs.forEach(t=>t.normalize(e)),this.deps.forEach(t=>t.normalize(e))}};exports.default=l;
@@ -1,13 +1,13 @@
1
1
  import e from "../node_modules/lodash-es/get.mjs";
2
2
  import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
3
- import { shouldPrintSchema as n } from "./utils.mjs";
3
+ import n from "./dep.mjs";
4
4
  import r from "./element.mjs";
5
- import i from "./dep.mjs";
6
- import a from "./enum.mjs";
7
- import o from "./ref.mjs";
8
- import s from "./table.mjs";
9
- import c from "./tableGroup.mjs";
10
- //#region src/model_structure/schema.ts
5
+ import i from "./enum.mjs";
6
+ import a from "./ref.mjs";
7
+ import o from "./table.mjs";
8
+ import s from "./tableGroup.mjs";
9
+ import { shouldPrintSchema as c } from "./utils.mjs";
10
+ // src/model_structure/schema.ts
11
11
  t();
12
12
  var l = class extends r {
13
13
  constructor({ name: t, alias: n, note: r, tables: i = [], refs: a = [], deps: o = [], enums: s = [], tableGroups: c = [], token: l, database: u = {}, noteToken: d = null } = {}) {
@@ -18,7 +18,7 @@ var l = class extends r {
18
18
  }
19
19
  processTables(e) {
20
20
  e.forEach((e) => {
21
- this.pushTable(new s({
21
+ this.pushTable(new o({
22
22
  ...e,
23
23
  schema: this
24
24
  }));
@@ -28,14 +28,14 @@ var l = class extends r {
28
28
  this.checkTable(e), this.tables.push(e);
29
29
  }
30
30
  checkTable(e) {
31
- this.tables.some((t) => t.name === e.name) && e.error(`Table ${n(this) ? `"${this.name}".` : ""}"${e.name}" existed`);
31
+ this.tables.some((t) => t.name === e.name) && e.error(`Table ${c(this) ? `"${this.name}".` : ""}"${e.name}" existed`);
32
32
  }
33
33
  findTable(e) {
34
34
  return this.tables.find((t) => t.name === e);
35
35
  }
36
36
  processEnums(e) {
37
37
  e.forEach((e) => {
38
- this.pushEnum(new a({
38
+ this.pushEnum(new i({
39
39
  ...e,
40
40
  schema: this
41
41
  }));
@@ -45,11 +45,11 @@ var l = class extends r {
45
45
  this.checkEnum(e), this.enums.push(e);
46
46
  }
47
47
  checkEnum(e) {
48
- this.enums.some((t) => t.name === e.name) && e.error(`Enum ${n(this) ? `"${this.name}".` : ""}"${e.name}" existed`);
48
+ this.enums.some((t) => t.name === e.name) && e.error(`Enum ${c(this) ? `"${this.name}".` : ""}"${e.name}" existed`);
49
49
  }
50
50
  processRefs(e) {
51
51
  e.forEach((e) => {
52
- this.pushRef(new o({
52
+ this.pushRef(new a({
53
53
  ...e,
54
54
  schema: this
55
55
  }));
@@ -66,7 +66,7 @@ var l = class extends r {
66
66
  }
67
67
  processDeps(e) {
68
68
  e.forEach((e) => {
69
- this.pushDep(new i({
69
+ this.pushDep(new n({
70
70
  ...e,
71
71
  schema: this
72
72
  }));
@@ -77,7 +77,7 @@ var l = class extends r {
77
77
  }
78
78
  processTableGroups(e) {
79
79
  e.forEach((e) => {
80
- this.pushTableGroup(new c({
80
+ this.pushTableGroup(new s({
81
81
  ...e,
82
82
  schema: this
83
83
  }));
@@ -87,7 +87,7 @@ var l = class extends r {
87
87
  this.checkTableGroup(e), this.tableGroups.push(e);
88
88
  }
89
89
  checkTableGroup(e) {
90
- this.tableGroups.some((t) => t.name === e.name) && e.error(`Table Group ${n(this) ? `"${this.name}".` : ""}"${e.name}" existed`);
90
+ this.tableGroups.some((t) => t.name === e.name) && e.error(`Table Group ${c(this) ? `"${this.name}".` : ""}"${e.name}" existed`);
91
91
  }
92
92
  checkSameId(e) {
93
93
  return this.name === e.name || this.alias === e.name || this.name === e.alias || !!this.alias && this.alias === e.alias;
@@ -135,5 +135,4 @@ var l = class extends r {
135
135
  }, this.tables.forEach((t) => t.normalize(e)), this.enums.forEach((t) => t.normalize(e)), this.tableGroups.forEach((t) => t.normalize(e)), this.refs.forEach((t) => t.normalize(e)), this.deps.forEach((t) => t.normalize(e));
136
136
  }
137
137
  };
138
- //#endregion
139
138
  export { l as default };
@@ -1,5 +1,5 @@
1
1
  import e from "./element.mjs";
2
- //#region src/model_structure/stickyNote.ts
2
+ // src/model_structure/stickyNote.ts
3
3
  var t = class extends e {
4
4
  constructor({ name: e, content: t, color: n, token: r, database: i = {}, metadata: a = {} }) {
5
5
  super(r), this.name = e, this.content = t, this.color = n, this.metadata = a, this.database = i, this.dbState = this.database.dbState, this.generateId();
@@ -22,5 +22,4 @@ var t = class extends e {
22
22
  };
23
23
  }
24
24
  };
25
- //#endregion
26
25
  export { t as default };