@dbml/core 11.0.2-arch.0.2 → 11.0.2-arch.0.3
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.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/lib/_virtual/_rolldown/runtime.cjs +1 -1
- package/lib/_virtual/_rolldown/runtime.mjs +3 -2
- package/lib/export/DbmlExporter.cjs +1 -1
- package/lib/export/DbmlExporter.mjs +3 -2
- package/lib/export/JsonExporter.mjs +2 -1
- package/lib/export/ModelExporter.cjs +1 -1
- package/lib/export/ModelExporter.mjs +10 -9
- package/lib/export/MysqlExporter.mjs +2 -1
- package/lib/export/OracleExporter.mjs +2 -1
- package/lib/export/PostgresExporter.cjs +8 -8
- package/lib/export/PostgresExporter.mjs +31 -30
- package/lib/export/SqlServerExporter.mjs +2 -1
- package/lib/export/index.cjs +1 -1
- package/lib/export/index.mjs +6 -5
- package/lib/export/utils.mjs +2 -1
- package/lib/import/index.cjs +1 -1
- package/lib/import/index.mjs +11 -10
- package/lib/index.cjs +1 -1
- package/lib/index.mjs +5 -5
- package/lib/model_structure/check.mjs +2 -1
- package/lib/model_structure/config.mjs +2 -1
- package/lib/model_structure/database.cjs +1 -1
- package/lib/model_structure/database.mjs +15 -14
- package/lib/model_structure/dbState.mjs +2 -1
- package/lib/model_structure/dep.cjs +1 -1
- package/lib/model_structure/dep.mjs +7 -6
- package/lib/model_structure/depEdge.cjs +1 -1
- package/lib/model_structure/depEdge.mjs +11 -10
- package/lib/model_structure/element.mjs +2 -1
- package/lib/model_structure/endpoint.cjs +1 -1
- package/lib/model_structure/endpoint.mjs +18 -17
- package/lib/model_structure/enum.cjs +1 -1
- package/lib/model_structure/enum.mjs +9 -8
- package/lib/model_structure/enumValue.mjs +2 -1
- package/lib/model_structure/field.cjs +1 -1
- package/lib/model_structure/field.mjs +6 -5
- package/lib/model_structure/group.mjs +2 -1
- package/lib/model_structure/indexColumn.mjs +2 -1
- package/lib/model_structure/indexes.mjs +2 -1
- package/lib/model_structure/link.mjs +2 -1
- package/lib/model_structure/node.mjs +2 -1
- package/lib/model_structure/ref.mjs +2 -1
- package/lib/model_structure/schema.cjs +1 -1
- package/lib/model_structure/schema.mjs +16 -15
- package/lib/model_structure/stickyNote.mjs +2 -1
- package/lib/model_structure/table.cjs +1 -1
- package/lib/model_structure/table.mjs +29 -28
- package/lib/model_structure/tableGroup.cjs +1 -1
- package/lib/model_structure/tableGroup.mjs +6 -5
- package/lib/model_structure/tablePartial.mjs +2 -1
- package/lib/model_structure/utils.mjs +2 -1
- package/lib/node_modules/antlr4/dist/antlr4.web.mjs +2 -1
- package/lib/node_modules/lodash-es/_DataView.cjs +1 -1
- package/lib/node_modules/lodash-es/_DataView.mjs +5 -4
- package/lib/node_modules/lodash-es/_Hash.mjs +2 -1
- package/lib/node_modules/lodash-es/_ListCache.mjs +2 -1
- package/lib/node_modules/lodash-es/_Map.cjs +1 -1
- package/lib/node_modules/lodash-es/_Map.mjs +5 -4
- package/lib/node_modules/lodash-es/_MapCache.mjs +2 -1
- package/lib/node_modules/lodash-es/_Promise.cjs +1 -1
- package/lib/node_modules/lodash-es/_Promise.mjs +5 -4
- package/lib/node_modules/lodash-es/_Set.cjs +1 -1
- package/lib/node_modules/lodash-es/_Set.mjs +5 -4
- package/lib/node_modules/lodash-es/_SetCache.mjs +2 -1
- package/lib/node_modules/lodash-es/_Stack.mjs +2 -1
- package/lib/node_modules/lodash-es/_Symbol.mjs +2 -1
- package/lib/node_modules/lodash-es/_Uint8Array.mjs +2 -1
- package/lib/node_modules/lodash-es/_WeakMap.cjs +1 -1
- package/lib/node_modules/lodash-es/_WeakMap.mjs +5 -4
- package/lib/node_modules/lodash-es/_arrayAggregator.mjs +2 -1
- package/lib/node_modules/lodash-es/_arrayEach.mjs +2 -1
- package/lib/node_modules/lodash-es/_arrayFilter.mjs +2 -1
- package/lib/node_modules/lodash-es/_arrayLikeKeys.cjs +1 -1
- package/lib/node_modules/lodash-es/_arrayLikeKeys.mjs +10 -9
- package/lib/node_modules/lodash-es/_arrayMap.mjs +2 -1
- package/lib/node_modules/lodash-es/_arrayPush.mjs +2 -1
- package/lib/node_modules/lodash-es/_arrayReduce.mjs +2 -1
- package/lib/node_modules/lodash-es/_arraySome.mjs +2 -1
- package/lib/node_modules/lodash-es/_asciiToArray.mjs +2 -1
- package/lib/node_modules/lodash-es/_assocIndexOf.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseAggregator.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseAssignValue.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseEach.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseFlatten.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseFor.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseForOwn.cjs +1 -1
- package/lib/node_modules/lodash-es/_baseForOwn.mjs +6 -5
- package/lib/node_modules/lodash-es/_baseGet.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseGetAllKeys.cjs +1 -1
- package/lib/node_modules/lodash-es/_baseGetAllKeys.mjs +6 -5
- package/lib/node_modules/lodash-es/_baseGetTag.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseHasIn.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseIsArguments.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseIsEqual.cjs +1 -1
- package/lib/node_modules/lodash-es/_baseIsEqual.mjs +6 -5
- package/lib/node_modules/lodash-es/_baseIsEqualDeep.cjs +1 -1
- package/lib/node_modules/lodash-es/_baseIsEqualDeep.mjs +16 -15
- package/lib/node_modules/lodash-es/_baseIsMatch.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseIsNative.cjs +1 -1
- package/lib/node_modules/lodash-es/_baseIsNative.mjs +7 -6
- package/lib/node_modules/lodash-es/_baseIsTypedArray.cjs +1 -1
- package/lib/node_modules/lodash-es/_baseIsTypedArray.mjs +6 -5
- package/lib/node_modules/lodash-es/_baseIteratee.cjs +1 -1
- package/lib/node_modules/lodash-es/_baseIteratee.mjs +8 -7
- package/lib/node_modules/lodash-es/_baseKeys.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseMatches.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseMatchesProperty.cjs +1 -1
- package/lib/node_modules/lodash-es/_baseMatchesProperty.mjs +11 -10
- package/lib/node_modules/lodash-es/_baseNth.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseProperty.mjs +2 -1
- package/lib/node_modules/lodash-es/_basePropertyDeep.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseReduce.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseSlice.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseTimes.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseToString.cjs +1 -1
- package/lib/node_modules/lodash-es/_baseToString.mjs +8 -7
- package/lib/node_modules/lodash-es/_baseTrim.mjs +2 -1
- package/lib/node_modules/lodash-es/_baseUnary.mjs +2 -1
- package/lib/node_modules/lodash-es/_cacheHas.mjs +2 -1
- package/lib/node_modules/lodash-es/_castFunction.mjs +2 -1
- package/lib/node_modules/lodash-es/_castPath.mjs +2 -1
- package/lib/node_modules/lodash-es/_castSlice.mjs +2 -1
- package/lib/node_modules/lodash-es/_copyArray.mjs +2 -1
- package/lib/node_modules/lodash-es/_coreJsData.mjs +2 -1
- package/lib/node_modules/lodash-es/_createAggregator.cjs +1 -1
- package/lib/node_modules/lodash-es/_createAggregator.mjs +9 -8
- package/lib/node_modules/lodash-es/_createBaseEach.mjs +2 -1
- package/lib/node_modules/lodash-es/_createBaseFor.mjs +2 -1
- package/lib/node_modules/lodash-es/_createCaseFirst.cjs +1 -1
- package/lib/node_modules/lodash-es/_createCaseFirst.mjs +9 -8
- package/lib/node_modules/lodash-es/_defineProperty.mjs +2 -1
- package/lib/node_modules/lodash-es/_equalArrays.mjs +2 -1
- package/lib/node_modules/lodash-es/_equalByTag.cjs +1 -1
- package/lib/node_modules/lodash-es/_equalByTag.mjs +7 -6
- package/lib/node_modules/lodash-es/_equalObjects.mjs +2 -1
- package/lib/node_modules/lodash-es/_freeGlobal.mjs +2 -1
- package/lib/node_modules/lodash-es/_getAllKeys.cjs +1 -1
- package/lib/node_modules/lodash-es/_getAllKeys.mjs +6 -5
- package/lib/node_modules/lodash-es/_getMapData.mjs +2 -1
- package/lib/node_modules/lodash-es/_getMatchData.cjs +1 -1
- package/lib/node_modules/lodash-es/_getMatchData.mjs +7 -6
- package/lib/node_modules/lodash-es/_getNative.mjs +2 -1
- package/lib/node_modules/lodash-es/_getRawTag.mjs +2 -1
- package/lib/node_modules/lodash-es/_getSymbols.mjs +2 -1
- package/lib/node_modules/lodash-es/_getTag.cjs +1 -1
- package/lib/node_modules/lodash-es/_getTag.mjs +13 -12
- package/lib/node_modules/lodash-es/_getValue.mjs +2 -1
- package/lib/node_modules/lodash-es/_hasPath.cjs +1 -1
- package/lib/node_modules/lodash-es/_hasPath.mjs +10 -9
- package/lib/node_modules/lodash-es/_hasUnicode.mjs +2 -1
- package/lib/node_modules/lodash-es/_hashClear.mjs +2 -1
- package/lib/node_modules/lodash-es/_hashDelete.mjs +2 -1
- package/lib/node_modules/lodash-es/_hashGet.mjs +2 -1
- package/lib/node_modules/lodash-es/_hashHas.mjs +2 -1
- package/lib/node_modules/lodash-es/_hashSet.mjs +2 -1
- package/lib/node_modules/lodash-es/_isFlattenable.cjs +1 -1
- package/lib/node_modules/lodash-es/_isFlattenable.mjs +6 -5
- package/lib/node_modules/lodash-es/_isIndex.mjs +2 -1
- package/lib/node_modules/lodash-es/_isKey.cjs +1 -1
- package/lib/node_modules/lodash-es/_isKey.mjs +7 -6
- package/lib/node_modules/lodash-es/_isKeyable.mjs +2 -1
- package/lib/node_modules/lodash-es/_isMasked.mjs +2 -1
- package/lib/node_modules/lodash-es/_isPrototype.mjs +2 -1
- package/lib/node_modules/lodash-es/_isStrictComparable.mjs +2 -1
- package/lib/node_modules/lodash-es/_listCacheClear.mjs +2 -1
- package/lib/node_modules/lodash-es/_listCacheDelete.mjs +2 -1
- package/lib/node_modules/lodash-es/_listCacheGet.mjs +2 -1
- package/lib/node_modules/lodash-es/_listCacheHas.mjs +2 -1
- package/lib/node_modules/lodash-es/_listCacheSet.mjs +2 -1
- package/lib/node_modules/lodash-es/_mapCacheClear.mjs +2 -1
- package/lib/node_modules/lodash-es/_mapCacheDelete.mjs +2 -1
- package/lib/node_modules/lodash-es/_mapCacheGet.mjs +2 -1
- package/lib/node_modules/lodash-es/_mapCacheHas.mjs +2 -1
- package/lib/node_modules/lodash-es/_mapCacheSet.mjs +2 -1
- package/lib/node_modules/lodash-es/_mapToArray.mjs +2 -1
- package/lib/node_modules/lodash-es/_matchesStrictComparable.mjs +2 -1
- package/lib/node_modules/lodash-es/_memoizeCapped.mjs +2 -1
- package/lib/node_modules/lodash-es/_nativeCreate.mjs +2 -1
- package/lib/node_modules/lodash-es/_nativeKeys.mjs +2 -1
- package/lib/node_modules/lodash-es/_nodeUtil.mjs +2 -1
- package/lib/node_modules/lodash-es/_objectToString.mjs +2 -1
- package/lib/node_modules/lodash-es/_overArg.mjs +2 -1
- package/lib/node_modules/lodash-es/_root.mjs +2 -1
- package/lib/node_modules/lodash-es/_setCacheAdd.mjs +2 -1
- package/lib/node_modules/lodash-es/_setCacheHas.mjs +2 -1
- package/lib/node_modules/lodash-es/_setToArray.mjs +2 -1
- package/lib/node_modules/lodash-es/_stackClear.mjs +2 -1
- package/lib/node_modules/lodash-es/_stackDelete.mjs +2 -1
- package/lib/node_modules/lodash-es/_stackGet.mjs +2 -1
- package/lib/node_modules/lodash-es/_stackHas.mjs +2 -1
- package/lib/node_modules/lodash-es/_stackSet.mjs +2 -1
- package/lib/node_modules/lodash-es/_stringToArray.cjs +1 -1
- package/lib/node_modules/lodash-es/_stringToArray.mjs +6 -5
- package/lib/node_modules/lodash-es/_stringToPath.mjs +2 -1
- package/lib/node_modules/lodash-es/_toKey.mjs +2 -1
- package/lib/node_modules/lodash-es/_toSource.mjs +2 -1
- package/lib/node_modules/lodash-es/_trimmedEndIndex.mjs +2 -1
- package/lib/node_modules/lodash-es/_unicodeToArray.mjs +2 -1
- package/lib/node_modules/lodash-es/capitalize.mjs +2 -1
- package/lib/node_modules/lodash-es/concat.cjs +1 -1
- package/lib/node_modules/lodash-es/concat.mjs +8 -7
- package/lib/node_modules/lodash-es/eq.mjs +2 -1
- package/lib/node_modules/lodash-es/first.mjs +1 -1
- package/lib/node_modules/lodash-es/flatten.mjs +2 -1
- package/lib/node_modules/lodash-es/flattenDeep.mjs +2 -1
- package/lib/node_modules/lodash-es/flattenDepth.cjs +1 -1
- package/lib/node_modules/lodash-es/flattenDepth.mjs +6 -5
- package/lib/node_modules/lodash-es/forEach.cjs +1 -1
- package/lib/node_modules/lodash-es/forEach.mjs +8 -7
- package/lib/node_modules/lodash-es/get.mjs +2 -1
- package/lib/node_modules/lodash-es/groupBy.mjs +2 -1
- package/lib/node_modules/lodash-es/hasIn.mjs +2 -1
- package/lib/node_modules/lodash-es/head.mjs +2 -1
- package/lib/node_modules/lodash-es/identity.mjs +2 -1
- package/lib/node_modules/lodash-es/isArguments.cjs +1 -1
- package/lib/node_modules/lodash-es/isArguments.mjs +7 -6
- package/lib/node_modules/lodash-es/isArray.mjs +2 -1
- package/lib/node_modules/lodash-es/isArrayLike.mjs +2 -1
- package/lib/node_modules/lodash-es/isBuffer.mjs +2 -1
- package/lib/node_modules/lodash-es/isEmpty.cjs +1 -1
- package/lib/node_modules/lodash-es/isEmpty.mjs +14 -13
- package/lib/node_modules/lodash-es/isFunction.mjs +2 -1
- package/lib/node_modules/lodash-es/isLength.mjs +2 -1
- package/lib/node_modules/lodash-es/isNil.mjs +2 -1
- package/lib/node_modules/lodash-es/isObject.mjs +2 -1
- package/lib/node_modules/lodash-es/isObjectLike.mjs +2 -1
- package/lib/node_modules/lodash-es/isSymbol.mjs +2 -1
- package/lib/node_modules/lodash-es/isTypedArray.mjs +2 -1
- package/lib/node_modules/lodash-es/keys.cjs +1 -1
- package/lib/node_modules/lodash-es/keys.mjs +7 -6
- package/lib/node_modules/lodash-es/last.mjs +2 -1
- package/lib/node_modules/lodash-es/lodash.cjs +1 -1
- package/lib/node_modules/lodash-es/lodash.mjs +19 -19
- package/lib/node_modules/lodash-es/memoize.mjs +2 -1
- package/lib/node_modules/lodash-es/nth.cjs +1 -1
- package/lib/node_modules/lodash-es/nth.mjs +6 -5
- package/lib/node_modules/lodash-es/property.cjs +1 -1
- package/lib/node_modules/lodash-es/property.mjs +8 -7
- package/lib/node_modules/lodash-es/reduce.cjs +1 -1
- package/lib/node_modules/lodash-es/reduce.mjs +9 -8
- package/lib/node_modules/lodash-es/stubArray.mjs +2 -1
- package/lib/node_modules/lodash-es/stubFalse.mjs +2 -1
- package/lib/node_modules/lodash-es/toFinite.mjs +2 -1
- package/lib/node_modules/lodash-es/toInteger.mjs +2 -1
- package/lib/node_modules/lodash-es/toNumber.cjs +1 -1
- package/lib/node_modules/lodash-es/toNumber.mjs +10 -9
- package/lib/node_modules/lodash-es/toString.mjs +2 -1
- package/lib/node_modules/lodash-es/upperFirst.mjs +2 -1
- package/lib/node_modules/luxon/build/es6/luxon.mjs +2 -1
- package/lib/node_modules/parsimmon/build/parsimmon.umd.min.cjs +1 -1
- package/lib/node_modules/parsimmon/build/parsimmon.umd.min.mjs +4 -3
- package/lib/node_modules/pluralize/pluralize.cjs +1 -1
- package/lib/node_modules/pluralize/pluralize.mjs +4 -3
- package/lib/packages/dbml-core/node_modules/lodash/lodash.cjs +2 -2
- package/lib/packages/dbml-core/node_modules/lodash/lodash.mjs +4 -3
- package/lib/packages/dbml-core/package.json.cjs +1 -1
- package/lib/packages/dbml-core/package.json.mjs +3 -2
- package/lib/parse/ANTLR/ASTGeneration/AST.mjs +2 -1
- package/lib/parse/ANTLR/ASTGeneration/ParserErrorListener.mjs +2 -1
- package/lib/parse/ANTLR/ASTGeneration/SyntaxError.mjs +2 -1
- package/lib/parse/ANTLR/ASTGeneration/constants.mjs +2 -1
- package/lib/parse/ANTLR/ASTGeneration/helpers.mjs +2 -1
- package/lib/parse/ANTLR/ASTGeneration/index.mjs +2 -1
- package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.mjs +2 -1
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.mjs +3 -2
- package/lib/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.mjs +58 -57
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.mjs +3 -2
- package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.mjs +2 -1
- package/lib/parse/ANTLR/parsers/mssql/TSqlLexer.mjs +2 -1
- package/lib/parse/ANTLR/parsers/mssql/TSqlParser.mjs +2 -1
- package/lib/parse/ANTLR/parsers/mssql/TSqlParserVisitor.mjs +2 -1
- package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.mjs +2 -1
- package/lib/parse/ANTLR/parsers/mysql/MySqlLexerBase.mjs +2 -1
- package/lib/parse/ANTLR/parsers/mysql/MySqlParser.mjs +2 -1
- package/lib/parse/ANTLR/parsers/mysql/MySqlParserVisitor.mjs +2 -1
- package/lib/parse/ANTLR/parsers/oraclesql/OracleSqlLexer.mjs +2 -1
- package/lib/parse/ANTLR/parsers/oraclesql/OracleSqlLexerBase.mjs +2 -1
- package/lib/parse/ANTLR/parsers/oraclesql/OracleSqlParser.mjs +2 -1
- package/lib/parse/ANTLR/parsers/oraclesql/OracleSqlParserBase.mjs +2 -1
- package/lib/parse/ANTLR/parsers/oraclesql/OracleSqlParserVisitor.mjs +2 -1
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexer.mjs +2 -1
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexerBase.mjs +2 -1
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParser.mjs +2 -1
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParserBase.mjs +2 -1
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParserVisitor.mjs +2 -1
- package/lib/parse/ANTLR/parsers/snowflake/SnowflakeLexer.mjs +2 -1
- package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParser.mjs +2 -1
- package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParserVisitor.mjs +2 -1
- package/lib/parse/Parser.cjs +1 -1
- package/lib/parse/Parser.mjs +38 -37
- package/lib/parse/databaseGenerator.mjs +2 -1
- package/lib/parse/deprecated/dbmlParser.mjs +2 -1
- package/lib/parse/deprecated/mssql/base_parsers.cjs +1 -1
- package/lib/parse/deprecated/mssql/base_parsers.mjs +28 -27
- package/lib/parse/deprecated/mssql/column_definition/actions.mjs +2 -1
- package/lib/parse/deprecated/mssql/column_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/column_definition/index.mjs +19 -19
- package/lib/parse/deprecated/mssql/constraint_definition/actions.mjs +2 -1
- package/lib/parse/deprecated/mssql/constraint_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/constraint_definition/index.mjs +10 -10
- package/lib/parse/deprecated/mssql/expression.cjs +1 -1
- package/lib/parse/deprecated/mssql/expression.mjs +18 -17
- package/lib/parse/deprecated/mssql/fk_definition/actions.mjs +2 -1
- package/lib/parse/deprecated/mssql/fk_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/fk_definition/index.mjs +8 -7
- package/lib/parse/deprecated/mssql/index.mjs +2 -1
- package/lib/parse/deprecated/mssql/index_definition/actions.mjs +2 -1
- package/lib/parse/deprecated/mssql/index_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/index_definition/index.mjs +14 -13
- package/lib/parse/deprecated/mssql/keyword_parsers.mjs +2 -1
- package/lib/parse/deprecated/mssql/keyword_utils.mjs +2 -1
- package/lib/parse/deprecated/mssql/statements/actions.mjs +2 -1
- package/lib/parse/deprecated/mssql/statements/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/index.mjs +24 -23
- package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/actions.mjs +2 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/add/actions.mjs +1 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/add/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/add/index.mjs +14 -13
- package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/index.mjs +2 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/comments/actions.mjs +2 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/comments/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/comments/index.mjs +6 -5
- package/lib/parse/deprecated/mssql/statements/statement_types/create_index/actions.mjs +2 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/create_index/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/create_index/index.mjs +12 -11
- package/lib/parse/deprecated/mssql/statements/statement_types/create_table/actions.mjs +2 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/create_table/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/create_table/index.mjs +12 -11
- package/lib/parse/deprecated/mssql/statements/statement_types/index.mjs +1 -1
- package/lib/parse/deprecated/mssql/utils.cjs +1 -1
- package/lib/parse/deprecated/mssql/utils.mjs +11 -10
- package/lib/parse/deprecated/mssql/whitespaces.mjs +2 -1
- package/lib/parse/deprecated/mssqlParser.mjs +2 -1
- package/lib/parse/deprecated/mysqlParser.mjs +2 -1
- package/lib/parse/deprecated/postgresParser.mjs +2 -1
- package/lib/parse/deprecated/schemarbParser.mjs +2 -1
- package/lib/parse/error.mjs +2 -1
- package/lib/transform/index.mjs +2 -1
- package/lib/transform/relations.mjs +2 -1
- package/lib/utils/version.mjs +2 -1
- package/package.json +3 -3
- package/types/export/DbmlExporter.d.ts +0 -0
- package/types/export/JsonExporter.d.ts +0 -0
- package/types/export/ModelExporter.d.ts +0 -0
- package/types/export/index.d.ts +0 -0
- package/types/model_structure/check.d.ts +0 -0
- package/types/model_structure/element.d.ts +0 -0
- package/types/model_structure/enum.d.ts +0 -0
- package/types/model_structure/enumValue.d.ts +0 -0
- package/types/model_structure/index.d.ts +0 -0
- package/types/model_structure/indexes.d.ts +0 -0
- package/types/model_structure/ref.d.ts +0 -0
- package/types/model_structure/tablePartial.d.ts +0 -0
- 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 "./
|
|
7
|
-
import u from "./
|
|
6
|
+
import l from "./element.mjs";
|
|
7
|
+
import u from "./dep.mjs";
|
|
8
8
|
import d from "./enum.mjs";
|
|
9
9
|
import f from "./ref.mjs";
|
|
10
|
-
import p from "./
|
|
11
|
-
import m from "./
|
|
12
|
-
import h from "./
|
|
13
|
-
import g from "./
|
|
10
|
+
import p from "./table.mjs";
|
|
11
|
+
import m from "./tableGroup.mjs";
|
|
12
|
+
import h from "./schema.mjs";
|
|
13
|
+
import g from "./stickyNote.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
|
-
|
|
19
|
+
//#region src/model_structure/database.ts
|
|
20
20
|
n();
|
|
21
|
-
var C = class extends
|
|
21
|
+
var C = class extends l {
|
|
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 u {
|
|
|
65
65
|
}
|
|
66
66
|
processNotes(e) {
|
|
67
67
|
e.forEach((e) => {
|
|
68
|
-
this.pushNote(new
|
|
68
|
+
this.pushNote(new g({
|
|
69
69
|
...e,
|
|
70
70
|
database: this
|
|
71
71
|
}));
|
|
@@ -100,7 +100,7 @@ var C = class extends u {
|
|
|
100
100
|
}
|
|
101
101
|
processSchemas(e) {
|
|
102
102
|
e.forEach((e) => {
|
|
103
|
-
this.pushSchema(new
|
|
103
|
+
this.pushSchema(new h({
|
|
104
104
|
...e,
|
|
105
105
|
database: this
|
|
106
106
|
}));
|
|
@@ -117,7 +117,7 @@ var C = class extends u {
|
|
|
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
|
|
120
|
+
n.pushTable(new p({
|
|
121
121
|
...e,
|
|
122
122
|
schema: n
|
|
123
123
|
}));
|
|
@@ -129,7 +129,7 @@ var C = class extends u {
|
|
|
129
129
|
}));
|
|
130
130
|
break;
|
|
131
131
|
case s:
|
|
132
|
-
n.pushTableGroup(new
|
|
132
|
+
n.pushTableGroup(new m({
|
|
133
133
|
...e,
|
|
134
134
|
schema: n
|
|
135
135
|
}));
|
|
@@ -140,7 +140,7 @@ var C = class extends u {
|
|
|
140
140
|
schema: n
|
|
141
141
|
}));
|
|
142
142
|
break;
|
|
143
|
-
case "dep": n.pushDep(new
|
|
143
|
+
case "dep": n.pushDep(new u({
|
|
144
144
|
...e,
|
|
145
145
|
schema: n
|
|
146
146
|
}));
|
|
@@ -160,7 +160,7 @@ var C = class extends u {
|
|
|
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
|
|
163
|
+
return n || (n = new h({
|
|
164
164
|
name: e,
|
|
165
165
|
note: { value: e === "public" ? `Default ${t(r)} Schema` : null },
|
|
166
166
|
database: this
|
|
@@ -274,4 +274,5 @@ var C = class extends u {
|
|
|
274
274
|
}), e;
|
|
275
275
|
}
|
|
276
276
|
};
|
|
277
|
+
//#endregion
|
|
277
278
|
export { C as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
//#region 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,4 +8,5 @@ var e = class {
|
|
|
8
8
|
return this[e] += 1, t;
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
+
//#endregion
|
|
11
12
|
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("./
|
|
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,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 "./
|
|
5
|
-
import r from "./
|
|
6
|
-
|
|
4
|
+
import n from "./element.mjs";
|
|
5
|
+
import r from "./depEdge.mjs";
|
|
6
|
+
//#region src/model_structure/dep.ts
|
|
7
7
|
t();
|
|
8
|
-
var i = class extends
|
|
8
|
+
var i = class extends n {
|
|
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 r {
|
|
|
14
14
|
}
|
|
15
15
|
processEdges(e) {
|
|
16
16
|
e.forEach((e) => {
|
|
17
|
-
let t = e.upstream?.schemaName || "public",
|
|
18
|
-
t ===
|
|
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({
|
|
19
19
|
...e,
|
|
20
20
|
dep: this
|
|
21
21
|
}));
|
|
@@ -53,4 +53,5 @@ var i = class extends r {
|
|
|
53
53
|
}, this.edges.forEach((t) => t.normalize(e));
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
+
//#endregion
|
|
56
57
|
export { i as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs"),require("./config.cjs");const e=require("./
|
|
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,8 +1,8 @@
|
|
|
1
1
|
import "./config.mjs";
|
|
2
|
-
import e from "./
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
var r = class extends
|
|
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 {
|
|
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 e {
|
|
|
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(
|
|
20
|
-
let i =
|
|
21
|
-
return a || this.error(`Can't find table ${
|
|
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`), {
|
|
22
22
|
table: a,
|
|
23
|
-
fields: (
|
|
24
|
-
let n = a.findField(
|
|
25
|
-
return n || this.error(`Can't find field ${
|
|
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;
|
|
26
26
|
})
|
|
27
27
|
};
|
|
28
28
|
}
|
|
@@ -55,4 +55,5 @@ var r = class extends e {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
+
//#endregion
|
|
58
59
|
export { r as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/model_structure/element.js
|
|
2
2
|
var e = class extends Error {
|
|
3
3
|
constructor(e, t = { start: {
|
|
4
4
|
line: 1,
|
|
@@ -17,4 +17,5 @@ var e = class extends Error {
|
|
|
17
17
|
throw new e(t, this.token);
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
+
//#endregion
|
|
20
21
|
export { t as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs"),require("./config.cjs");const e=require("./
|
|
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,12 +1,12 @@
|
|
|
1
1
|
import "./config.mjs";
|
|
2
|
-
import e from "./
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
var r = class extends
|
|
6
|
-
constructor({ tableName: e, schemaName:
|
|
7
|
-
super(a), this.relation = i, this.schemaName =
|
|
8
|
-
let s = o.schema.database.findOrCreateSchema(
|
|
9
|
-
s || this.error(`Can't find table ${n
|
|
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);
|
|
10
10
|
}
|
|
11
11
|
generateId() {
|
|
12
12
|
this.id = this.dbState.generateId("endpointId");
|
|
@@ -36,19 +36,19 @@ var r = class extends e {
|
|
|
36
36
|
relation: this.relation
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
setFields(
|
|
40
|
-
let r =
|
|
39
|
+
setFields(t, n) {
|
|
40
|
+
let r = t && t.length ? [...t] : [];
|
|
41
41
|
if (!r.length) {
|
|
42
|
-
let
|
|
43
|
-
if (
|
|
42
|
+
let t = n.fields.find((e) => e.pk);
|
|
43
|
+
if (t) r.push(t.name);
|
|
44
44
|
else {
|
|
45
|
-
let
|
|
46
|
-
|
|
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}"`);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
r.forEach((
|
|
50
|
-
let r = n.findField(
|
|
51
|
-
r || this.error(`Can't find field ${
|
|
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);
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
normalize(e) {
|
|
@@ -59,4 +59,5 @@ var r = class extends e {
|
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
+
//#endregion
|
|
62
63
|
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("./
|
|
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,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 "./
|
|
4
|
-
import r from "./
|
|
5
|
-
import
|
|
6
|
-
|
|
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
|
|
7
7
|
t();
|
|
8
|
-
var a = class extends
|
|
8
|
+
var a = class extends r {
|
|
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 n {
|
|
|
14
14
|
}
|
|
15
15
|
processValues(e) {
|
|
16
16
|
e.forEach((e) => {
|
|
17
|
-
this.pushValue(new
|
|
17
|
+
this.pushValue(new i({
|
|
18
18
|
...e,
|
|
19
19
|
_enum: this
|
|
20
20
|
}));
|
|
@@ -24,13 +24,13 @@ var a = class extends n {
|
|
|
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 ${
|
|
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}"`);
|
|
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 ${
|
|
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}"`);
|
|
34
34
|
}
|
|
35
35
|
export() {
|
|
36
36
|
return {
|
|
@@ -65,4 +65,5 @@ var a = class extends n {
|
|
|
65
65
|
}, this.values.forEach((t) => t.normalize(e));
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
+
//#endregion
|
|
68
69
|
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
|
-
|
|
4
|
+
//#region 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,4 +30,5 @@ var r = class extends n {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
+
//#endregion
|
|
33
34
|
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")
|
|
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,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";
|
|
4
3
|
import "./config.mjs";
|
|
5
|
-
import
|
|
6
|
-
|
|
4
|
+
import n from "./element.mjs";
|
|
5
|
+
import r from "./check.mjs";
|
|
6
|
+
//#region src/model_structure/field.ts
|
|
7
7
|
t();
|
|
8
|
-
var i = class extends
|
|
8
|
+
var i = class extends n {
|
|
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 r {
|
|
|
73
73
|
}
|
|
74
74
|
processChecks(e) {
|
|
75
75
|
e.forEach((e) => {
|
|
76
|
-
this.checks.push(new
|
|
76
|
+
this.checks.push(new r({
|
|
77
77
|
...e,
|
|
78
78
|
table: this.table,
|
|
79
79
|
column: this
|
|
@@ -81,4 +81,5 @@ var i = class extends r {
|
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
+
//#endregion
|
|
84
85
|
export { i as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e from "./element.mjs";
|
|
2
|
-
|
|
2
|
+
//#region 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,4 +26,5 @@ var t = class extends e {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
+
//#endregion
|
|
29
30
|
export { t as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e from "./element.mjs";
|
|
2
|
-
|
|
2
|
+
//#region 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,4 +28,5 @@ var t = class extends e {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
+
//#endregion
|
|
31
32
|
export { t as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "./element.mjs";
|
|
2
2
|
import t from "./indexColumn.mjs";
|
|
3
|
-
|
|
3
|
+
//#region 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,4 +58,5 @@ var n = class extends e {
|
|
|
58
58
|
}, this.columns.forEach((t) => t.normalize(e));
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
+
//#endregion
|
|
61
62
|
export { n as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e from "./element.mjs";
|
|
2
|
-
|
|
2
|
+
//#region 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,4 +24,5 @@ var t = class extends e {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
+
//#endregion
|
|
27
28
|
export { t as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e from "./element.mjs";
|
|
2
|
-
|
|
2
|
+
//#region 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,4 +27,5 @@ var t = class extends e {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
+
//#endregion
|
|
30
31
|
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
|
-
|
|
4
|
+
//#region 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,4 +57,5 @@ var r = class extends e {
|
|
|
57
57
|
}, this.endpoints.forEach((t) => t.normalize(e));
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
+
//#endregion
|
|
60
61
|
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("./
|
|
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,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 n from "./
|
|
3
|
+
import { shouldPrintSchema as n } from "./utils.mjs";
|
|
4
4
|
import r from "./element.mjs";
|
|
5
|
-
import i from "./
|
|
6
|
-
import a from "./
|
|
7
|
-
import o from "./
|
|
8
|
-
import s from "./
|
|
9
|
-
import
|
|
10
|
-
|
|
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
|
|
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
|
|
21
|
+
this.pushTable(new s({
|
|
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 ${
|
|
31
|
+
this.tables.some((t) => t.name === e.name) && e.error(`Table ${n(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
|
|
38
|
+
this.pushEnum(new a({
|
|
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 ${
|
|
48
|
+
this.enums.some((t) => t.name === e.name) && e.error(`Enum ${n(this) ? `"${this.name}".` : ""}"${e.name}" existed`);
|
|
49
49
|
}
|
|
50
50
|
processRefs(e) {
|
|
51
51
|
e.forEach((e) => {
|
|
52
|
-
this.pushRef(new
|
|
52
|
+
this.pushRef(new o({
|
|
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
|
|
69
|
+
this.pushDep(new i({
|
|
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
|
|
80
|
+
this.pushTableGroup(new c({
|
|
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 ${
|
|
90
|
+
this.tableGroups.some((t) => t.name === e.name) && e.error(`Table Group ${n(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,4 +135,5 @@ 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
|
|
138
139
|
export { l as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e from "./element.mjs";
|
|
2
|
-
|
|
2
|
+
//#region 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,4 +22,5 @@ var t = class extends e {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
+
//#endregion
|
|
25
26
|
export { t as default };
|