@dbml/core 10.3.0-alpha.0 → 10.3.0-alpha.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.
- package/lib/export/DbmlExporter.cjs +13 -13
- package/lib/export/DbmlExporter.mjs +88 -84
- package/lib/export/MysqlExporter.cjs +8 -8
- package/lib/export/MysqlExporter.mjs +54 -50
- package/lib/export/OracleExporter.cjs +7 -7
- package/lib/export/OracleExporter.mjs +79 -74
- package/lib/export/PostgresExporter.cjs +9 -9
- package/lib/export/PostgresExporter.mjs +82 -78
- package/lib/export/SqlServerExporter.cjs +11 -11
- package/lib/export/SqlServerExporter.mjs +64 -60
- package/lib/model_structure/database.cjs +1 -1
- package/lib/model_structure/database.mjs +56 -53
- package/lib/model_structure/dep.cjs +1 -1
- package/lib/model_structure/dep.mjs +11 -9
- package/lib/model_structure/enum.cjs +1 -1
- package/lib/model_structure/enum.mjs +15 -13
- package/lib/model_structure/enumValue.cjs +1 -1
- package/lib/model_structure/enumValue.mjs +8 -6
- package/lib/model_structure/field.cjs +1 -1
- package/lib/model_structure/field.mjs +10 -8
- package/lib/model_structure/schema.cjs +1 -1
- package/lib/model_structure/schema.mjs +25 -23
- package/lib/model_structure/table.cjs +1 -1
- package/lib/model_structure/table.mjs +43 -40
- package/lib/model_structure/tableGroup.cjs +1 -1
- package/lib/model_structure/tableGroup.mjs +11 -9
- package/lib/model_structure/tablePartial.cjs +1 -1
- package/lib/model_structure/tablePartial.mjs +8 -6
- package/lib/node_modules/lodash-es/_DataView.cjs +1 -0
- package/lib/node_modules/lodash-es/_DataView.mjs +10 -0
- package/lib/node_modules/lodash-es/_Hash.cjs +1 -0
- package/lib/node_modules/lodash-es/_Hash.mjs +20 -0
- package/lib/node_modules/lodash-es/_ListCache.cjs +1 -0
- package/lib/node_modules/lodash-es/_ListCache.mjs +20 -0
- package/lib/node_modules/lodash-es/_Map.cjs +1 -0
- package/lib/node_modules/lodash-es/_Map.mjs +10 -0
- package/lib/node_modules/lodash-es/_MapCache.cjs +1 -0
- package/lib/node_modules/lodash-es/_MapCache.mjs +20 -0
- package/lib/node_modules/lodash-es/_Promise.cjs +1 -0
- package/lib/node_modules/lodash-es/_Promise.mjs +10 -0
- package/lib/node_modules/lodash-es/_Set.cjs +1 -0
- package/lib/node_modules/lodash-es/_Set.mjs +10 -0
- package/lib/node_modules/lodash-es/_SetCache.cjs +1 -0
- package/lib/node_modules/lodash-es/_SetCache.mjs +15 -0
- package/lib/node_modules/lodash-es/_Stack.cjs +1 -0
- package/lib/node_modules/lodash-es/_Stack.mjs +18 -0
- package/lib/node_modules/lodash-es/_Symbol.cjs +1 -0
- package/lib/node_modules/lodash-es/_Symbol.mjs +9 -0
- package/lib/node_modules/lodash-es/_Uint8Array.cjs +1 -0
- package/lib/node_modules/lodash-es/_Uint8Array.mjs +9 -0
- package/lib/node_modules/lodash-es/_WeakMap.cjs +1 -0
- package/lib/node_modules/lodash-es/_WeakMap.mjs +10 -0
- package/lib/node_modules/lodash-es/_arrayAggregator.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayAggregator.mjs +13 -0
- package/lib/node_modules/lodash-es/_arrayEach.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayEach.mjs +10 -0
- package/lib/node_modules/lodash-es/_arrayFilter.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayFilter.mjs +13 -0
- package/lib/node_modules/lodash-es/_arrayLikeKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayLikeKeys.mjs +19 -0
- package/lib/node_modules/lodash-es/_arrayMap.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayMap.mjs +10 -0
- package/lib/node_modules/lodash-es/_arrayPush.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayPush.mjs +10 -0
- package/lib/node_modules/lodash-es/_arrayReduce.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayReduce.mjs +11 -0
- package/lib/node_modules/lodash-es/_arraySome.cjs +1 -0
- package/lib/node_modules/lodash-es/_arraySome.mjs +10 -0
- package/lib/node_modules/lodash-es/_asciiToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_asciiToArray.mjs +9 -0
- package/lib/node_modules/lodash-es/_assocIndexOf.cjs +1 -0
- package/lib/node_modules/lodash-es/_assocIndexOf.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseAggregator.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseAggregator.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseAssignValue.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseAssignValue.mjs +17 -0
- package/lib/node_modules/lodash-es/_baseEach.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseEach.mjs +10 -0
- package/lib/node_modules/lodash-es/_baseFlatten.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseFlatten.mjs +18 -0
- package/lib/node_modules/lodash-es/_baseFor.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseFor.mjs +9 -0
- package/lib/node_modules/lodash-es/_baseForOwn.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseForOwn.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseGet.mjs +15 -0
- package/lib/node_modules/lodash-es/_baseGetAllKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseGetAllKeys.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseGetTag.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseGetTag.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseHasIn.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseHasIn.mjs +9 -0
- package/lib/node_modules/lodash-es/_baseIsArguments.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsArguments.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseIsEqual.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsEqual.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseIsEqualDeep.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsEqualDeep.mjs +34 -0
- package/lib/node_modules/lodash-es/_baseIsMatch.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsMatch.mjs +30 -0
- package/lib/node_modules/lodash-es/_baseIsNative.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsNative.mjs +15 -0
- package/lib/node_modules/lodash-es/_baseIsTypedArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsTypedArray.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseIteratee.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIteratee.mjs +16 -0
- package/lib/node_modules/lodash-es/_baseKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseKeys.mjs +16 -0
- package/lib/node_modules/lodash-es/_baseMatches.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseMatches.mjs +17 -0
- package/lib/node_modules/lodash-es/_baseMatchesProperty.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseMatchesProperty.mjs +21 -0
- package/lib/node_modules/lodash-es/_baseNth.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseNth.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseProperty.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseProperty.mjs +11 -0
- package/lib/node_modules/lodash-es/_basePropertyDeep.cjs +1 -0
- package/lib/node_modules/lodash-es/_basePropertyDeep.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseReduce.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseReduce.mjs +11 -0
- package/lib/node_modules/lodash-es/_baseSlice.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseSlice.mjs +12 -0
- package/lib/node_modules/lodash-es/_baseTimes.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseTimes.mjs +10 -0
- package/lib/node_modules/lodash-es/_baseToString.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseToString.mjs +19 -0
- package/lib/node_modules/lodash-es/_baseTrim.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseTrim.mjs +12 -0
- package/lib/node_modules/lodash-es/_baseUnary.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseUnary.mjs +11 -0
- package/lib/node_modules/lodash-es/_cacheHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_cacheHas.mjs +9 -0
- package/lib/node_modules/lodash-es/_castFunction.cjs +1 -0
- package/lib/node_modules/lodash-es/_castFunction.mjs +12 -0
- package/lib/node_modules/lodash-es/_castPath.cjs +1 -0
- package/lib/node_modules/lodash-es/_castPath.mjs +15 -0
- package/lib/node_modules/lodash-es/_castSlice.cjs +1 -0
- package/lib/node_modules/lodash-es/_castSlice.mjs +13 -0
- package/lib/node_modules/lodash-es/_copyArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_copyArray.mjs +11 -0
- package/lib/node_modules/lodash-es/_coreJsData.cjs +1 -0
- package/lib/node_modules/lodash-es/_coreJsData.mjs +9 -0
- package/lib/node_modules/lodash-es/_createAggregator.cjs +1 -0
- package/lib/node_modules/lodash-es/_createAggregator.mjs +18 -0
- package/lib/node_modules/lodash-es/_createBaseEach.cjs +1 -0
- package/lib/node_modules/lodash-es/_createBaseEach.mjs +17 -0
- package/lib/node_modules/lodash-es/_createBaseFor.cjs +1 -0
- package/lib/node_modules/lodash-es/_createBaseFor.mjs +15 -0
- package/lib/node_modules/lodash-es/_createCaseFirst.cjs +1 -0
- package/lib/node_modules/lodash-es/_createCaseFirst.mjs +19 -0
- package/lib/node_modules/lodash-es/_defineProperty.cjs +1 -0
- package/lib/node_modules/lodash-es/_defineProperty.mjs +14 -0
- package/lib/node_modules/lodash-es/_equalArrays.cjs +1 -0
- package/lib/node_modules/lodash-es/_equalArrays.mjs +39 -0
- package/lib/node_modules/lodash-es/_equalByTag.cjs +1 -0
- package/lib/node_modules/lodash-es/_equalByTag.mjs +39 -0
- package/lib/node_modules/lodash-es/_equalObjects.cjs +1 -0
- package/lib/node_modules/lodash-es/_equalObjects.mjs +36 -0
- package/lib/node_modules/lodash-es/_freeGlobal.cjs +1 -0
- package/lib/node_modules/lodash-es/_freeGlobal.mjs +8 -0
- package/lib/node_modules/lodash-es/_getAllKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_getAllKeys.mjs +14 -0
- package/lib/node_modules/lodash-es/_getMapData.cjs +1 -0
- package/lib/node_modules/lodash-es/_getMapData.mjs +13 -0
- package/lib/node_modules/lodash-es/_getMatchData.cjs +1 -0
- package/lib/node_modules/lodash-es/_getMatchData.mjs +21 -0
- package/lib/node_modules/lodash-es/_getNative.cjs +1 -0
- package/lib/node_modules/lodash-es/_getNative.mjs +14 -0
- package/lib/node_modules/lodash-es/_getRawTag.cjs +1 -0
- package/lib/node_modules/lodash-es/_getRawTag.mjs +18 -0
- package/lib/node_modules/lodash-es/_getSymbols.cjs +1 -0
- package/lib/node_modules/lodash-es/_getSymbols.mjs +14 -0
- package/lib/node_modules/lodash-es/_getTag.cjs +1 -0
- package/lib/node_modules/lodash-es/_getTag.mjs +25 -0
- package/lib/node_modules/lodash-es/_getValue.cjs +1 -0
- package/lib/node_modules/lodash-es/_getValue.mjs +9 -0
- package/lib/node_modules/lodash-es/_hasPath.cjs +1 -0
- package/lib/node_modules/lodash-es/_hasPath.mjs +23 -0
- package/lib/node_modules/lodash-es/_hasUnicode.cjs +1 -0
- package/lib/node_modules/lodash-es/_hasUnicode.mjs +11 -0
- package/lib/node_modules/lodash-es/_hashClear.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashClear.mjs +12 -0
- package/lib/node_modules/lodash-es/_hashDelete.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashDelete.mjs +10 -0
- package/lib/node_modules/lodash-es/_hashGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashGet.mjs +17 -0
- package/lib/node_modules/lodash-es/_hashHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashHas.mjs +13 -0
- package/lib/node_modules/lodash-es/_hashSet.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashSet.mjs +13 -0
- package/lib/node_modules/lodash-es/_isFlattenable.cjs +1 -0
- package/lib/node_modules/lodash-es/_isFlattenable.mjs +14 -0
- package/lib/node_modules/lodash-es/_isIndex.cjs +1 -0
- package/lib/node_modules/lodash-es/_isIndex.mjs +12 -0
- package/lib/node_modules/lodash-es/_isKey.cjs +1 -0
- package/lib/node_modules/lodash-es/_isKey.mjs +15 -0
- package/lib/node_modules/lodash-es/_isKeyable.cjs +1 -0
- package/lib/node_modules/lodash-es/_isKeyable.mjs +10 -0
- package/lib/node_modules/lodash-es/_isMasked.cjs +1 -0
- package/lib/node_modules/lodash-es/_isMasked.mjs +15 -0
- package/lib/node_modules/lodash-es/_isPrototype.cjs +1 -0
- package/lib/node_modules/lodash-es/_isPrototype.mjs +12 -0
- package/lib/node_modules/lodash-es/_isStrictComparable.cjs +1 -0
- package/lib/node_modules/lodash-es/_isStrictComparable.mjs +12 -0
- package/lib/node_modules/lodash-es/_listCacheClear.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheClear.mjs +9 -0
- package/lib/node_modules/lodash-es/_listCacheDelete.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheDelete.mjs +13 -0
- package/lib/node_modules/lodash-es/_listCacheGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheGet.mjs +13 -0
- package/lib/node_modules/lodash-es/_listCacheHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheHas.mjs +12 -0
- package/lib/node_modules/lodash-es/_listCacheSet.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheSet.mjs +13 -0
- package/lib/node_modules/lodash-es/_mapCacheClear.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheClear.mjs +18 -0
- package/lib/node_modules/lodash-es/_mapCacheDelete.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheDelete.mjs +13 -0
- package/lib/node_modules/lodash-es/_mapCacheGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheGet.mjs +12 -0
- package/lib/node_modules/lodash-es/_mapCacheHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheHas.mjs +12 -0
- package/lib/node_modules/lodash-es/_mapCacheSet.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheSet.mjs +13 -0
- package/lib/node_modules/lodash-es/_mapToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapToArray.mjs +12 -0
- package/lib/node_modules/lodash-es/_matchesStrictComparable.cjs +1 -0
- package/lib/node_modules/lodash-es/_matchesStrictComparable.mjs +11 -0
- package/lib/node_modules/lodash-es/_memoizeCapped.cjs +1 -0
- package/lib/node_modules/lodash-es/_memoizeCapped.mjs +15 -0
- package/lib/node_modules/lodash-es/_nativeCreate.cjs +1 -0
- package/lib/node_modules/lodash-es/_nativeCreate.mjs +9 -0
- package/lib/node_modules/lodash-es/_nativeKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_nativeKeys.mjs +9 -0
- package/lib/node_modules/lodash-es/_nodeUtil.cjs +1 -0
- package/lib/node_modules/lodash-es/_nodeUtil.mjs +13 -0
- package/lib/node_modules/lodash-es/_objectToString.cjs +1 -0
- package/lib/node_modules/lodash-es/_objectToString.mjs +11 -0
- package/lib/node_modules/lodash-es/_overArg.cjs +1 -0
- package/lib/node_modules/lodash-es/_overArg.mjs +11 -0
- package/lib/node_modules/lodash-es/_root.cjs +1 -0
- package/lib/node_modules/lodash-es/_root.mjs +9 -0
- package/lib/node_modules/lodash-es/_setCacheAdd.cjs +1 -0
- package/lib/node_modules/lodash-es/_setCacheAdd.mjs +11 -0
- package/lib/node_modules/lodash-es/_setCacheHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_setCacheHas.mjs +9 -0
- package/lib/node_modules/lodash-es/_setToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_setToArray.mjs +12 -0
- package/lib/node_modules/lodash-es/_stackClear.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackClear.mjs +12 -0
- package/lib/node_modules/lodash-es/_stackDelete.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackDelete.mjs +10 -0
- package/lib/node_modules/lodash-es/_stackGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackGet.mjs +9 -0
- package/lib/node_modules/lodash-es/_stackHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackHas.mjs +9 -0
- package/lib/node_modules/lodash-es/_stackSet.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackSet.mjs +20 -0
- package/lib/node_modules/lodash-es/_stringToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_stringToArray.mjs +14 -0
- package/lib/node_modules/lodash-es/_stringToPath.cjs +1 -0
- package/lib/node_modules/lodash-es/_stringToPath.mjs +14 -0
- package/lib/node_modules/lodash-es/_toKey.cjs +1 -0
- package/lib/node_modules/lodash-es/_toKey.mjs +14 -0
- package/lib/node_modules/lodash-es/_toSource.cjs +1 -0
- package/lib/node_modules/lodash-es/_toSource.mjs +19 -0
- package/lib/node_modules/lodash-es/_trimmedEndIndex.cjs +1 -0
- package/lib/node_modules/lodash-es/_trimmedEndIndex.mjs +12 -0
- package/lib/node_modules/lodash-es/_unicodeToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_unicodeToArray.mjs +21 -0
- package/lib/node_modules/lodash-es/capitalize.cjs +1 -0
- package/lib/node_modules/lodash-es/capitalize.mjs +13 -0
- package/lib/node_modules/lodash-es/concat.cjs +1 -0
- package/lib/node_modules/lodash-es/concat.mjs +18 -0
- package/lib/node_modules/lodash-es/eq.cjs +1 -0
- package/lib/node_modules/lodash-es/eq.mjs +9 -0
- package/lib/node_modules/lodash-es/first.cjs +1 -0
- package/lib/node_modules/lodash-es/first.mjs +9 -0
- package/lib/node_modules/lodash-es/flatten.cjs +1 -0
- package/lib/node_modules/lodash-es/flatten.mjs +12 -0
- package/lib/node_modules/lodash-es/flattenDeep.cjs +1 -0
- package/lib/node_modules/lodash-es/flattenDeep.mjs +12 -0
- package/lib/node_modules/lodash-es/flattenDepth.cjs +1 -0
- package/lib/node_modules/lodash-es/flattenDepth.mjs +13 -0
- package/lib/node_modules/lodash-es/forEach.cjs +1 -0
- package/lib/node_modules/lodash-es/forEach.mjs +15 -0
- package/lib/node_modules/lodash-es/get.cjs +1 -0
- package/lib/node_modules/lodash-es/get.mjs +13 -0
- package/lib/node_modules/lodash-es/groupBy.cjs +1 -0
- package/lib/node_modules/lodash-es/groupBy.mjs +12 -0
- package/lib/node_modules/lodash-es/hasIn.cjs +1 -0
- package/lib/node_modules/lodash-es/hasIn.mjs +13 -0
- package/lib/node_modules/lodash-es/head.cjs +1 -0
- package/lib/node_modules/lodash-es/head.mjs +9 -0
- package/lib/node_modules/lodash-es/identity.cjs +1 -0
- package/lib/node_modules/lodash-es/identity.mjs +9 -0
- package/lib/node_modules/lodash-es/isArguments.cjs +1 -0
- package/lib/node_modules/lodash-es/isArguments.mjs +14 -0
- package/lib/node_modules/lodash-es/isArray.cjs +1 -0
- package/lib/node_modules/lodash-es/isArray.mjs +8 -0
- package/lib/node_modules/lodash-es/isArrayLike.cjs +1 -0
- package/lib/node_modules/lodash-es/isArrayLike.mjs +13 -0
- package/lib/node_modules/lodash-es/isBuffer.cjs +1 -0
- package/lib/node_modules/lodash-es/isBuffer.mjs +10 -0
- package/lib/node_modules/lodash-es/isEmpty.cjs +1 -0
- package/lib/node_modules/lodash-es/isEmpty.mjs +25 -0
- package/lib/node_modules/lodash-es/isFunction.cjs +1 -0
- package/lib/node_modules/lodash-es/isFunction.mjs +15 -0
- package/lib/node_modules/lodash-es/isLength.cjs +1 -0
- package/lib/node_modules/lodash-es/isLength.mjs +11 -0
- package/lib/node_modules/lodash-es/isNil.cjs +1 -0
- package/lib/node_modules/lodash-es/isNil.mjs +9 -0
- package/lib/node_modules/lodash-es/isObject.cjs +1 -0
- package/lib/node_modules/lodash-es/isObject.mjs +10 -0
- package/lib/node_modules/lodash-es/isObjectLike.cjs +1 -0
- package/lib/node_modules/lodash-es/isObjectLike.mjs +9 -0
- package/lib/node_modules/lodash-es/isSymbol.cjs +1 -0
- package/lib/node_modules/lodash-es/isSymbol.mjs +13 -0
- package/lib/node_modules/lodash-es/isTypedArray.cjs +1 -0
- package/lib/node_modules/lodash-es/isTypedArray.mjs +11 -0
- package/lib/node_modules/lodash-es/keys.cjs +1 -0
- package/lib/node_modules/lodash-es/keys.mjs +14 -0
- package/lib/node_modules/lodash-es/last.cjs +1 -0
- package/lib/node_modules/lodash-es/last.mjs +10 -0
- package/lib/node_modules/lodash-es/lodash.cjs +1 -0
- package/lib/node_modules/lodash-es/lodash.mjs +46 -0
- package/lib/node_modules/lodash-es/memoize.cjs +1 -0
- package/lib/node_modules/lodash-es/memoize.mjs +19 -0
- package/lib/node_modules/lodash-es/nth.cjs +1 -0
- package/lib/node_modules/lodash-es/nth.mjs +13 -0
- package/lib/node_modules/lodash-es/property.cjs +1 -0
- package/lib/node_modules/lodash-es/property.mjs +15 -0
- package/lib/node_modules/lodash-es/reduce.cjs +1 -0
- package/lib/node_modules/lodash-es/reduce.mjs +17 -0
- package/lib/node_modules/lodash-es/stubArray.cjs +1 -0
- package/lib/node_modules/lodash-es/stubArray.mjs +9 -0
- package/lib/node_modules/lodash-es/stubFalse.cjs +1 -0
- package/lib/node_modules/lodash-es/stubFalse.mjs +9 -0
- package/lib/node_modules/lodash-es/toFinite.cjs +1 -0
- package/lib/node_modules/lodash-es/toFinite.mjs +12 -0
- package/lib/node_modules/lodash-es/toInteger.cjs +1 -0
- package/lib/node_modules/lodash-es/toInteger.mjs +13 -0
- package/lib/node_modules/lodash-es/toNumber.cjs +1 -0
- package/lib/node_modules/lodash-es/toNumber.mjs +23 -0
- package/lib/node_modules/lodash-es/toString.cjs +1 -0
- package/lib/node_modules/lodash-es/toString.mjs +12 -0
- package/lib/node_modules/lodash-es/upperFirst.cjs +1 -0
- package/lib/node_modules/lodash-es/upperFirst.mjs +9 -0
- package/lib/node_modules/parsimmon/build/parsimmon.umd.min.cjs +16 -0
- package/lib/node_modules/parsimmon/build/parsimmon.umd.min.mjs +689 -0
- package/lib/node_modules/pluralize/pluralize.cjs +1 -0
- package/lib/node_modules/pluralize/pluralize.mjs +276 -0
- package/lib/packages/dbml-core/node_modules/lodash/lodash.cjs +20 -0
- package/lib/packages/dbml-core/node_modules/lodash/lodash.mjs +3306 -0
- package/lib/packages/dbml-core/package.json.cjs +1 -0
- package/lib/{package.json.mjs → packages/dbml-core/package.json.mjs} +1 -1
- package/lib/parse/ANTLR/ASTGeneration/helpers.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/helpers.mjs +5 -3
- package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.mjs +149 -143
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.mjs +146 -142
- package/lib/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.mjs +184 -181
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.mjs +149 -145
- package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.mjs +89 -85
- package/lib/parse/deprecated/dbmlParser.cjs +3 -3
- package/lib/parse/deprecated/dbmlParser.mjs +27 -25
- package/lib/parse/deprecated/mssql/base_parsers.cjs +1 -1
- package/lib/parse/deprecated/mssql/base_parsers.mjs +38 -38
- package/lib/parse/deprecated/mssql/column_definition/actions.cjs +1 -1
- package/lib/parse/deprecated/mssql/column_definition/actions.mjs +9 -6
- package/lib/parse/deprecated/mssql/column_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/column_definition/index.mjs +28 -28
- package/lib/parse/deprecated/mssql/constraint_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/constraint_definition/index.mjs +24 -24
- package/lib/parse/deprecated/mssql/expression.cjs +1 -1
- package/lib/parse/deprecated/mssql/expression.mjs +28 -27
- package/lib/parse/deprecated/mssql/fk_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/fk_definition/index.mjs +20 -20
- package/lib/parse/deprecated/mssql/index_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/index_definition/index.mjs +21 -21
- package/lib/parse/deprecated/mssql/keyword_utils.cjs +1 -1
- package/lib/parse/deprecated/mssql/keyword_utils.mjs +13 -13
- package/lib/parse/deprecated/mssql/statements/actions.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/actions.mjs +36 -33
- package/lib/parse/deprecated/mssql/statements/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/index.mjs +28 -28
- 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 +24 -24
- package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/index.mjs +16 -16
- package/lib/parse/deprecated/mssql/statements/statement_types/comments/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/comments/index.mjs +31 -31
- 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 +20 -20
- 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 +21 -21
- package/lib/parse/deprecated/mssql/utils.cjs +1 -1
- package/lib/parse/deprecated/mssql/utils.mjs +21 -20
- package/lib/parse/deprecated/mssql/whitespaces.cjs +1 -1
- package/lib/parse/deprecated/mssql/whitespaces.mjs +11 -11
- package/lib/parse/deprecated/mysqlParser.cjs +6 -6
- package/lib/parse/deprecated/mysqlParser.mjs +20 -18
- package/lib/parse/deprecated/postgresParser.cjs +2 -2
- package/lib/parse/deprecated/postgresParser.mjs +25 -23
- package/lib/parse/deprecated/schemarbParser.cjs +10 -10
- package/lib/parse/deprecated/schemarbParser.mjs +313 -311
- package/lib/utils/version.cjs +1 -1
- package/lib/utils/version.mjs +1 -1
- package/package.json +2 -2
- package/lib/package.json.cjs +0 -1
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import s from "./
|
|
5
|
-
import c from "./
|
|
6
|
-
import l from "./
|
|
7
|
-
import u from "./
|
|
8
|
-
import d from "./
|
|
9
|
-
import f from "./
|
|
10
|
-
import p from "./
|
|
11
|
-
import m from "./
|
|
12
|
-
import
|
|
13
|
-
import
|
|
1
|
+
import e from "../node_modules/lodash-es/get.mjs";
|
|
2
|
+
import t from "../node_modules/lodash-es/capitalize.mjs";
|
|
3
|
+
import { init_lodash as n } from "../node_modules/lodash-es/lodash.mjs";
|
|
4
|
+
import { DEFAULT_SCHEMA_NAME as r, ENUM as i, NOTE as a, TABLE as o, TABLE_GROUP as s } from "./config.mjs";
|
|
5
|
+
import c from "./dbState.mjs";
|
|
6
|
+
import l from "./element.mjs";
|
|
7
|
+
import u from "./dep.mjs";
|
|
8
|
+
import d from "./enum.mjs";
|
|
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";
|
|
14
|
+
import _ from "./tablePartial.mjs";
|
|
15
|
+
import { makeCardinalityRequired as v, parseCardinality as y } from "@dbml/parse";
|
|
14
16
|
//#region src/model_structure/database.ts
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
n();
|
|
18
|
+
var b = class extends l {
|
|
19
|
+
constructor({ schemas: t = [], tables: n = [], notes: l = [], enums: u = [], refs: d = [], deps: p = [], tableGroups: m = [], project: h = {}, aliases: g = [], records: _ = [], tablePartials: v = [], diagramViews: y = [] } = {}) {
|
|
20
|
+
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) => {
|
|
21
|
+
let t = this.findOrCreateSchema(r), n = new f({
|
|
22
|
+
...e,
|
|
23
|
+
schema: t
|
|
21
24
|
});
|
|
22
|
-
|
|
25
|
+
t.refs.some((e) => e.equals(n)) || t.pushRef(n);
|
|
23
26
|
});
|
|
24
27
|
}
|
|
25
28
|
generateId() {
|
|
@@ -27,7 +30,7 @@ var y = class extends o {
|
|
|
27
30
|
}
|
|
28
31
|
processNotes(e) {
|
|
29
32
|
e.forEach((e) => {
|
|
30
|
-
this.pushNote(new
|
|
33
|
+
this.pushNote(new g({
|
|
31
34
|
...e,
|
|
32
35
|
database: this
|
|
33
36
|
}));
|
|
@@ -48,7 +51,7 @@ var y = class extends o {
|
|
|
48
51
|
}
|
|
49
52
|
processTablePartials(e) {
|
|
50
53
|
e.forEach((e) => {
|
|
51
|
-
this.tablePartials.push(new
|
|
54
|
+
this.tablePartials.push(new _({
|
|
52
55
|
...e,
|
|
53
56
|
dbState: this.dbState
|
|
54
57
|
}));
|
|
@@ -62,7 +65,7 @@ var y = class extends o {
|
|
|
62
65
|
}
|
|
63
66
|
processSchemas(e) {
|
|
64
67
|
e.forEach((e) => {
|
|
65
|
-
this.pushSchema(new
|
|
68
|
+
this.pushSchema(new h({
|
|
66
69
|
...e,
|
|
67
70
|
database: this
|
|
68
71
|
}));
|
|
@@ -74,38 +77,38 @@ var y = class extends o {
|
|
|
74
77
|
checkSchema(e) {
|
|
75
78
|
this.schemas.some((t) => t.name === e.name) && e.error(`Schemas ${e.name} existed`);
|
|
76
79
|
}
|
|
77
|
-
processSchemaElements(
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
switch (
|
|
81
|
-
case
|
|
82
|
-
|
|
83
|
-
...
|
|
84
|
-
schema:
|
|
80
|
+
processSchemaElements(e, t) {
|
|
81
|
+
let n;
|
|
82
|
+
e.forEach((e) => {
|
|
83
|
+
switch (e.schemaName ? (n = this.findOrCreateSchema(e.schemaName), e.schemaName) : n = this.findOrCreateSchema(r), t) {
|
|
84
|
+
case o:
|
|
85
|
+
n.pushTable(new p({
|
|
86
|
+
...e,
|
|
87
|
+
schema: n
|
|
85
88
|
}));
|
|
86
89
|
break;
|
|
87
|
-
case
|
|
88
|
-
|
|
89
|
-
...
|
|
90
|
-
schema:
|
|
90
|
+
case i:
|
|
91
|
+
n.pushEnum(new d({
|
|
92
|
+
...e,
|
|
93
|
+
schema: n
|
|
91
94
|
}));
|
|
92
95
|
break;
|
|
93
|
-
case
|
|
94
|
-
|
|
95
|
-
...
|
|
96
|
-
schema:
|
|
96
|
+
case s:
|
|
97
|
+
n.pushTableGroup(new m({
|
|
98
|
+
...e,
|
|
99
|
+
schema: n
|
|
97
100
|
}));
|
|
98
101
|
break;
|
|
99
102
|
case "ref":
|
|
100
|
-
|
|
101
|
-
...
|
|
102
|
-
schema:
|
|
103
|
+
n.pushRef(new f({
|
|
104
|
+
...e,
|
|
105
|
+
schema: n
|
|
103
106
|
}));
|
|
104
107
|
break;
|
|
105
108
|
case "dep":
|
|
106
|
-
|
|
107
|
-
...
|
|
108
|
-
schema:
|
|
109
|
+
n.pushDep(new u({
|
|
110
|
+
...e,
|
|
111
|
+
schema: n
|
|
109
112
|
}));
|
|
110
113
|
break;
|
|
111
114
|
default: break;
|
|
@@ -123,11 +126,11 @@ var y = class extends o {
|
|
|
123
126
|
n && (t.tableId = n.id, n.records.push(t));
|
|
124
127
|
});
|
|
125
128
|
}
|
|
126
|
-
findOrCreateSchema(
|
|
127
|
-
let n = this.schemas.find((
|
|
128
|
-
return n || (n = new
|
|
129
|
-
name:
|
|
130
|
-
note: { value:
|
|
129
|
+
findOrCreateSchema(e) {
|
|
130
|
+
let n = this.schemas.find((t) => t.name === e || t.alias === e);
|
|
131
|
+
return n || (n = new h({
|
|
132
|
+
name: e,
|
|
133
|
+
note: { value: e === "public" ? `Default ${t(r)} Schema` : null },
|
|
131
134
|
database: this
|
|
132
135
|
}), this.pushSchema(n)), n;
|
|
133
136
|
}
|
|
@@ -155,10 +158,10 @@ var y = class extends o {
|
|
|
155
158
|
adjustCardinalitiesFromColumns() {
|
|
156
159
|
this.schemas.forEach((e) => {
|
|
157
160
|
e.refs.forEach((e) => {
|
|
158
|
-
let t = e.endpoints.find((e) =>
|
|
161
|
+
let t = e.endpoints.find((e) => y(e.relation).max === "*"), n = e.endpoints.find((e) => y(e.relation).max === 1);
|
|
159
162
|
if (!n) return;
|
|
160
163
|
let r, i;
|
|
161
|
-
t ? (r = t, i = n) : (r = e.endpoints[1], i = e.endpoints[0]), !(!r || !i) && r.fields.every((e) => e.not_null || e.pk || e.increment) && (i.relation =
|
|
164
|
+
t ? (r = t, i = n) : (r = e.endpoints[1], i = e.endpoints[0]), !(!r || !i) && r.fields.every((e) => e.not_null || e.pk || e.increment) && (i.relation = v(i.relation));
|
|
162
165
|
});
|
|
163
166
|
});
|
|
164
167
|
}
|
|
@@ -216,4 +219,4 @@ var y = class extends o {
|
|
|
216
219
|
}
|
|
217
220
|
};
|
|
218
221
|
//#endregion
|
|
219
|
-
export {
|
|
222
|
+
export { b as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs"),require("./config.cjs");const
|
|
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,19 +1,21 @@
|
|
|
1
|
+
import e from "../node_modules/lodash-es/get.mjs";
|
|
2
|
+
import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
3
|
import "./config.mjs";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { get as n } from "lodash-es";
|
|
4
|
+
import n from "./element.mjs";
|
|
5
|
+
import r from "./depEdge.mjs";
|
|
5
6
|
//#region src/model_structure/dep.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
t();
|
|
8
|
+
var i = class extends n {
|
|
9
|
+
constructor({ name: t, color: n, note: r, metadata: i, edges: a, token: o, schema: s = {} }) {
|
|
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 ?? []);
|
|
9
11
|
}
|
|
10
12
|
generateId() {
|
|
11
13
|
this.id = this.dbState.generateId("depId");
|
|
12
14
|
}
|
|
13
15
|
processEdges(e) {
|
|
14
16
|
e.forEach((e) => {
|
|
15
|
-
let
|
|
16
|
-
|
|
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
19
|
...e,
|
|
18
20
|
dep: this
|
|
19
21
|
}));
|
|
@@ -52,4 +54,4 @@ var r = class extends e {
|
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
56
|
//#endregion
|
|
55
|
-
export {
|
|
57
|
+
export { i as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=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,18 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "
|
|
3
|
-
import n from "./
|
|
4
|
-
import
|
|
1
|
+
import e from "../node_modules/lodash-es/get.mjs";
|
|
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";
|
|
5
6
|
//#region src/model_structure/enum.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
t();
|
|
8
|
+
var a = class extends r {
|
|
9
|
+
constructor({ name: t, token: n, values: r, note: i, schema: a, noteToken: o = null } = {}) {
|
|
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);
|
|
9
11
|
}
|
|
10
12
|
generateId() {
|
|
11
13
|
this.id = this.dbState.generateId("enumId");
|
|
12
14
|
}
|
|
13
15
|
processValues(e) {
|
|
14
16
|
e.forEach((e) => {
|
|
15
|
-
this.pushValue(new
|
|
17
|
+
this.pushValue(new i({
|
|
16
18
|
...e,
|
|
17
19
|
_enum: this
|
|
18
20
|
}));
|
|
@@ -21,14 +23,14 @@ var i = class extends t {
|
|
|
21
23
|
pushValue(e) {
|
|
22
24
|
this.checkValue(e), this.values.push(e);
|
|
23
25
|
}
|
|
24
|
-
checkValue(
|
|
25
|
-
this.values.some((
|
|
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}"`);
|
|
26
28
|
}
|
|
27
29
|
pushField(e) {
|
|
28
30
|
this.checkField(e), this.fields.push(e);
|
|
29
31
|
}
|
|
30
|
-
checkField(
|
|
31
|
-
this.fields.some((
|
|
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}"`);
|
|
32
34
|
}
|
|
33
35
|
export() {
|
|
34
36
|
return {
|
|
@@ -64,4 +66,4 @@ var i = class extends t {
|
|
|
64
66
|
}
|
|
65
67
|
};
|
|
66
68
|
//#endregion
|
|
67
|
-
export {
|
|
69
|
+
export { a as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=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("./element.cjs");t.init_lodash();var r=class extends n.default{constructor({name:t,token:n,note:r,_enum:i,noteToken:a=null}={}){super(n),t||this.error(`Enum value must have a name`),this.name=t,this.note=r?e.default(r,`value`,r):null,this.noteToken=r?e.default(r,`token`,a):null,this._enum=i,this.dbState=this._enum.dbState,this.generateId()}generateId(){this.id=this.dbState.generateId(`enumValueId`)}export(){return{...this.shallowExport()}}exportParentIds(){return{enumId:this._enum.id}}shallowExport(){return{name:this.name,note:this.note}}normalize(e){e.enumValues[this.id]={id:this.id,...this.shallowExport(),...this.exportParentIds()}}};exports.default=r;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import {
|
|
1
|
+
import e from "../node_modules/lodash-es/get.mjs";
|
|
2
|
+
import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
|
|
3
|
+
import n from "./element.mjs";
|
|
3
4
|
//#region src/model_structure/enumValue.js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
t();
|
|
6
|
+
var r = class extends n {
|
|
7
|
+
constructor({ name: t, token: n, note: r, _enum: i, noteToken: a = null } = {}) {
|
|
8
|
+
super(n), t || this.error("Enum value must have a name"), this.name = t, this.note = r ? e(r, "value", r) : null, this.noteToken = r ? e(r, "token", a) : null, this._enum = i, this.dbState = this._enum.dbState, this.generateId();
|
|
7
9
|
}
|
|
8
10
|
generateId() {
|
|
9
11
|
this.id = this.dbState.generateId("enumValueId");
|
|
@@ -29,4 +31,4 @@ var n = class extends e {
|
|
|
29
31
|
}
|
|
30
32
|
};
|
|
31
33
|
//#endregion
|
|
32
|
-
export {
|
|
34
|
+
export { r as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs"),require("./config.cjs");const
|
|
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,13 @@
|
|
|
1
|
+
import e from "../node_modules/lodash-es/get.mjs";
|
|
2
|
+
import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
3
|
import "./config.mjs";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { get as n } from "lodash-es";
|
|
4
|
+
import n from "./element.mjs";
|
|
5
|
+
import r from "./check.mjs";
|
|
5
6
|
//#region src/model_structure/field.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
t();
|
|
8
|
+
var i = class extends n {
|
|
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
|
+
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);
|
|
9
11
|
}
|
|
10
12
|
generateId() {
|
|
11
13
|
this.id = this.dbState.generateId("fieldId");
|
|
@@ -71,7 +73,7 @@ var r = class extends e {
|
|
|
71
73
|
}
|
|
72
74
|
processChecks(e) {
|
|
73
75
|
e.forEach((e) => {
|
|
74
|
-
this.checks.push(new
|
|
76
|
+
this.checks.push(new r({
|
|
75
77
|
...e,
|
|
76
78
|
table: this.table,
|
|
77
79
|
column: this
|
|
@@ -80,4 +82,4 @@ var r = class extends e {
|
|
|
80
82
|
}
|
|
81
83
|
};
|
|
82
84
|
//#endregion
|
|
83
|
-
export {
|
|
85
|
+
export { i as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=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,22 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "
|
|
3
|
-
import n from "./
|
|
4
|
-
import r from "./
|
|
5
|
-
import i from "./
|
|
6
|
-
import a from "./
|
|
7
|
-
import o from "./
|
|
8
|
-
import
|
|
1
|
+
import e from "../node_modules/lodash-es/get.mjs";
|
|
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 "./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";
|
|
9
10
|
//#region src/model_structure/schema.ts
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
t();
|
|
12
|
+
var l = class extends r {
|
|
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 } = {}) {
|
|
14
|
+
super(l), this.tables = [], this.enums = [], this.tableGroups = [], this.refs = [], this.deps = [], this.name = t, this.note = r ? e(r, "value", typeof r == "string" ? r : null) : null, this.noteToken = r ? e(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);
|
|
13
15
|
}
|
|
14
16
|
generateId() {
|
|
15
17
|
this.id = this.dbState.generateId("schemaId");
|
|
16
18
|
}
|
|
17
19
|
processTables(e) {
|
|
18
20
|
e.forEach((e) => {
|
|
19
|
-
this.pushTable(new
|
|
21
|
+
this.pushTable(new s({
|
|
20
22
|
...e,
|
|
21
23
|
schema: this
|
|
22
24
|
}));
|
|
@@ -25,15 +27,15 @@ var c = class extends t {
|
|
|
25
27
|
pushTable(e) {
|
|
26
28
|
this.checkTable(e), this.tables.push(e);
|
|
27
29
|
}
|
|
28
|
-
checkTable(
|
|
29
|
-
this.tables.some((
|
|
30
|
+
checkTable(e) {
|
|
31
|
+
this.tables.some((t) => t.name === e.name) && e.error(`Table ${n(this) ? `"${this.name}".` : ""}"${e.name}" existed`);
|
|
30
32
|
}
|
|
31
33
|
findTable(e) {
|
|
32
34
|
return this.tables.find((t) => t.name === e);
|
|
33
35
|
}
|
|
34
36
|
processEnums(e) {
|
|
35
37
|
e.forEach((e) => {
|
|
36
|
-
this.pushEnum(new
|
|
38
|
+
this.pushEnum(new a({
|
|
37
39
|
...e,
|
|
38
40
|
schema: this
|
|
39
41
|
}));
|
|
@@ -42,12 +44,12 @@ var c = class extends t {
|
|
|
42
44
|
pushEnum(e) {
|
|
43
45
|
this.checkEnum(e), this.enums.push(e);
|
|
44
46
|
}
|
|
45
|
-
checkEnum(
|
|
46
|
-
this.enums.some((
|
|
47
|
+
checkEnum(e) {
|
|
48
|
+
this.enums.some((t) => t.name === e.name) && e.error(`Enum ${n(this) ? `"${this.name}".` : ""}"${e.name}" existed`);
|
|
47
49
|
}
|
|
48
50
|
processRefs(e) {
|
|
49
51
|
e.forEach((e) => {
|
|
50
|
-
this.pushRef(new
|
|
52
|
+
this.pushRef(new o({
|
|
51
53
|
...e,
|
|
52
54
|
schema: this
|
|
53
55
|
}));
|
|
@@ -64,7 +66,7 @@ var c = class extends t {
|
|
|
64
66
|
}
|
|
65
67
|
processDeps(e) {
|
|
66
68
|
e.forEach((e) => {
|
|
67
|
-
this.pushDep(new
|
|
69
|
+
this.pushDep(new i({
|
|
68
70
|
...e,
|
|
69
71
|
schema: this
|
|
70
72
|
}));
|
|
@@ -75,7 +77,7 @@ var c = class extends t {
|
|
|
75
77
|
}
|
|
76
78
|
processTableGroups(e) {
|
|
77
79
|
e.forEach((e) => {
|
|
78
|
-
this.pushTableGroup(new
|
|
80
|
+
this.pushTableGroup(new c({
|
|
79
81
|
...e,
|
|
80
82
|
schema: this
|
|
81
83
|
}));
|
|
@@ -84,8 +86,8 @@ var c = class extends t {
|
|
|
84
86
|
pushTableGroup(e) {
|
|
85
87
|
this.checkTableGroup(e), this.tableGroups.push(e);
|
|
86
88
|
}
|
|
87
|
-
checkTableGroup(
|
|
88
|
-
this.tableGroups.some((
|
|
89
|
+
checkTableGroup(e) {
|
|
90
|
+
this.tableGroups.some((t) => t.name === e.name) && e.error(`Table Group ${n(this) ? `"${this.name}".` : ""}"${e.name}" existed`);
|
|
89
91
|
}
|
|
90
92
|
checkSameId(e) {
|
|
91
93
|
return this.name === e.name || this.alias === e.name || this.name === e.alias || !!this.alias && this.alias === e.alias;
|
|
@@ -134,4 +136,4 @@ var c = class extends t {
|
|
|
134
136
|
}
|
|
135
137
|
};
|
|
136
138
|
//#endregion
|
|
137
|
-
export {
|
|
139
|
+
export { l as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs"),require("./config.cjs");const
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/isNil.cjs"),n=require("../node_modules/lodash-es/lodash.cjs");require("./config.cjs");const r=require("./utils.cjs"),i=require("./element.cjs"),a=require("./check.cjs"),o=require("./field.cjs"),s=require("./indexes.cjs");let c=require("@dbml/parse");n.init_lodash();var l=class extends i.default{constructor({name:t,alias:n,note:r,fields:i=[],indexes:a=[],checks:o=[],schema:s={},token:c,headerColor:l,noteToken:u=null,partials:d=[],metadata:f={}}){super(c),this.metadata=f,this.name=t,this.alias=n,this.note=r?e.default(r,`value`,r):null,this.noteToken=r?e.default(r,`token`,u):null,this.headerColor=l,this.fields=[],this.indexes=[],this.checks=[],this.schema=s,this.partials=d,this.records=[],this.dbState=this.schema.dbState,this.generateId(),this.processFields(i),this.processPartials(),this.checkFieldCount(),this.processIndexes(a),this.processChecks(o)}generateId(){this.id=this.dbState.generateId(`tableId`)}checkFieldCount(){this.fields.length===0&&this.error(`Table must have at least one field`)}processFields(e){e.forEach(e=>{this.pushField(new o.default({...e,table:this}))})}pushField(e){this.checkField(e),this.fields.push(e)}checkField(e){this.fields.some(t=>t.name===e.name)&&e.error(`Field "${e.name}" existed in table ${r.shouldPrintSchema(this.schema)?`"${this.schema.name}".`:``}"${this.name}"`)}processIndexes(e){e.forEach(e=>{this.pushIndex(new s.default({...e,table:this}))})}pushIndex(e){this.checkIndex(e),this.indexes.push(e)}checkIndex(e){e.columns.forEach(t=>{t.type===`column`&&!this.findField(t.value)&&e.error(`Column "${t.value}" do not exist in table ${r.shouldPrintSchema(this.schema)?`"${this.schema.name}".`:``}"${this.name}"`)})}processChecks(e){e.forEach(e=>{this.pushCheck(new a.default({...e,table:this}))})}pushCheck(e){this.checks.push(e)}findField(e){return this.fields.find(t=>t.name===e)}checkSameId(e){return this.schema.checkSameId(e.schemaName||`public`)&&(this.name===e.name||this.alias===e.name||this.name===e.alias||this.alias&&this.alias===e.alias)}processPartials(){if(!this.partials?.length)return;let e=new Set(this.fields.map(e=>e.name)),n=new Set;t.default(this.note)||n.add(`note`),t.default(this.headerColor)||n.add(`headerColor`);let r=this.partials.sort((e,t)=>t.order-e.order);r.toReversed().forEach(e=>{this.fields.splice(e.order,0,`dummy`)}),r.forEach(r=>{let i=this.schema.database.findTablePartial(r.name);if(i||this.error(`Table partial ${r.name} not found`),r.id=i.id,i.fields){let t=i.fields.filter(t=>!e.has(t.name)).map(t=>(e.add(t.name),t.inline_refs&&t.inline_refs.forEach(e=>{let n=(0,c.getMultiplicities)(e.relation)||[`*`,`*`],r={token:t.token,endpoints:[{tableName:this.name,schemaName:this.schema?.name,fieldNames:[t.name],relation:n[0],token:t.token},{tableName:e.tableName,schemaName:e.schemaName,fieldNames:e.fieldNames,relation:n[1],token:e.token}],injectedPartial:i};this.schema.database.injectedRawRefs.push(r)}),new o.default({...t,noteToken:null,table:this,injectedPartial:i,injectedToken:r.token})));this.fields.splice(r.order,1,...t)}else this.fields.splice(r.order,1);!n.has(`note`)&&!t.default(i.note)&&(this.noteToken=null,this.note=i.note,n.add(`note`)),!n.has(`headerColor`)&&!t.default(i.headerColor)&&(this.headerColor=i.headerColor,n.add(`headerColor`)),i.indexes.forEach(e=>{this.indexes.push(new s.default({...e,table:this,injectedPartial:i}))}),i.checks.forEach(e=>{this.checks.push(new a.default({...e,name:e.name&&`${this.name}.${e.name}`,table:this,injectedPartial:i}))})})}export(){return{...this.shallowExport(),...this.exportChild()}}exportChild(){return{fields:this.fields.map(e=>e.export()),indexes:this.indexes.map(e=>e.export())}}exportChildIds(){return{fieldIds:this.fields.map(e=>e.id),indexIds:this.indexes.map(e=>e.id),checkIds:this.checks.map(e=>e.id)}}exportParentIds(){return{schemaId:this.schema.id,groupId:this.group?this.group.id:null}}shallowExport(){return{name:this.name,alias:this.alias,note:this.note,headerColor:this.headerColor,partials:this.partials,recordIds:this.records.map(e=>e.id),metadata:this.metadata}}normalize(e){e.tables[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.fields.forEach(t=>t.normalize(e)),this.indexes.forEach(t=>t.normalize(e)),this.checks.forEach(t=>t.normalize(e))}};exports.default=l;
|