@dbml/core 10.3.0 → 10.4.0-alpha.0
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 +2 -2
- package/lib/export/DbmlExporter.mjs +7 -5
- package/lib/export/MysqlExporter.cjs +1 -1
- package/lib/export/MysqlExporter.mjs +4 -4
- package/lib/export/OracleExporter.cjs +1 -1
- package/lib/export/OracleExporter.mjs +5 -5
- package/lib/export/PostgresExporter.cjs +1 -1
- package/lib/export/PostgresExporter.mjs +4 -4
- package/lib/export/SqlServerExporter.cjs +1 -1
- package/lib/export/SqlServerExporter.mjs +4 -4
- package/lib/model_structure/database.cjs +1 -1
- package/lib/model_structure/database.mjs +3 -3
- package/lib/model_structure/dep.cjs +1 -1
- package/lib/model_structure/dep.mjs +2 -2
- package/lib/model_structure/enum.cjs +1 -1
- package/lib/model_structure/enum.mjs +2 -2
- package/lib/model_structure/enumValue.cjs +1 -1
- package/lib/model_structure/enumValue.mjs +2 -2
- package/lib/model_structure/field.cjs +1 -1
- package/lib/model_structure/field.mjs +2 -2
- package/lib/model_structure/ref.cjs +1 -1
- package/lib/model_structure/ref.mjs +3 -2
- package/lib/model_structure/schema.cjs +1 -1
- package/lib/model_structure/schema.mjs +2 -2
- package/lib/model_structure/table.cjs +1 -1
- package/lib/model_structure/table.mjs +3 -3
- package/lib/model_structure/tableGroup.cjs +1 -1
- package/lib/model_structure/tableGroup.mjs +2 -2
- package/lib/model_structure/tablePartial.cjs +1 -1
- package/lib/model_structure/tablePartial.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_DataView.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_DataView.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Hash.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_Hash.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_ListCache.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Map.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_Map.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_MapCache.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Promise.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_Promise.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Set.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_Set.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_SetCache.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Stack.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_Stack.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_Symbol.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_Uint8Array.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_WeakMap.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayAggregator.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_arrayAggregator.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_arrayEach.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_arrayFilter.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_arrayLikeKeys.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_arrayMap.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_arrayPush.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_arrayReduce.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_arraySome.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_asciiToArray.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_asciiToArray.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_assocIndexOf.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAggregator.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseAggregator.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseAssignValue.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseEach.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseFlatten.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseFor.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseForOwn.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseGet.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseGetAllKeys.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseGetTag.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseIsArguments.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseIsEqual.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseIsEqualDeep.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMatch.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseIsMatch.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseIsNative.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseIsTypedArray.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseIteratee.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseKeys.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseMatches.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseMatchesProperty.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseNth.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseNth.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.mjs +11 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_basePropertyDeep.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseReduce.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSlice.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseSlice.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseTimes.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseToString.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_baseTrim.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.mjs +11 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_castFunction.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_castFunction.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_castPath.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_castPath.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_castSlice.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_castSlice.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_copyArray.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_coreJsData.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createAggregator.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_createAggregator.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_createBaseEach.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_createBaseFor.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createCaseFirst.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_createCaseFirst.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_defineProperty.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_equalArrays.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_equalByTag.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_equalObjects.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_freeGlobal.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_getAllKeys.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_getMapData.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_getMatchData.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getNative.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_getNative.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_getRawTag.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_getSymbols.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getTag.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_getTag.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getValue.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getValue.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_hasPath.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hasUnicode.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_hasUnicode.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_hashClear.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_hashDelete.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_hashGet.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_hashHas.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_hashSet.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_isFlattenable.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_isIndex.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isKey.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_isKey.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_isKeyable.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_isMasked.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_isPrototype.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_isStrictComparable.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_listCacheDelete.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_listCacheGet.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_listCacheHas.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_listCacheSet.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_mapCacheClear.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_mapCacheDelete.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_mapCacheGet.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_mapCacheHas.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_mapCacheSet.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_mapToArray.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_matchesStrictComparable.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_memoizeCapped.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_nativeCreate.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_nativeKeys.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_nodeUtil.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.mjs +11 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overArg.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overArg.mjs +11 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_root.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_root.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_setCacheAdd.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_setToArray.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_stackClear.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_stackDelete.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_stackSet.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stringToArray.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_stringToArray.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_stringToPath.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_toKey.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_toKey.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_toSource.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_toSource.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_trimmedEndIndex.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_unicodeToArray.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_unicodeToArray.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/capitalize.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/capitalize.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/concat.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/concat.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/eq.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/eq.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/first.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/first.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/flatten.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flattenDeep.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/flattenDeep.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flattenDepth.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/flattenDepth.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/forEach.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/forEach.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/get.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/groupBy.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/groupBy.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/hasIn.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/hasIn.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/head.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/head.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/identity.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/identity.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArguments.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/isArguments.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.mjs +8 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/isArrayLike.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/isBuffer.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/isEmpty.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isFunction.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/isFunction.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isLength.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/isLength.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNil.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNil.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/isObject.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/isSymbol.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/isTypedArray.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keys.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/keys.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/last.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/last.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/lodash.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/memoize.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/memoize.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/nth.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/nth.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/property.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/property.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/reduce.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/reduce.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubArray.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubArray.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.cjs +1 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.mjs +9 -0
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toFinite.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/toFinite.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toInteger.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/toInteger.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toNumber.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/toNumber.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toString.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/toString.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/upperFirst.cjs +1 -0
- package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/upperFirst.mjs +2 -2
- package/lib/node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.cjs +20 -0
- package/lib/{packages/dbml-core → node_modules/.pnpm/lodash@4.18.1}/node_modules/lodash/lodash.mjs +2 -2
- package/lib/node_modules/{parsimmon → .pnpm/parsimmon@1.18.1/node_modules/parsimmon}/build/parsimmon.umd.min.cjs +1 -1
- package/lib/node_modules/{parsimmon → .pnpm/parsimmon@1.18.1/node_modules/parsimmon}/build/parsimmon.umd.min.mjs +2 -2
- package/lib/node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.cjs +1 -0
- package/lib/node_modules/{pluralize → .pnpm/pluralize@8.0.0/node_modules/pluralize}/pluralize.mjs +2 -2
- package/lib/package.json.cjs +1 -0
- package/lib/{packages/dbml-core/package.json.mjs → package.json.mjs} +1 -1
- package/lib/parse/ANTLR/ASTGeneration/helpers.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/helpers.mjs +2 -2
- package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.mjs +6 -6
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.mjs +4 -4
- package/lib/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.mjs +3 -3
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.mjs +4 -4
- package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.mjs +4 -4
- package/lib/parse/deprecated/dbmlParser.cjs +1 -1
- package/lib/parse/deprecated/dbmlParser.mjs +2 -2
- package/lib/parse/deprecated/mssql/base_parsers.cjs +1 -1
- package/lib/parse/deprecated/mssql/base_parsers.mjs +1 -1
- package/lib/parse/deprecated/mssql/column_definition/actions.cjs +1 -1
- package/lib/parse/deprecated/mssql/column_definition/actions.mjs +2 -2
- package/lib/parse/deprecated/mssql/column_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/column_definition/index.mjs +1 -1
- package/lib/parse/deprecated/mssql/constraint_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/constraint_definition/index.mjs +1 -1
- package/lib/parse/deprecated/mssql/expression.cjs +1 -1
- package/lib/parse/deprecated/mssql/expression.mjs +3 -3
- package/lib/parse/deprecated/mssql/fk_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/fk_definition/index.mjs +1 -1
- package/lib/parse/deprecated/mssql/index_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/index_definition/index.mjs +1 -1
- package/lib/parse/deprecated/mssql/keyword_utils.cjs +1 -1
- package/lib/parse/deprecated/mssql/keyword_utils.mjs +1 -1
- package/lib/parse/deprecated/mssql/statements/actions.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/actions.mjs +2 -2
- package/lib/parse/deprecated/mssql/statements/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/index.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 +1 -1
- 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 +1 -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 +1 -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 +1 -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 +1 -1
- package/lib/parse/deprecated/mssql/utils.cjs +1 -1
- package/lib/parse/deprecated/mssql/utils.mjs +3 -3
- package/lib/parse/deprecated/mssql/whitespaces.cjs +1 -1
- package/lib/parse/deprecated/mssql/whitespaces.mjs +1 -1
- package/lib/parse/deprecated/mysqlParser.cjs +1 -1
- package/lib/parse/deprecated/mysqlParser.mjs +2 -2
- package/lib/parse/deprecated/postgresParser.cjs +1 -1
- package/lib/parse/deprecated/postgresParser.mjs +2 -2
- package/lib/parse/deprecated/schemarbParser.cjs +1 -1
- package/lib/parse/deprecated/schemarbParser.mjs +2 -2
- package/lib/utils/version.cjs +1 -1
- package/lib/utils/version.mjs +1 -1
- package/package.json +3 -3
- package/types/model_structure/ref.d.ts +7 -1
- package/types/tsconfig.tsbuildinfo +1 -0
- package/lib/node_modules/lodash-es/_DataView.cjs +0 -1
- package/lib/node_modules/lodash-es/_Hash.cjs +0 -1
- package/lib/node_modules/lodash-es/_ListCache.cjs +0 -1
- package/lib/node_modules/lodash-es/_Map.cjs +0 -1
- package/lib/node_modules/lodash-es/_MapCache.cjs +0 -1
- package/lib/node_modules/lodash-es/_Promise.cjs +0 -1
- package/lib/node_modules/lodash-es/_Set.cjs +0 -1
- package/lib/node_modules/lodash-es/_SetCache.cjs +0 -1
- package/lib/node_modules/lodash-es/_Stack.cjs +0 -1
- package/lib/node_modules/lodash-es/_Symbol.cjs +0 -1
- package/lib/node_modules/lodash-es/_Uint8Array.cjs +0 -1
- package/lib/node_modules/lodash-es/_WeakMap.cjs +0 -1
- package/lib/node_modules/lodash-es/_arrayAggregator.cjs +0 -1
- package/lib/node_modules/lodash-es/_arrayEach.cjs +0 -1
- package/lib/node_modules/lodash-es/_arrayFilter.cjs +0 -1
- package/lib/node_modules/lodash-es/_arrayLikeKeys.cjs +0 -1
- package/lib/node_modules/lodash-es/_arrayMap.cjs +0 -1
- package/lib/node_modules/lodash-es/_arrayPush.cjs +0 -1
- package/lib/node_modules/lodash-es/_arrayReduce.cjs +0 -1
- package/lib/node_modules/lodash-es/_arraySome.cjs +0 -1
- package/lib/node_modules/lodash-es/_asciiToArray.cjs +0 -1
- package/lib/node_modules/lodash-es/_asciiToArray.mjs +0 -9
- package/lib/node_modules/lodash-es/_assocIndexOf.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseAggregator.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseAssignValue.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseEach.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseFlatten.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseFor.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseForOwn.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseGet.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseGetAllKeys.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseGetTag.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseHasIn.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseHasIn.mjs +0 -9
- package/lib/node_modules/lodash-es/_baseIsArguments.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseIsEqual.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseIsEqualDeep.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseIsMatch.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseIsNative.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseIsTypedArray.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseIteratee.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseKeys.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseMatches.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseMatchesProperty.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseNth.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseProperty.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseProperty.mjs +0 -11
- package/lib/node_modules/lodash-es/_basePropertyDeep.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseReduce.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseSlice.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseTimes.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseToString.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseTrim.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseUnary.cjs +0 -1
- package/lib/node_modules/lodash-es/_baseUnary.mjs +0 -11
- package/lib/node_modules/lodash-es/_cacheHas.cjs +0 -1
- package/lib/node_modules/lodash-es/_cacheHas.mjs +0 -9
- package/lib/node_modules/lodash-es/_castFunction.cjs +0 -1
- package/lib/node_modules/lodash-es/_castPath.cjs +0 -1
- package/lib/node_modules/lodash-es/_castSlice.cjs +0 -1
- package/lib/node_modules/lodash-es/_copyArray.cjs +0 -1
- package/lib/node_modules/lodash-es/_coreJsData.cjs +0 -1
- package/lib/node_modules/lodash-es/_createAggregator.cjs +0 -1
- package/lib/node_modules/lodash-es/_createBaseEach.cjs +0 -1
- package/lib/node_modules/lodash-es/_createBaseFor.cjs +0 -1
- package/lib/node_modules/lodash-es/_createCaseFirst.cjs +0 -1
- package/lib/node_modules/lodash-es/_defineProperty.cjs +0 -1
- package/lib/node_modules/lodash-es/_equalArrays.cjs +0 -1
- package/lib/node_modules/lodash-es/_equalByTag.cjs +0 -1
- package/lib/node_modules/lodash-es/_equalObjects.cjs +0 -1
- package/lib/node_modules/lodash-es/_freeGlobal.cjs +0 -1
- package/lib/node_modules/lodash-es/_getAllKeys.cjs +0 -1
- package/lib/node_modules/lodash-es/_getMapData.cjs +0 -1
- package/lib/node_modules/lodash-es/_getMatchData.cjs +0 -1
- package/lib/node_modules/lodash-es/_getNative.cjs +0 -1
- package/lib/node_modules/lodash-es/_getRawTag.cjs +0 -1
- package/lib/node_modules/lodash-es/_getSymbols.cjs +0 -1
- package/lib/node_modules/lodash-es/_getTag.cjs +0 -1
- package/lib/node_modules/lodash-es/_getValue.cjs +0 -1
- package/lib/node_modules/lodash-es/_getValue.mjs +0 -9
- package/lib/node_modules/lodash-es/_hasPath.cjs +0 -1
- package/lib/node_modules/lodash-es/_hasUnicode.cjs +0 -1
- package/lib/node_modules/lodash-es/_hashClear.cjs +0 -1
- package/lib/node_modules/lodash-es/_hashDelete.cjs +0 -1
- package/lib/node_modules/lodash-es/_hashGet.cjs +0 -1
- package/lib/node_modules/lodash-es/_hashHas.cjs +0 -1
- package/lib/node_modules/lodash-es/_hashSet.cjs +0 -1
- package/lib/node_modules/lodash-es/_isFlattenable.cjs +0 -1
- package/lib/node_modules/lodash-es/_isIndex.cjs +0 -1
- package/lib/node_modules/lodash-es/_isKey.cjs +0 -1
- package/lib/node_modules/lodash-es/_isKeyable.cjs +0 -1
- package/lib/node_modules/lodash-es/_isMasked.cjs +0 -1
- package/lib/node_modules/lodash-es/_isPrototype.cjs +0 -1
- package/lib/node_modules/lodash-es/_isStrictComparable.cjs +0 -1
- package/lib/node_modules/lodash-es/_listCacheClear.cjs +0 -1
- package/lib/node_modules/lodash-es/_listCacheClear.mjs +0 -9
- package/lib/node_modules/lodash-es/_listCacheDelete.cjs +0 -1
- package/lib/node_modules/lodash-es/_listCacheGet.cjs +0 -1
- package/lib/node_modules/lodash-es/_listCacheHas.cjs +0 -1
- package/lib/node_modules/lodash-es/_listCacheSet.cjs +0 -1
- package/lib/node_modules/lodash-es/_mapCacheClear.cjs +0 -1
- package/lib/node_modules/lodash-es/_mapCacheDelete.cjs +0 -1
- package/lib/node_modules/lodash-es/_mapCacheGet.cjs +0 -1
- package/lib/node_modules/lodash-es/_mapCacheHas.cjs +0 -1
- package/lib/node_modules/lodash-es/_mapCacheSet.cjs +0 -1
- package/lib/node_modules/lodash-es/_mapToArray.cjs +0 -1
- package/lib/node_modules/lodash-es/_matchesStrictComparable.cjs +0 -1
- package/lib/node_modules/lodash-es/_memoizeCapped.cjs +0 -1
- package/lib/node_modules/lodash-es/_nativeCreate.cjs +0 -1
- package/lib/node_modules/lodash-es/_nativeKeys.cjs +0 -1
- package/lib/node_modules/lodash-es/_nodeUtil.cjs +0 -1
- package/lib/node_modules/lodash-es/_objectToString.cjs +0 -1
- package/lib/node_modules/lodash-es/_objectToString.mjs +0 -11
- package/lib/node_modules/lodash-es/_overArg.cjs +0 -1
- package/lib/node_modules/lodash-es/_overArg.mjs +0 -11
- package/lib/node_modules/lodash-es/_root.cjs +0 -1
- package/lib/node_modules/lodash-es/_setCacheAdd.cjs +0 -1
- package/lib/node_modules/lodash-es/_setCacheHas.cjs +0 -1
- package/lib/node_modules/lodash-es/_setCacheHas.mjs +0 -9
- package/lib/node_modules/lodash-es/_setToArray.cjs +0 -1
- package/lib/node_modules/lodash-es/_stackClear.cjs +0 -1
- package/lib/node_modules/lodash-es/_stackDelete.cjs +0 -1
- package/lib/node_modules/lodash-es/_stackGet.cjs +0 -1
- package/lib/node_modules/lodash-es/_stackGet.mjs +0 -9
- package/lib/node_modules/lodash-es/_stackHas.cjs +0 -1
- package/lib/node_modules/lodash-es/_stackHas.mjs +0 -9
- package/lib/node_modules/lodash-es/_stackSet.cjs +0 -1
- package/lib/node_modules/lodash-es/_stringToArray.cjs +0 -1
- package/lib/node_modules/lodash-es/_stringToPath.cjs +0 -1
- package/lib/node_modules/lodash-es/_toKey.cjs +0 -1
- package/lib/node_modules/lodash-es/_toSource.cjs +0 -1
- package/lib/node_modules/lodash-es/_trimmedEndIndex.cjs +0 -1
- package/lib/node_modules/lodash-es/_unicodeToArray.cjs +0 -1
- package/lib/node_modules/lodash-es/capitalize.cjs +0 -1
- package/lib/node_modules/lodash-es/concat.cjs +0 -1
- package/lib/node_modules/lodash-es/eq.cjs +0 -1
- package/lib/node_modules/lodash-es/eq.mjs +0 -9
- package/lib/node_modules/lodash-es/first.cjs +0 -1
- package/lib/node_modules/lodash-es/first.mjs +0 -9
- package/lib/node_modules/lodash-es/flatten.cjs +0 -1
- package/lib/node_modules/lodash-es/flattenDeep.cjs +0 -1
- package/lib/node_modules/lodash-es/flattenDepth.cjs +0 -1
- package/lib/node_modules/lodash-es/forEach.cjs +0 -1
- package/lib/node_modules/lodash-es/get.cjs +0 -1
- package/lib/node_modules/lodash-es/groupBy.cjs +0 -1
- package/lib/node_modules/lodash-es/hasIn.cjs +0 -1
- package/lib/node_modules/lodash-es/head.cjs +0 -1
- package/lib/node_modules/lodash-es/head.mjs +0 -9
- package/lib/node_modules/lodash-es/identity.cjs +0 -1
- package/lib/node_modules/lodash-es/identity.mjs +0 -9
- package/lib/node_modules/lodash-es/isArguments.cjs +0 -1
- package/lib/node_modules/lodash-es/isArray.cjs +0 -1
- package/lib/node_modules/lodash-es/isArray.mjs +0 -8
- package/lib/node_modules/lodash-es/isArrayLike.cjs +0 -1
- package/lib/node_modules/lodash-es/isBuffer.cjs +0 -1
- package/lib/node_modules/lodash-es/isEmpty.cjs +0 -1
- package/lib/node_modules/lodash-es/isFunction.cjs +0 -1
- package/lib/node_modules/lodash-es/isLength.cjs +0 -1
- package/lib/node_modules/lodash-es/isNil.cjs +0 -1
- package/lib/node_modules/lodash-es/isNil.mjs +0 -9
- package/lib/node_modules/lodash-es/isObject.cjs +0 -1
- package/lib/node_modules/lodash-es/isObjectLike.cjs +0 -1
- package/lib/node_modules/lodash-es/isObjectLike.mjs +0 -9
- package/lib/node_modules/lodash-es/isSymbol.cjs +0 -1
- package/lib/node_modules/lodash-es/isTypedArray.cjs +0 -1
- package/lib/node_modules/lodash-es/keys.cjs +0 -1
- package/lib/node_modules/lodash-es/last.cjs +0 -1
- package/lib/node_modules/lodash-es/lodash.cjs +0 -1
- package/lib/node_modules/lodash-es/memoize.cjs +0 -1
- package/lib/node_modules/lodash-es/nth.cjs +0 -1
- package/lib/node_modules/lodash-es/property.cjs +0 -1
- package/lib/node_modules/lodash-es/reduce.cjs +0 -1
- package/lib/node_modules/lodash-es/stubArray.cjs +0 -1
- package/lib/node_modules/lodash-es/stubArray.mjs +0 -9
- package/lib/node_modules/lodash-es/stubFalse.cjs +0 -1
- package/lib/node_modules/lodash-es/stubFalse.mjs +0 -9
- package/lib/node_modules/lodash-es/toFinite.cjs +0 -1
- package/lib/node_modules/lodash-es/toInteger.cjs +0 -1
- package/lib/node_modules/lodash-es/toNumber.cjs +0 -1
- package/lib/node_modules/lodash-es/toString.cjs +0 -1
- package/lib/node_modules/lodash-es/upperFirst.cjs +0 -1
- package/lib/node_modules/pluralize/pluralize.cjs +0 -1
- package/lib/packages/dbml-core/node_modules/lodash/lodash.cjs +0 -20
- package/lib/packages/dbml-core/package.json.cjs +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/groupBy.cjs"),t=require("../node_modules/lodash-es/isEmpty.cjs"),n=require("../node_modules/lodash-es/reduce.cjs"),r=require("../node_modules/lodash-es/lodash.cjs");require("../model_structure/config.cjs");const i=require("./utils.cjs");let a=require("@dbml/parse");r.init_lodash();var o=class r{static hasWhiteSpace(e){return/\s/g.test(e)}static hasSquareBracket(e){return/\[|\]/.test(e)}static isExpression(e){return/\s*(\*|\+|-|\([A-Za-z0-9_]+\)|\(\))/g.test(e)}static escapeNote(e){if(e===null)return``;let t=e.replaceAll(`\\`,`\\\\`);return t.match(/[\n\r']/)?(t=t.replaceAll(`'`,`\\'`),t=t.replaceAll(`\r
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/groupBy.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.cjs"),n=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/reduce.cjs"),r=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.cjs");require("../model_structure/config.cjs");const i=require("./utils.cjs");let a=require("@dbml/parse");r.init_lodash();var o=class r{static hasWhiteSpace(e){return/\s/g.test(e)}static hasSquareBracket(e){return/\[|\]/.test(e)}static isExpression(e){return/\s*(\*|\+|-|\([A-Za-z0-9_]+\)|\(\))/g.test(e)}static escapeNote(e){if(e===null)return``;let t=e.replaceAll(`\\`,`\\\\`);return t.match(/[\n\r']/)?(t=t.replaceAll(`'`,`\\'`),t=t.replaceAll(`\r
|
|
2
2
|
`,`
|
|
3
3
|
`),`'''${t}'''`):`'${t}'`}static exportEnums(e,t){let n=e.map(e=>{let n=t.enums[e],a=t.schemas[n.schemaId];return`Enum ${i.shouldPrintSchema(a,t)?`"${a.name}".`:``}"${n.name}" {\n${n.valueIds.map(e=>` "${t.enumValues[e].name}"${t.enumValues[e].note?` [note: ${r.escapeNote(t.enumValues[e].note)}]`:``}`).join(`
|
|
4
4
|
`)}\n}\n`});return n.length?n.join(`
|
|
5
5
|
`):``}static getFieldLines(e,t){return t.tables[e].fieldIds.map(e=>{let n=t.fields[e],i=``;n.type.schemaName&&n.type.schemaName!==`public`&&(i=r.hasWhiteSpace(n.type.schemaName)?`"${n.type.schemaName}".`:`${n.type.schemaName}.`);let a=`"${n.name}" ${i}${r.hasWhiteSpace(n.type.type_name)||r.hasSquareBracket(n.type.type_name)?`"${n.type.type_name}"`:n.type.type_name}`,o=[];if(n.unique&&o.push(`unique`),n.pk&&o.push(`pk`),n.not_null&&o.push(`not null`),n.increment&&o.push(`increment`),n.checkIds&&o.push(...n.checkIds.map(e=>`check: \`${t.checks[e].expression}\``)),n.dbdefault&&!(n.dbdefault.type===`boolean`&&(n.dbdefault.value===null||typeof n.dbdefault.value==`string`&&n.dbdefault.value.toLowerCase()===`null`))){let e=`default: `;switch(n.dbdefault.type){case`boolean`:case`number`:e+=`${n.dbdefault.value}`;break;case`string`:{let t=String(n.dbdefault.value),r=t.includes(`
|
|
6
6
|
`)?`'''`:`'`;e+=`${r}${t}${r}`;break}case`expression`:e+=`\`${n.dbdefault.value}\``;break;default:e+=`\`${n.dbdefault.value}\``;break}o.push(e)}return n.note&&o.push(`note: ${r.escapeNote(n.note)}`),o.length>0&&(a+=` [${o.join(`, `)}]`),a})}static getIndexLines(e,t){return t.tables[e].indexIds.map(e=>{let n=``,r=t.indexes[e];if(r.columnIds.length>1)n=`(${r.columnIds.map(e=>{let n=t.indexColumns[e];return n.type===`expression`?`\`${n.value}\``:n.value}).join(`, `)})`;else if(r.columnIds.length===1){let e=t.indexColumns[r.columnIds[0]];n=e.type===`expression`?`\`${e.value}\``:e.value}let i=[];return r.pk&&i.push(`pk`),r.type&&i.push(`type: ${r.type.toLowerCase()}`),r.unique&&i.push(`unique`),r.name&&i.push(`name: "${r.name}"`),i.length>1?n+=` [${i.join(`, `)}]`:i.length===1&&(n+=` [${i[0]}]`),n})}static getCheckLines(e,t){return t.tables[e].checkIds.map(e=>{let n=``,{expression:r,name:i}=t.checks[e];return n+=`\`${r}\``,i&&(n+=` [name: '${i}']`),n})}static getTableContentArr(e,t){return e.map(e=>({tableId:e,fieldContents:r.getFieldLines(e,t),checkContents:r.getCheckLines(e,t),indexContents:r.getIndexLines(e,t)}))}static getTableSettings(e){let t=``;return e.headerColor&&(t+=`headerColor: ${e.headerColor}, `),t.endsWith(`, `)&&(t=t.replace(/,\s$/,``)),t?` [${t}]`:``}static exportTables(e,n){let o=r.getTableContentArr(e,n).map(e=>{let o=n.tables[e.tableId],s=n.schemas[o.schemaId],c=r.getTableSettings(o),l=`"${o.name}"`;i.shouldPrintSchema(s,n)&&(l=`"${s.name}"."${o.name}"`);let u=o.alias?` as ${(0,a.addDoubleQuoteIfNeeded)(o.alias)}`:``,d=e.fieldContents.map(e=>` ${e}\n`).join(``),f=``;t.default(e.checkContents)||(f=`\n Checks {\n${e.checkContents.map(e=>` ${e}\n`).join(``)} }\n`);let p=``;t.default(e.indexContents)||(p=`\n Indexes {\n${e.indexContents.map(e=>` ${e}\n`).join(``)} }\n`);let m=o.note?` Note: ${r.escapeNote(o.note)}\n`:``;return`Table ${l}${u}${c} {\n${d}${f}${p}${m}}\n`});return o.length?o.join(`
|
|
7
|
-
`):``}static buildFieldName(e,t){let n=e.map(e=>`"${t.fields[e].name}"`).join(`, `);return e.length===1?n:`(${n})`}static exportRefs(e,t){let n=e.map(e=>{let n=t.refs[e],o=n.endpointIds.findIndex(e=>(0,a.parseCardinality)(t.endpoints[e].relation).max===1),s=o===-1?0:o,c=t.endpoints[n.endpointIds[s]],l=t.endpoints[n.endpointIds[1-s]],u=(0,a.getRelationshipOp)(c.relation,l.relation),d=t.fields[c.fieldIds[0]],f=t.tables[d.tableId],p=t.schemas[f.schemaId],m=r.buildFieldName(c.fieldIds,t),h=`Ref`;n.name&&(h+=` ${i.shouldPrintSchema(t.schemas[n.schemaId],t)?`"${t.schemas[n.schemaId].name}".`:``}"${n.name}"`),h+=`:`,h+=`${i.shouldPrintSchema(p,t)?`"${p.name}".`:``}"${f.name}".${m} `;let g=t.fields[l.fieldIds[0]],_=t.tables[g.tableId],v=t.schemas[_.schemaId],y=r.buildFieldName(l.fieldIds,t);h+=`${u} `,h+=`${i.shouldPrintSchema(v,t)?`"${v.name}".`:``}"${_.name}".${y}`;let b=[];return n.onUpdate&&b.push(`update: ${n.onUpdate.toLowerCase()}`),n.onDelete&&b.push(`delete: ${n.onDelete.toLowerCase()}`),n.inactive&&b.push(`inactive`),b.length>0&&(h+=` [${b.join(`, `)}]`),h+=`
|
|
7
|
+
`):``}static buildFieldName(e,t){let n=e.map(e=>`"${t.fields[e].name}"`).join(`, `);return e.length===1?n:`(${n})`}static exportRefs(e,t){let n=e.map(e=>{let n=t.refs[e],o=n.endpointIds.findIndex(e=>(0,a.parseCardinality)(t.endpoints[e].relation).max===1),s=o===-1?0:o,c=t.endpoints[n.endpointIds[s]],l=t.endpoints[n.endpointIds[1-s]],u=(0,a.getRelationshipOp)(c.relation,l.relation),d=t.fields[c.fieldIds[0]],f=t.tables[d.tableId],p=t.schemas[f.schemaId],m=r.buildFieldName(c.fieldIds,t),h=`Ref`;n.name&&(h+=` ${i.shouldPrintSchema(t.schemas[n.schemaId],t)?`"${t.schemas[n.schemaId].name}".`:``}"${n.name}"`),h+=`:`,h+=`${i.shouldPrintSchema(p,t)?`"${p.name}".`:``}"${f.name}".${m} `;let g=t.fields[l.fieldIds[0]],_=t.tables[g.tableId],v=t.schemas[_.schemaId],y=r.buildFieldName(l.fieldIds,t);h+=`${u} `,h+=`${i.shouldPrintSchema(v,t)?`"${v.name}".`:``}"${_.name}".${y}`;let b=[];return n.onUpdate&&b.push(`update: ${n.onUpdate.toLowerCase()}`),n.onDelete&&b.push(`delete: ${n.onDelete.toLowerCase()}`),n.color&&b.push(`color: ${n.color}`),n.inactive&&b.push(`inactive`),Object.entries(n.metadata??{}).forEach(([e,t])=>{b.push(`${e}: ${r.formatDepCustomValue(t)}`)}),b.length>0&&(h+=` [${b.join(`, `)}]`),h+=`
|
|
8
8
|
`,h});return n.length?n.join(`
|
|
9
9
|
`):``}static getTableGroupSettings(e){let t=[];return e.color&&t.push(`color: ${e.color}`),t.length?` [${t.join(`, `)}]`:``}static formatDepEndpoint(e){let t=e.schemaName?`"${e.schemaName}".`:``,n=`"${e.tableName}"`;return!e.fieldNames||e.fieldNames.length===0?`${t}${n}`:`${t}${n}.${e.fieldNames.length===1?`"${e.fieldNames[0]}"`:`(${e.fieldNames.map(e=>`"${e}"`).join(`, `)})`}`}static formatDepCustomValue(e){return typeof e==`string`?`'${(0,a.escapeString)(e)}'`:e==null?`null`:String(e)}static exportDeps(e,t){let n=e.map(e=>{let n=t.deps[e],i=n.edgeIds.map(e=>t.depEdges[e]),a=!!n.note,o=n.metadata?Object.entries(n.metadata):[],s=a||o.length>0;if(i.length===1&&!s)return`Dep: ${r.formatDepEndpoint(i[0].upstream)} -> ${r.formatDepEndpoint(i[0].downstream)}\n`;let c=`Dep {
|
|
10
10
|
`;return i.forEach(e=>{c+=` ${r.formatDepEndpoint(e.upstream)} -> ${r.formatDepEndpoint(e.downstream)}\n`}),s&&(c+=`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/groupBy.mjs";
|
|
2
|
-
import t from "../node_modules/lodash-es/isEmpty.mjs";
|
|
3
|
-
import n from "../node_modules/lodash-es/reduce.mjs";
|
|
4
|
-
import { init_lodash as r } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/groupBy.mjs";
|
|
2
|
+
import t from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.mjs";
|
|
3
|
+
import n from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/reduce.mjs";
|
|
4
|
+
import { init_lodash as r } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
5
5
|
import "../model_structure/config.mjs";
|
|
6
6
|
import { shouldPrintSchema as i } from "./utils.mjs";
|
|
7
7
|
import { addDoubleQuoteIfNeeded as a, escapeString as o, formatRecordValue as s, getRelationshipOp as c, normalizeQualifiedName as l, parseCardinality as u } from "@dbml/parse";
|
|
@@ -115,7 +115,9 @@ var d = class r {
|
|
|
115
115
|
let _ = t.fields[l.fieldIds[0]], v = t.tables[_.tableId], y = t.schemas[v.schemaId], b = r.buildFieldName(l.fieldIds, t);
|
|
116
116
|
g += `${d} `, g += `${i(y, t) ? `"${y.name}".` : ""}"${v.name}".${b}`;
|
|
117
117
|
let x = [];
|
|
118
|
-
return n.onUpdate && x.push(`update: ${n.onUpdate.toLowerCase()}`), n.onDelete && x.push(`delete: ${n.onDelete.toLowerCase()}`), n.inactive && x.push("inactive"),
|
|
118
|
+
return n.onUpdate && x.push(`update: ${n.onUpdate.toLowerCase()}`), n.onDelete && x.push(`delete: ${n.onDelete.toLowerCase()}`), n.color && x.push(`color: ${n.color}`), n.inactive && x.push("inactive"), Object.entries(n.metadata ?? {}).forEach(([e, t]) => {
|
|
119
|
+
x.push(`${e}: ${r.formatDepCustomValue(t)}`);
|
|
120
|
+
}), x.length > 0 && (g += ` [${x.join(", ")}]`), g += "\n", g;
|
|
119
121
|
});
|
|
120
122
|
return n.length ? n.join("\n") : "";
|
|
121
123
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/flatten.cjs"),t=require("../node_modules/lodash-es/concat.cjs"),n=require("../node_modules/lodash-es/isEmpty.cjs"),r=require("../node_modules/lodash-es/lodash.cjs"),i=require("./utils.cjs");let a=require("@dbml/parse");r.init_lodash();var o=class r{static exportRecords(e){let t=Object.values(e.records||{}).filter(e=>!e.example);return n.default(t)?[]:t.map(e=>{let{schemaName:t,tableName:n,columns:r,values:i}=e,o=t?`\`${t}\`.\`${n}\``:`\`${n}\``,s=r.length>0?`(\`${r.join("`, `")}\`)`:``,c=e=>e.value===null?`NULL`:e.type===`expression`||(0,a.isNumericType)(e.type)?e.value:(0,a.isBooleanType)(e.type)?String(e.value).toUpperCase()===`TRUE`?`TRUE`:`FALSE`:(0,a.isStringType)(e.type)||(0,a.isBinaryType)(e.type)||(0,a.isDateTimeType)(e.type)?`'${e.value.replace(/'/g,`''`).replace(/\\/g,`\\\\`)}'`:`CAST('${e.value.replace(/'/g,`''`).replace(/\\/g,`\\\\`)}' AS ${e.type})`;return`INSERT INTO ${o} ${s}\nVALUES\n ${i.map(e=>`(${e.map(c).join(`, `)})`).join(`,
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/concat.cjs"),n=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.cjs"),r=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.cjs"),i=require("./utils.cjs");let a=require("@dbml/parse");r.init_lodash();var o=class r{static exportRecords(e){let t=Object.values(e.records||{}).filter(e=>!e.example);return n.default(t)?[]:t.map(e=>{let{schemaName:t,tableName:n,columns:r,values:i}=e,o=t?`\`${t}\`.\`${n}\``:`\`${n}\``,s=r.length>0?`(\`${r.join("`, `")}\`)`:``,c=e=>e.value===null?`NULL`:e.type===`expression`||(0,a.isNumericType)(e.type)?e.value:(0,a.isBooleanType)(e.type)?String(e.value).toUpperCase()===`TRUE`?`TRUE`:`FALSE`:(0,a.isStringType)(e.type)||(0,a.isBinaryType)(e.type)||(0,a.isDateTimeType)(e.type)?`'${e.value.replace(/'/g,`''`).replace(/\\/g,`\\\\`)}'`:`CAST('${e.value.replace(/'/g,`''`).replace(/\\/g,`\\\\`)}' AS ${e.type})`;return`INSERT INTO ${o} ${s}\nVALUES\n ${i.map(e=>`(${e.map(c).join(`, `)})`).join(`,
|
|
2
2
|
`)};`})}static getFieldLines(e,t){return t.tables[e].fieldIds.map(e=>{let n=t.fields[e],r=``;if(n.enumId){let e=t.enums[n.enumId];r=`\`${n.name}\` ENUM (`;let i=e.valueIds.map(e=>`'${t.enumValues[e].name}'`);r+=`${i.join(`, `)})`}else r=`\`${n.name}\` ${n.type.type_name===`varchar`?`varchar(255)`:n.type.type_name}`;if(n.unique&&(r+=` UNIQUE`),n.pk&&(r+=` PRIMARY KEY`),n.not_null&&(r+=` NOT NULL`),n.increment&&(r+=` AUTO_INCREMENT`),n.checkIds&&n.checkIds.length>0)if(n.checkIds.length===1){let e=t.checks[n.checkIds[0]];e.name&&(r+=` CONSTRAINT \`${e.name}\``),r+=` CHECK (${e.expression})`}else{let e=n.checkIds.map(e=>`(${t.checks[e].expression})`);r+=` CHECK (${e.join(` AND `)})`}return n.dbdefault&&(n.dbdefault.type===`boolean`&&(n.dbdefault.value===null||typeof n.dbdefault.value==`string`&&n.dbdefault.value.toLowerCase()===`null`)||(n.dbdefault.type===`expression`?r+=` DEFAULT (${n.dbdefault.value})`:n.dbdefault.type===`string`?r+=` DEFAULT '${n.dbdefault.value}'`:r+=` DEFAULT ${n.dbdefault.value}`)),n.note&&(r+=` COMMENT '${n.note.replace(/'/g,`''`)}'`),r})}static getCompositePKs(e,t){let n=t.tables[e];return(n.indexIds?n.indexIds.filter(e=>t.indexes[e].pk):[]).map(e=>{let n=t.indexes[e],r=`PRIMARY KEY`,i=[];return n.columnIds.forEach(e=>{let n=t.indexColumns[e],r=``;r=n.type===`expression`?`(${n.value})`:`\`${n.value}\``,i.push(r)}),r+=` (${i.join(`, `)})`,r})}static getCheckLines(e,t){let n=t.tables[e];return!n.checkIds||n.checkIds.length===0?[]:n.checkIds.map(e=>{let n=t.checks[e],r=``;return n.name&&(r=`CONSTRAINT \`${n.name}\` `),r+=`CHECK (${n.expression})`,r})}static getTableContentArr(e,t){return e.map(e=>({tableId:e,fieldContents:r.getFieldLines(e,t),checkContents:r.getCheckLines(e,t),compositePKs:r.getCompositePKs(e,t)}))}static exportTables(e,t){return r.getTableContentArr(e,t).map(e=>{let n=[...e.fieldContents,...e.checkContents,...e.compositePKs],r=t.tables[e.tableId],a=t.schemas[r.schemaId];return`CREATE TABLE ${i.shouldPrintSchema(a,t)?`\`${a.name}\`.`:``}\`${r.name}\` (\n${n.map(e=>` ${e}`).join(`,
|
|
3
3
|
`)}\n);\n`})}static buildFieldName(e,t){return`(${e.map(e=>`\`${t.fields[e].name}\``).join(`, `)})`}static buildTableManyToMany(e,t,n,r,a){let o=`CREATE TABLE ${i.shouldPrintSchema(r,a)?`\`${r.name}\`.`:``}\`${n}\` (\n`,s=[...e.keys()].join("`, `"),c=[...t.keys()].join("`, `");return e.forEach((e,t)=>{o+=` \`${t}\` ${e},\n`}),t.forEach((e,t)=>{o+=` \`${t}\` ${e},\n`}),o+=` PRIMARY KEY (\`${s}\`, \`${c}\`)\n`,o+=`);
|
|
4
4
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/flatten.mjs";
|
|
2
|
-
import t from "../node_modules/lodash-es/concat.mjs";
|
|
3
|
-
import n from "../node_modules/lodash-es/isEmpty.mjs";
|
|
4
|
-
import { init_lodash as r } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.mjs";
|
|
2
|
+
import t from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/concat.mjs";
|
|
3
|
+
import n from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.mjs";
|
|
4
|
+
import { init_lodash as r } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
5
5
|
import { buildJunctionFields1 as i, buildJunctionFields2 as a, buildNewTableName as o, shouldPrintSchema as s } from "./utils.mjs";
|
|
6
6
|
import { isBinaryType as c, isBooleanType as l, isDateTimeType as u, isNumericType as d, isStringType as f, parseCardinality as p } from "@dbml/parse";
|
|
7
7
|
//#region src/export/MysqlExporter.js
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/flatten.cjs"),t=require("../node_modules/lodash-es/concat.cjs"),n=require("../node_modules/lodash-es/forEach.cjs"),r=require("../node_modules/lodash-es/isEmpty.cjs"),i=require("../node_modules/lodash-es/lodash.cjs"),a=require("./utils.cjs");let o=require("@dbml/parse");i.init_lodash();var s=class{static exportRecords(e){let t=Object.values(e.records||{}).filter(e=>!e.example);return r.default(t)?[]:t.map(e=>{let{schemaName:t,tableName:n,columns:r,values:i}=e,s=t?`"${t}"."${n}"`:`"${n}"`,c=r.length>0?`("${r.join(`", "`)}")`:``,l=e=>{if(e.value===null)return`NULL`;if(e.type===`expression`||(0,o.isNumericType)(e.type))return e.value;if((0,o.isBooleanType)(e.type))return String(e.value).toUpperCase()===`TRUE`?`1`:`0`;if((0,o.isDateTimeType)(e.type)){let t=a.parseIsoDatetime(e.value);if(t){let{datetime:e,hasTimezone:n}=t,r=a.formatDatetimeForOracle(e,n);return n?`TO_TIMESTAMP_TZ('${r}', 'YYYY-MM-DD HH24:MI:SS.FF3 TZH:TZM')`:`TO_TIMESTAMP('${r}', 'YYYY-MM-DD HH24:MI:SS.FF3')`}return`'${e.value.replace(/'/g,`''`)}'`}return(0,o.isStringType)(e.type)?`'${e.value.replace(/'/g,`''`)}'`:(0,o.isBinaryType)(e.type)?`HEXTORAW('${e.value}')`:`CAST('${e.value.replace(/'/g,`''`)}' AS ${e.type})`};return i.length>1?`INSERT ALL\n${i.map(e=>` INTO ${s} ${c} VALUES (${e.map(l).join(`, `)})`).join(`
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/concat.cjs"),n=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/forEach.cjs"),r=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.cjs"),i=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.cjs"),a=require("./utils.cjs");let o=require("@dbml/parse");i.init_lodash();var s=class{static exportRecords(e){let t=Object.values(e.records||{}).filter(e=>!e.example);return r.default(t)?[]:t.map(e=>{let{schemaName:t,tableName:n,columns:r,values:i}=e,s=t?`"${t}"."${n}"`:`"${n}"`,c=r.length>0?`("${r.join(`", "`)}")`:``,l=e=>{if(e.value===null)return`NULL`;if(e.type===`expression`||(0,o.isNumericType)(e.type))return e.value;if((0,o.isBooleanType)(e.type))return String(e.value).toUpperCase()===`TRUE`?`1`:`0`;if((0,o.isDateTimeType)(e.type)){let t=a.parseIsoDatetime(e.value);if(t){let{datetime:e,hasTimezone:n}=t,r=a.formatDatetimeForOracle(e,n);return n?`TO_TIMESTAMP_TZ('${r}', 'YYYY-MM-DD HH24:MI:SS.FF3 TZH:TZM')`:`TO_TIMESTAMP('${r}', 'YYYY-MM-DD HH24:MI:SS.FF3')`}return`'${e.value.replace(/'/g,`''`)}'`}return(0,o.isStringType)(e.type)?`'${e.value.replace(/'/g,`''`)}'`:(0,o.isBinaryType)(e.type)?`HEXTORAW('${e.value}')`:`CAST('${e.value.replace(/'/g,`''`)}' AS ${e.type})`};return i.length>1?`INSERT ALL\n${i.map(e=>` INTO ${s} ${c} VALUES (${e.map(l).join(`, `)})`).join(`
|
|
2
2
|
`)}\nSELECT * FROM dual;`:`INSERT INTO ${s} ${c}\nVALUES (${i[0].map(l).join(`, `)});`})}static buildSchemaToTableNameSetMap(e){let t=new Map;return n.default(e.tables,n=>{let r=e.schemas[n.schemaId],i=t.get(r.name);if(!i){t.set(r.name,new Set([n.name]));return}i.add(n.name)}),t}static buildTableNameWithSchema(e,t,n){return`${a.shouldPrintSchema(t,e)?`${a.escapeObjectName(t.name,`oracle`)}.`:``}${a.escapeObjectName(n.name,`oracle`)}`}static exportSchema(e){return`CREATE USER ${a.escapeObjectName(e,`oracle`)}\nNO AUTHENTICATION
|
|
3
3
|
DEFAULT TABLESPACE system
|
|
4
4
|
TEMPORARY TABLESPACE temp
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/flatten.mjs";
|
|
2
|
-
import t from "../node_modules/lodash-es/concat.mjs";
|
|
3
|
-
import n from "../node_modules/lodash-es/forEach.mjs";
|
|
4
|
-
import r from "../node_modules/lodash-es/isEmpty.mjs";
|
|
5
|
-
import { init_lodash as i } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.mjs";
|
|
2
|
+
import t from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/concat.mjs";
|
|
3
|
+
import n from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/forEach.mjs";
|
|
4
|
+
import r from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.mjs";
|
|
5
|
+
import { init_lodash as i } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
6
6
|
import { buildJunctionFields1 as a, buildJunctionFields2 as o, buildUniqueTableName as s, escapeObjectName as c, formatDatetimeForOracle as l, parseIsoDatetime as u, shouldPrintSchema as d } from "./utils.mjs";
|
|
7
7
|
import { isBinaryType as f, isBooleanType as p, isDateTimeType as m, isNumericType as h, isStringType as g, parseCardinality as _ } from "@dbml/parse";
|
|
8
8
|
//#region src/export/OracleExporter.js
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/flatten.cjs"),t=require("../node_modules/lodash-es/concat.cjs"),n=require("../node_modules/lodash-es/isEmpty.cjs"),r=require("../node_modules/lodash-es/lodash.cjs"),i=require("./utils.cjs"),a=require("../model_structure/utils.cjs");let o=require("@dbml/parse");r.init_lodash();var s=`SMALLINT.INTEGER.INT.BIGINT.DECIMAL.NUMERIC.REAL.DOUBLE PRECISION.SMALLSERIAL.SERIAL.BIGSERIAL.FLOAT.MONEY.CHARACTER.CHAR.CHARACTER VARYING.VARCHAR.TEXT.NAME.BPCHAR.BYTEA.TIMESTAMP.TIMESTAMP WITH TIME ZONE.TIMESTAMP WITHOUT TIME ZONE.DATE.TIME.TIME WITH TIME ZONE.TIME WITHOUT TIME ZONE.INTERVAL.BOOLEAN.BOOL.POINT.LINE.LSEG.BOX.PATH.POLYGON.CIRCLE.CIDR.INET.MACADDR.MACADDR8.BIT.BIT VARYING.VARBIT.UUID.XML.JSON.JSONB.INT4RANGE.INT8RANGE.NUMRANGE.TSRANGE.TSTZRANGE.DATERANGE.OID.REGCLASS.REGCOLLATION.REGCONFIG.REGDICTIONARY.REGNAMESPACE.REGOPER.REGOPERATOR.REGPROC.REGPROCEDURE.REGROLE.REGTYPE.PG_LSN.VOID.RECORD.TRIGGER.EVENT_TRIGGER.PG_DDL_COMMAND.UNKNOWN.ANYELEMENT.ANYARRAY.ANYNONARRAY.ANYENUM.ANYRANGE.ANY.CSTRING.INTERNAL.LANGUAGE_HANDLER.FDW_HANDLER.INDEX_AM_HANDLER.TSM_HANDLER.OPAQUE`.split(`.`),c=[`USER`],l=class r{static exportRecords(e){let t=Object.values(e.records||{}).filter(e=>!e.example);return n.default(t)?[]:t.map(e=>{let{schemaName:t,tableName:n,columns:r,values:i}=e;if(!i||i.length===0)return null;let a=t?`"${t}"."${n}"`:`"${n}"`,s=r.length>0?`(${r.map(e=>`"${e}"`).join(`, `)})`:``,c=e=>e.value===null?`NULL`:e.type===`expression`||(0,o.isNumericType)(e.type)?e.value:(0,o.isBooleanType)(e.type)?String(e.value).toUpperCase()===`TRUE`?`TRUE`:`FALSE`:(0,o.isStringType)(e.type)||(0,o.isDateTimeType)(e.type)||(0,o.isBinaryType)(e.type)?`'${String(e.value).replace(/'/g,`''`)}'`:`CAST('${String(e.value).replace(/'/g,`''`)}' AS ${e.type})`;return`INSERT INTO ${a} ${s}\nVALUES\n ${i.map(e=>`(${e.map(c).join(`, `)})`).join(`,
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/concat.cjs"),n=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.cjs"),r=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.cjs"),i=require("./utils.cjs"),a=require("../model_structure/utils.cjs");let o=require("@dbml/parse");r.init_lodash();var s=`SMALLINT.INTEGER.INT.BIGINT.DECIMAL.NUMERIC.REAL.DOUBLE PRECISION.SMALLSERIAL.SERIAL.BIGSERIAL.FLOAT.MONEY.CHARACTER.CHAR.CHARACTER VARYING.VARCHAR.TEXT.NAME.BPCHAR.BYTEA.TIMESTAMP.TIMESTAMP WITH TIME ZONE.TIMESTAMP WITHOUT TIME ZONE.DATE.TIME.TIME WITH TIME ZONE.TIME WITHOUT TIME ZONE.INTERVAL.BOOLEAN.BOOL.POINT.LINE.LSEG.BOX.PATH.POLYGON.CIRCLE.CIDR.INET.MACADDR.MACADDR8.BIT.BIT VARYING.VARBIT.UUID.XML.JSON.JSONB.INT4RANGE.INT8RANGE.NUMRANGE.TSRANGE.TSTZRANGE.DATERANGE.OID.REGCLASS.REGCOLLATION.REGCONFIG.REGDICTIONARY.REGNAMESPACE.REGOPER.REGOPERATOR.REGPROC.REGPROCEDURE.REGROLE.REGTYPE.PG_LSN.VOID.RECORD.TRIGGER.EVENT_TRIGGER.PG_DDL_COMMAND.UNKNOWN.ANYELEMENT.ANYARRAY.ANYNONARRAY.ANYENUM.ANYRANGE.ANY.CSTRING.INTERNAL.LANGUAGE_HANDLER.FDW_HANDLER.INDEX_AM_HANDLER.TSM_HANDLER.OPAQUE`.split(`.`),c=[`USER`],l=class r{static exportRecords(e){let t=Object.values(e.records||{}).filter(e=>!e.example);return n.default(t)?[]:t.map(e=>{let{schemaName:t,tableName:n,columns:r,values:i}=e;if(!i||i.length===0)return null;let a=t?`"${t}"."${n}"`:`"${n}"`,s=r.length>0?`(${r.map(e=>`"${e}"`).join(`, `)})`:``,c=e=>e.value===null?`NULL`:e.type===`expression`||(0,o.isNumericType)(e.type)?e.value:(0,o.isBooleanType)(e.type)?String(e.value).toUpperCase()===`TRUE`?`TRUE`:`FALSE`:(0,o.isStringType)(e.type)||(0,o.isDateTimeType)(e.type)||(0,o.isBinaryType)(e.type)?`'${String(e.value).replace(/'/g,`''`)}'`:`CAST('${String(e.value).replace(/'/g,`''`)}' AS ${e.type})`;return`INSERT INTO ${a} ${s}\nVALUES\n ${i.map(e=>`(${e.map(c).join(`, `)})`).join(`,
|
|
2
2
|
`)};`}).filter(Boolean)}static exportEnums(e,t){return e.map(e=>{let n=t.enums[e],r=t.schemas[n.schemaId],a=`${i.shouldPrintSchema(r,t)?`"${r.name}".`:``}"${n.name}"`;return[a,`CREATE TYPE ${a} AS ENUM (\n${n.valueIds.map(e=>` '${t.enumValues[e].name}'`).join(`,
|
|
3
3
|
`)}\n);\n`]})}static getFieldLines(e,t,n){return t.tables[e].fieldIds.map(e=>{let r=t.fields[e],o=``;if(r.increment){let e=new Set([`BIGINT`,`INT`,`INTEGER`,`SMALLINT`]),t=new Set([`SMALLSERIAL`,`SERIAL`,`BIGSERIAL`]),n=r.type.type_name.toUpperCase(),i=``;i=e.has(n)?`${n} GENERATED BY DEFAULT AS IDENTITY`:t.has(n)?n:`SERIAL`,o=`"${r.name}" ${i}`}else if(!r.type.schemaName||!a.shouldPrintSchemaName(r.type.schemaName)){let e=r.type.type_name,t=e.toUpperCase(),n=!s.includes(t)&&(i.hasWhiteSpaceOrUpperCase(e)||c.includes(t))?`"${e}"`:e;o=`"${r.name}" ${n}`}else if(r.type.originalTypeName)o=`"${r.name}" "${r.type.schemaName}"."${r.type.originalTypeName}"`;else{let e=`${i.hasWhiteSpaceOrUpperCase(r.type.schemaName)?`"${r.type.schemaName}".`:`${r.type.schemaName}.`}${i.hasWhiteSpaceOrUpperCase(r.type.type_name)?`"${r.type.type_name}"`:r.type.type_name}`,t=`"${r.type.schemaName}"."${r.type.type_name}"`;!n.has(t)&&!i.hasWhiteSpace(t)&&(e=e.replaceAll(`"`,``)),o=`"${r.name}" ${e}`}if(r.unique&&(o+=` UNIQUE`),r.pk&&(o+=` PRIMARY KEY`),r.not_null&&(o+=` NOT NULL`),r.checkIds&&r.checkIds.length>0)if(r.checkIds.length===1){let e=t.checks[r.checkIds[0]];e.name&&(o+=` CONSTRAINT "${e.name}"`),o+=` CHECK (${e.expression})`}else{let e=r.checkIds.map(e=>`(${t.checks[e].expression})`);o+=` CHECK (${e.join(` AND `)})`}return r.dbdefault&&(r.dbdefault.type===`boolean`&&(r.dbdefault.value===null||typeof r.dbdefault.value==`string`&&r.dbdefault.value.toLowerCase()===`null`)||(r.dbdefault.type===`expression`?o+=` DEFAULT (${r.dbdefault.value})`:r.dbdefault.type===`string`?o+=` DEFAULT '${r.dbdefault.value}'`:o+=` DEFAULT ${r.dbdefault.value}`)),o})}static getCompositePKs(e,t){let n=t.tables[e];return(n.indexIds?n.indexIds.filter(e=>t.indexes[e].pk):[]).map(e=>{let n=t.indexes[e],r=`PRIMARY KEY`,i=[];return n.columnIds.forEach(e=>{let n=t.indexColumns[e],r=``;r=n.type===`expression`?`(${n.value})`:`"${n.value}"`,i.push(r)}),r+=` (${i.join(`, `)})`,r})}static getCheckLines(e,t){let n=t.tables[e];return!n.checkIds||n.checkIds.length===0?[]:n.checkIds.map(e=>{let n=t.checks[e],r=``;return n.name&&(r=`CONSTRAINT "${n.name}" `),r+=`CHECK (${n.expression})`,r})}static getTableContentArr(e,t,n){return e.map(e=>({tableId:e,fieldContents:r.getFieldLines(e,t,n),checkContents:r.getCheckLines(e,t),compositePKs:r.getCompositePKs(e,t)}))}static exportTables(e,t,n){return r.getTableContentArr(e,t,n).map(e=>{let n=[...e.fieldContents,...e.checkContents,...e.compositePKs],r=t.tables[e.tableId],a=t.schemas[r.schemaId];return`CREATE TABLE ${i.shouldPrintSchema(a,t)?`"${a.name}".`:``}"${r.name}" (\n${n.map(e=>` ${e}`).join(`,
|
|
4
4
|
`)}\n);\n`})}static buildFieldName(e,t){return`(${e.map(e=>`"${t.fields[e].name}"`).join(`, `)})`}static buildTableManyToMany(e,t,n,r,a){let o=`CREATE TABLE ${i.shouldPrintSchema(r,a)?`"${r.name}".`:``}"${n}" (\n`,s=[...e.keys()].join(`", "`),c=[...t.keys()].join(`", "`);return e.forEach((e,t)=>{o+=` "${t}" ${e},\n`}),t.forEach((e,t)=>{o+=` "${t}" ${e},\n`}),o+=` PRIMARY KEY ("${s}", "${c}")\n`,o+=`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/flatten.mjs";
|
|
2
|
-
import t from "../node_modules/lodash-es/concat.mjs";
|
|
3
|
-
import n from "../node_modules/lodash-es/isEmpty.mjs";
|
|
4
|
-
import { init_lodash as r } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.mjs";
|
|
2
|
+
import t from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/concat.mjs";
|
|
3
|
+
import n from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.mjs";
|
|
4
|
+
import { init_lodash as r } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
5
5
|
import { buildJunctionFields1 as i, buildJunctionFields2 as a, buildNewTableName as o, hasWhiteSpace as s, hasWhiteSpaceOrUpperCase as c, shouldPrintSchema as l } from "./utils.mjs";
|
|
6
6
|
import { shouldPrintSchemaName as u } from "../model_structure/utils.mjs";
|
|
7
7
|
import { isBinaryType as d, isBooleanType as f, isDateTimeType as p, isNumericType as m, isStringType as h, parseCardinality as g } from "@dbml/parse";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/flatten.cjs"),t=require("../node_modules/lodash-es/concat.cjs"),n=require("../node_modules/lodash-es/isEmpty.cjs"),r=require("../node_modules/lodash-es/lodash.cjs"),i=require("./utils.cjs");let a=require("@dbml/parse");r.init_lodash();var o=class r{static exportRecords(e){let t=Object.values(e.records||{}).filter(e=>!e.example);return n.default(t)?[]:t.map(e=>{let{schemaName:t,tableName:n,columns:r,values:i}=e,o=t?`[${t}].[${n}]`:`[${n}]`,s=r.length>0?`([${r.join(`], [`)}])`:``,c=e=>e.value===null?`NULL`:e.type===`expression`||(0,a.isNumericType)(e.type)?e.value:(0,a.isBooleanType)(e.type)?String(e.value).toUpperCase()===`TRUE`?`1`:`0`:(0,a.isStringType)(e.type)||(0,a.isDateTimeType)(e.type)?`'${e.value.replace(/'/g,`''`)}'`:(0,a.isBinaryType)(e.type)?`0x${e.value}`:`CAST('${e.value.replace(/'/g,`''`)}' AS ${e.type})`;return`INSERT INTO ${o} ${s}\nVALUES\n ${i.map(e=>`(${e.map(c).join(`, `)})`).join(`,
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/concat.cjs"),n=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.cjs"),r=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.cjs"),i=require("./utils.cjs");let a=require("@dbml/parse");r.init_lodash();var o=class r{static exportRecords(e){let t=Object.values(e.records||{}).filter(e=>!e.example);return n.default(t)?[]:t.map(e=>{let{schemaName:t,tableName:n,columns:r,values:i}=e,o=t?`[${t}].[${n}]`:`[${n}]`,s=r.length>0?`([${r.join(`], [`)}])`:``,c=e=>e.value===null?`NULL`:e.type===`expression`||(0,a.isNumericType)(e.type)?e.value:(0,a.isBooleanType)(e.type)?String(e.value).toUpperCase()===`TRUE`?`1`:`0`:(0,a.isStringType)(e.type)||(0,a.isDateTimeType)(e.type)?`'${e.value.replace(/'/g,`''`)}'`:(0,a.isBinaryType)(e.type)?`0x${e.value}`:`CAST('${e.value.replace(/'/g,`''`)}' AS ${e.type})`;return`INSERT INTO ${o} ${s}\nVALUES\n ${i.map(e=>`(${e.map(c).join(`, `)})`).join(`,
|
|
2
2
|
`)};\nGO`})}static getFieldLines(e,t){return t.tables[e].fieldIds.map(e=>{let n=t.fields[e],r=``;if(n.enumId){let e=t.enums[n.enumId];r=`[${n.name}] nvarchar(255) CHECK ([${n.name}] IN (`;let i=e.valueIds.map(e=>`'${t.enumValues[e].name}'`);r+=`${i.join(`, `)}))`}else r=`[${n.name}] ${n.type.type_name===`varchar`?`nvarchar(255)`:n.type.type_name}`;if(n.unique&&(r+=` UNIQUE`),n.pk&&(r+=` PRIMARY KEY`),n.not_null&&(r+=` NOT NULL`),n.increment&&(r+=` IDENTITY(1, 1)`),n.checkIds&&n.checkIds.length>0)if(n.checkIds.length===1){let e=t.checks[n.checkIds[0]];e.name&&(r+=` CONSTRAINT [${e.name}]`),r+=` CHECK (${e.expression})`}else{let e=n.checkIds.map(e=>`(${t.checks[e].expression})`);r+=` CHECK (${e.join(` AND `)})`}return n.dbdefault&&(n.dbdefault.type===`boolean`&&(n.dbdefault.value===null||typeof n.dbdefault.value==`string`&&n.dbdefault.value.toLowerCase()===`null`)||(n.dbdefault.type===`expression`?r+=` DEFAULT (${n.dbdefault.value})`:n.dbdefault.type===`string`?r+=` DEFAULT '${n.dbdefault.value}'`:r+=` DEFAULT (${n.dbdefault.value})`)),r})}static getCompositePKs(e,t){let n=t.tables[e];return(n.indexIds?n.indexIds.filter(e=>t.indexes[e].pk):[]).map(e=>{let n=t.indexes[e],r=`PRIMARY KEY`,i=[];return n.columnIds.forEach(e=>{let n=t.indexColumns[e],r=``;r=n.type===`expression`?`(${n.value})`:`[${n.value}]`,i.push(r)}),r+=` (${i.join(`, `)})`,r})}static getCheckLines(e,t){let n=t.tables[e];return!n.checkIds||n.checkIds.length===0?[]:n.checkIds.map(e=>{let n=t.checks[e],r=``;return n.name&&(r=`CONSTRAINT [${n.name}] `),r+=`CHECK (${n.expression})`,r})}static getTableContentArr(e,t){return e.map(e=>({tableId:e,fieldContents:r.getFieldLines(e,t),checkContents:r.getCheckLines(e,t),compositePKs:r.getCompositePKs(e,t)}))}static exportTables(e,t){return r.getTableContentArr(e,t).map(e=>{let n=[...e.fieldContents,...e.checkContents,...e.compositePKs],r=t.tables[e.tableId],a=t.schemas[r.schemaId];return`CREATE TABLE ${i.shouldPrintSchema(a,t)?`[${a.name}].`:``}[${r.name}] (\n${n.map(e=>` ${e}`).join(`,
|
|
3
3
|
`)}\n)\nGO\n`})}static buildTableManyToMany(e,t,n,r,a){let o=`CREATE TABLE ${i.shouldPrintSchema(r,a)?`[${r.name}].`:``}[${n}] (\n`,s=[...e.keys()].join(`], [`),c=[...t.keys()].join(`], [`);return e.forEach((e,t)=>{o+=` [${t}] ${e},\n`}),t.forEach((e,t)=>{o+=` [${t}] ${e},\n`}),o+=` PRIMARY KEY ([${s}], [${c}])\n`,o+=`);
|
|
4
4
|
GO
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/flatten.mjs";
|
|
2
|
-
import t from "../node_modules/lodash-es/concat.mjs";
|
|
3
|
-
import n from "../node_modules/lodash-es/isEmpty.mjs";
|
|
4
|
-
import { init_lodash as r } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.mjs";
|
|
2
|
+
import t from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/concat.mjs";
|
|
3
|
+
import n from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.mjs";
|
|
4
|
+
import { init_lodash as r } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
5
5
|
import { buildJunctionFields1 as i, buildJunctionFields2 as a, buildNewTableName as o, shouldPrintSchema as s } from "./utils.mjs";
|
|
6
6
|
import { isBinaryType as c, isBooleanType as l, isDateTimeType as u, isNumericType as d, isStringType as f, parseCardinality as p } from "@dbml/parse";
|
|
7
7
|
//#region src/export/SqlServerExporter.js
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/capitalize.cjs"),n=require("../node_modules/lodash-es/lodash.cjs"),r=require("./config.cjs"),i=require("./dbState.cjs"),a=require("./element.cjs"),o=require("./dep.cjs"),s=require("./enum.cjs"),c=require("./ref.cjs"),l=require("./table.cjs"),u=require("./tableGroup.cjs"),d=require("./schema.cjs"),f=require("./stickyNote.cjs"),p=require("./tablePartial.cjs");let m=require("@dbml/parse");n.init_lodash();var h=class extends a.default{constructor({schemas:t=[],tables:n=[],notes:a=[],enums:o=[],refs:s=[],deps:l=[],tableGroups:u=[],project:d={},aliases:f=[],records:p=[],tablePartials:m=[],diagramViews:h=[]}={}){super(),this.dbState=new i.default,this.generateId(),this.hasDefaultSchema=!1,this.schemas=[],this.notes=[],this.note=d.note?e.default(d,`note.value`,typeof d.note==`string`?d.note:null):null,this.noteToken=d.note?e.default(d,`note.token`,d.noteToken):null,this.databaseType=d.database_type,this.name=d.name,this.token=d.token,this.aliases=f,this.records=[],this.tablePartials=[],this.diagramViews=h,this.injectedRawRefs=[],this.processNotes(a),this.processRecords(p),this.processTablePartials(m),this.processSchemas(t),this.processSchemaElements(o,r.ENUM),this.processSchemaElements(n,r.TABLE),this.linkRecordsToTables(),this.processSchemaElements(a,r.NOTE),this.processSchemaElements(s,`ref`),this.processSchemaElements(l,`dep`),this.processSchemaElements(u,r.TABLE_GROUP),this.injectedRawRefs.forEach(e=>{let t=this.findOrCreateSchema(r.DEFAULT_SCHEMA_NAME),n=new c.default({...e,schema:t});t.refs.some(e=>e.equals(n))||t.pushRef(n)})}generateId(){this.id=this.dbState.generateId(`dbId`)}processNotes(e){e.forEach(e=>{this.pushNote(new f.default({...e,database:this}))})}processRecords(e){e.forEach(({schemaName:e,tableName:t,columns:n,values:r,example:i,token:a})=>{this.records.push({id:this.dbState.generateId(`recordId`),schemaName:e,tableName:t,columns:n,values:r,example:i,token:a})})}processTablePartials(e){e.forEach(e=>{this.tablePartials.push(new p.default({...e,dbState:this.dbState}))})}pushNote(e){this.checkNote(e),this.notes.push(e)}checkNote(e){this.notes.some(t=>t.name===e.name)&&e.error(`Notes ${e.name} existed`)}processSchemas(e){e.forEach(e=>{this.pushSchema(new d.default({...e,database:this}))})}pushSchema(e){this.checkSchema(e),this.schemas.push(e)}checkSchema(e){this.schemas.some(t=>t.name===e.name)&&e.error(`Schemas ${e.name} existed`)}processSchemaElements(e,t){let n;e.forEach(e=>{switch(e.schemaName?(n=this.findOrCreateSchema(e.schemaName),e.schemaName):n=this.findOrCreateSchema(r.DEFAULT_SCHEMA_NAME),t){case r.TABLE:n.pushTable(new l.default({...e,schema:n}));break;case r.ENUM:n.pushEnum(new s.default({...e,schema:n}));break;case r.TABLE_GROUP:n.pushTableGroup(new u.default({...e,schema:n}));break;case`ref`:n.pushRef(new c.default({...e,schema:n}));break;case`dep`:n.pushDep(new o.default({...e,schema:n}));break;default:break}})}linkRecordsToTables(){let e={};this.schemas.forEach(t=>{e[t.name]={},t.tables.forEach(n=>{e[t.name][n.name]=n})}),this.records.forEach(t=>{let n=e[t.schemaName??`public`]?.[t.tableName];n&&(t.tableId=n.id,n.records.push(t))})}findOrCreateSchema(e){let n=this.schemas.find(t=>t.name===e||t.alias===e);return n||(n=new d.default({name:e,note:{value:e===`public`?`Default ${t.default(r.DEFAULT_SCHEMA_NAME)} Schema`:null},database:this}),this.pushSchema(n)),n}findTableAlias(e){let t=this.aliases.find(t=>t.name===e);if(!t||t.kind!==`table`)return null;let n=t.value.schemaName||`public`,r=this.schemas.find(e=>e.name===n);if(!r)return null;let{tableName:i}=t.value;return r.tables.find(e=>e.name===i)||null}findTable(e,t){let n=null;if(!e&&(n=this.findTableAlias(t),n))return n;let r=this.findOrCreateSchema(e||`public`);return r||this.error(`Schema ${e||`public`} don't exist`),r.findTable(t)}findEnum(e,t){let n=this.schemas.find(t=>t.name===e||t.alias===e);if(n)return n.enums.find(e=>e.name===t)}findTablePartial(e){return this.tablePartials.find(t=>t.name===e)}adjustCardinalitiesFromColumns(){this.schemas.forEach(e=>{e.refs.forEach(e=>{let t=e.endpoints.find(e=>(0,m.parseCardinality)(e.relation).max===`*`),n=e.endpoints.find(e=>(0,m.parseCardinality)(e.relation).max===1);if(!n)return;let r,i;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=(0,m.makeCardinalityRequired)(i.relation))})})}export(){return{...this.exportChild()}}shallowExport(){return{hasDefaultSchema:this.hasDefaultSchema,note:this.note,databaseType:this.databaseType,name:this.name}}exportChild(){return{schemas:this.schemas.map(e=>e.export()),notes:this.notes.map(e=>e.export()),records:this.records.map(e=>({...e}))}}exportChildIds(){return{schemaIds:this.schemas.map(e=>e.id),noteIds:this.notes.map(e=>e.id)}}normalize(){let e={database:{[this.id]:{id:this.id,...this.shallowExport(),...this.exportChildIds()}},schemas:{},notes:{},refs:{},deps:{},depEdges:{},enums:{},tableGroups:{},tables:{},endpoints:{},enumValues:{},indexes:{},indexColumns:{},checks:{},fields:{},records:{},tablePartials:{}};return this.schemas.forEach(t=>t.normalize(e)),this.notes.forEach(t=>t.normalize(e)),this.records.forEach(t=>{e.records[t.id]={...t}}),this.tablePartials.forEach(t=>t.normalize(e)),e}};exports.default=h;
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/capitalize.cjs"),n=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.cjs"),r=require("./config.cjs"),i=require("./dbState.cjs"),a=require("./element.cjs"),o=require("./dep.cjs"),s=require("./enum.cjs"),c=require("./ref.cjs"),l=require("./table.cjs"),u=require("./tableGroup.cjs"),d=require("./schema.cjs"),f=require("./stickyNote.cjs"),p=require("./tablePartial.cjs");let m=require("@dbml/parse");n.init_lodash();var h=class extends a.default{constructor({schemas:t=[],tables:n=[],notes:a=[],enums:o=[],refs:s=[],deps:l=[],tableGroups:u=[],project:d={},aliases:f=[],records:p=[],tablePartials:m=[],diagramViews:h=[]}={}){super(),this.dbState=new i.default,this.generateId(),this.hasDefaultSchema=!1,this.schemas=[],this.notes=[],this.note=d.note?e.default(d,`note.value`,typeof d.note==`string`?d.note:null):null,this.noteToken=d.note?e.default(d,`note.token`,d.noteToken):null,this.databaseType=d.database_type,this.name=d.name,this.token=d.token,this.aliases=f,this.records=[],this.tablePartials=[],this.diagramViews=h,this.injectedRawRefs=[],this.processNotes(a),this.processRecords(p),this.processTablePartials(m),this.processSchemas(t),this.processSchemaElements(o,r.ENUM),this.processSchemaElements(n,r.TABLE),this.linkRecordsToTables(),this.processSchemaElements(a,r.NOTE),this.processSchemaElements(s,`ref`),this.processSchemaElements(l,`dep`),this.processSchemaElements(u,r.TABLE_GROUP),this.injectedRawRefs.forEach(e=>{let t=this.findOrCreateSchema(r.DEFAULT_SCHEMA_NAME),n=new c.default({...e,schema:t});t.refs.some(e=>e.equals(n))||t.pushRef(n)})}generateId(){this.id=this.dbState.generateId(`dbId`)}processNotes(e){e.forEach(e=>{this.pushNote(new f.default({...e,database:this}))})}processRecords(e){e.forEach(({schemaName:e,tableName:t,columns:n,values:r,example:i,token:a})=>{this.records.push({id:this.dbState.generateId(`recordId`),schemaName:e,tableName:t,columns:n,values:r,example:i,token:a})})}processTablePartials(e){e.forEach(e=>{this.tablePartials.push(new p.default({...e,dbState:this.dbState}))})}pushNote(e){this.checkNote(e),this.notes.push(e)}checkNote(e){this.notes.some(t=>t.name===e.name)&&e.error(`Notes ${e.name} existed`)}processSchemas(e){e.forEach(e=>{this.pushSchema(new d.default({...e,database:this}))})}pushSchema(e){this.checkSchema(e),this.schemas.push(e)}checkSchema(e){this.schemas.some(t=>t.name===e.name)&&e.error(`Schemas ${e.name} existed`)}processSchemaElements(e,t){let n;e.forEach(e=>{switch(e.schemaName?(n=this.findOrCreateSchema(e.schemaName),e.schemaName):n=this.findOrCreateSchema(r.DEFAULT_SCHEMA_NAME),t){case r.TABLE:n.pushTable(new l.default({...e,schema:n}));break;case r.ENUM:n.pushEnum(new s.default({...e,schema:n}));break;case r.TABLE_GROUP:n.pushTableGroup(new u.default({...e,schema:n}));break;case`ref`:n.pushRef(new c.default({...e,schema:n}));break;case`dep`:n.pushDep(new o.default({...e,schema:n}));break;default:break}})}linkRecordsToTables(){let e={};this.schemas.forEach(t=>{e[t.name]={},t.tables.forEach(n=>{e[t.name][n.name]=n})}),this.records.forEach(t=>{let n=e[t.schemaName??`public`]?.[t.tableName];n&&(t.tableId=n.id,n.records.push(t))})}findOrCreateSchema(e){let n=this.schemas.find(t=>t.name===e||t.alias===e);return n||(n=new d.default({name:e,note:{value:e===`public`?`Default ${t.default(r.DEFAULT_SCHEMA_NAME)} Schema`:null},database:this}),this.pushSchema(n)),n}findTableAlias(e){let t=this.aliases.find(t=>t.name===e);if(!t||t.kind!==`table`)return null;let n=t.value.schemaName||`public`,r=this.schemas.find(e=>e.name===n);if(!r)return null;let{tableName:i}=t.value;return r.tables.find(e=>e.name===i)||null}findTable(e,t){let n=null;if(!e&&(n=this.findTableAlias(t),n))return n;let r=this.findOrCreateSchema(e||`public`);return r||this.error(`Schema ${e||`public`} don't exist`),r.findTable(t)}findEnum(e,t){let n=this.schemas.find(t=>t.name===e||t.alias===e);if(n)return n.enums.find(e=>e.name===t)}findTablePartial(e){return this.tablePartials.find(t=>t.name===e)}adjustCardinalitiesFromColumns(){this.schemas.forEach(e=>{e.refs.forEach(e=>{let t=e.endpoints.find(e=>(0,m.parseCardinality)(e.relation).max===`*`),n=e.endpoints.find(e=>(0,m.parseCardinality)(e.relation).max===1);if(!n)return;let r,i;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=(0,m.makeCardinalityRequired)(i.relation))})})}export(){return{...this.exportChild()}}shallowExport(){return{hasDefaultSchema:this.hasDefaultSchema,note:this.note,databaseType:this.databaseType,name:this.name}}exportChild(){return{schemas:this.schemas.map(e=>e.export()),notes:this.notes.map(e=>e.export()),records:this.records.map(e=>({...e}))}}exportChildIds(){return{schemaIds:this.schemas.map(e=>e.id),noteIds:this.notes.map(e=>e.id)}}normalize(){let e={database:{[this.id]:{id:this.id,...this.shallowExport(),...this.exportChildIds()}},schemas:{},notes:{},refs:{},deps:{},depEdges:{},enums:{},tableGroups:{},tables:{},endpoints:{},enumValues:{},indexes:{},indexColumns:{},checks:{},fields:{},records:{},tablePartials:{}};return this.schemas.forEach(t=>t.normalize(e)),this.notes.forEach(t=>t.normalize(e)),this.records.forEach(t=>{e.records[t.id]={...t}}),this.tablePartials.forEach(t=>t.normalize(e)),e}};exports.default=h;
|
|
@@ -1,6 +1,6 @@
|
|
|
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";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.mjs";
|
|
2
|
+
import t from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/capitalize.mjs";
|
|
3
|
+
import { init_lodash as n } from "../node_modules/.pnpm/lodash-es@4.18.1/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
6
|
import l from "./element.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs");require("./config.cjs");const n=require("./element.cjs"),r=require("./depEdge.cjs");t.init_lodash();var i=class extends n.default{constructor({name:t,color:n,note:r,metadata:i,edges:a,token:o,schema:s={}}){super(o),this.name=t??null,this.color=n,this.note=r?e.default(r,`value`,r):null,this.noteToken=r?e.default(r,`token`,null):null,this.metadata=i??null,this.edges=[],this.schema=s,this.dbState=this.schema.dbState,this.generateId(),this.processEdges(a??[])}generateId(){this.id=this.dbState.generateId(`depId`)}processEdges(e){e.forEach(e=>{let t=e.upstream?.schemaName||`public`,n=e.downstream?.schemaName||`public`,i=e.upstream?.tableName,a=e.downstream?.tableName,o=e.upstream?.fieldNames?.join(`,`),s=e.downstream?.fieldNames?.join(`,`);t===n&&i===a&&o===s&&o&&this.error(`Self-loop Dep edge not allowed: "${t}"."${i}" columns cannot depend on itself`),this.edges.push(new r.default({...e,dep:this}))})}export(){return{...this.shallowExport(),...this.exportChild()}}shallowExport(){return{name:this.name,color:this.color,note:this.note,metadata:this.metadata}}exportChild(){return{edges:this.edges.map(e=>e.export())}}exportChildIds(){return{edgeIds:this.edges.map(e=>e.id)}}exportParentIds(){return{schemaId:this.schema.id}}normalize(e){e.deps[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.edges.forEach(t=>t.normalize(e))}};exports.default=i;
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/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,5 +1,5 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/get.mjs";
|
|
2
|
-
import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.mjs";
|
|
2
|
+
import { init_lodash as t } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
3
3
|
import "./config.mjs";
|
|
4
4
|
import n from "./element.mjs";
|
|
5
5
|
import r from "./depEdge.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs"),n=require("./utils.cjs"),r=require("./element.cjs"),i=require("./enumValue.cjs");t.init_lodash();var a=class extends r.default{constructor({name:t,token:n,values:r,note:i,schema:a,noteToken:o=null}={}){super(n),t||this.error(`Enum must have a name`),this.name=t,this.note=i?e.default(i,`value`,i):null,this.noteToken=i?e.default(i,`token`,o):null,this.values=[],this.fields=[],this.schema=a,this.dbState=this.schema.dbState,this.generateId(),this.processValues(r)}generateId(){this.id=this.dbState.generateId(`enumId`)}processValues(e){e.forEach(e=>{this.pushValue(new i.default({...e,_enum:this}))})}pushValue(e){this.checkValue(e),this.values.push(e)}checkValue(e){this.values.some(t=>t.name===e.name)&&e.error(`Enum value "${e.name}" existed in enum ${n.shouldPrintSchema(this.schema)?`"${this.schema.name}".`:``}"${this.name}"`)}pushField(e){this.checkField(e),this.fields.push(e)}checkField(e){this.fields.some(t=>t.id===e.id)&&this.error(`Field ${n.shouldPrintSchema(e.table.schema)?`"${e.table.schema.name}".`:``}"${e.table.name}"."${e.name}" already associated with enum ${n.shouldPrintSchema(this.schema)?`"${this.schema.name}".`:``}${this.name}"`)}export(){return{...this.shallowExport(),...this.exportChild()}}exportChild(){return{values:this.values.map(e=>e.export())}}exportChildIds(){return{valueIds:this.values.map(e=>e.id),fieldIds:this.fields.map(e=>e.id)}}exportParentIds(){return{schemaId:this.schema.id}}shallowExport(){return{name:this.name,note:this.note}}normalize(e){e.enums[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.values.forEach(t=>t.normalize(e))}};exports.default=a;
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/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,5 +1,5 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/get.mjs";
|
|
2
|
-
import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.mjs";
|
|
2
|
+
import { init_lodash as t } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
3
3
|
import { shouldPrintSchema as n } from "./utils.mjs";
|
|
4
4
|
import r from "./element.mjs";
|
|
5
5
|
import i from "./enumValue.mjs";
|
|
@@ -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("./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
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/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,5 +1,5 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/get.mjs";
|
|
2
|
-
import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.mjs";
|
|
2
|
+
import { init_lodash as t } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
3
3
|
import n from "./element.mjs";
|
|
4
4
|
//#region src/model_structure/enumValue.js
|
|
5
5
|
t();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs");require("./config.cjs");const n=require("./element.cjs"),r=require("./check.cjs");t.init_lodash();var i=class extends n.default{constructor({name:t,type:n,unique:r,pk:i,token:a,not_null:o,note:s,dbdefault:c,increment:l,checks:u=[],table:d={},noteToken:f=null,injectedPartial:p=null,injectedToken:m=null,metadata:h={}}){super(a),t||this.error(`Field must have a name`),n||this.error(`Field must have a type`),this.name=t,this.type=n,this.unique=r,this.pk=i,this.not_null=o,this.note=s?e.default(s,`value`,s):null,this.noteToken=s?e.default(s,`token`,f):null,this.dbdefault=c,this.increment=l,this.checks=[],this.endpoints=[],this.depEdges=[],this.table=d,this.injectedPartial=p,this.injectedToken=m,this.dbState=this.table.dbState,this.metadata=h,this.generateId(),this.bindType(),this.processChecks(u)}generateId(){this.id=this.dbState.generateId(`fieldId`)}bindType(){let e=this.type.type_name,t=this.type.schemaName||`public`;if(this.type.schemaName){let n=this.table.schema.database.findEnum(t,e);if(!n){this.type.type_name=`${t}.${e}`,this.type.originalTypeName=e;return}this._enum=n,n.pushField(this)}else{let n=this.table.schema.database.findEnum(t,e);if(!n)return;this._enum=n,n.pushField(this)}}pushEndpoint(e){this.endpoints.push(e)}pushDepEdge(e){this.depEdges.push(e)}export(){return{...this.shallowExport()}}exportParentIds(){return{tableId:this.table.id,enumId:this._enum?this._enum.id:null}}exportChildIds(){return{endpointIds:this.endpoints.map(e=>e.id),depEdgeIds:this.depEdges.map(e=>e.id)}}shallowExport(){return{name:this.name,type:this.type,unique:this.unique,pk:this.pk,not_null:this.not_null,note:this.note,dbdefault:this.dbdefault,increment:this.increment,injectedPartialId:this.injectedPartial?.id??null,checkIds:this.checks.map(e=>e.id),metadata:this.metadata}}normalize(e){e.fields[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.checks.forEach(t=>t.normalize(e))}processChecks(e){e.forEach(e=>{this.checks.push(new r.default({...e,table:this.table,column:this}))})}};exports.default=i;
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/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,5 +1,5 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/get.mjs";
|
|
2
|
-
import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.mjs";
|
|
2
|
+
import { init_lodash as t } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
3
3
|
import "./config.mjs";
|
|
4
4
|
import n from "./element.mjs";
|
|
5
5
|
import r from "./check.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs"),require("./config.cjs");const e=require("./element.cjs"),t=require("./endpoint.cjs");function n(e,t){return e[0].equals(t[0])&&e[1].equals(t[1])}var r=class extends e.default{constructor({name:e,color:t,endpoints:n,onDelete:r,onUpdate:i,inactive:a,token:o,schema:s={},injectedPartial:c=null}={}){super(o),this.name=e,this.color=t,this.onDelete=r,this.onUpdate=i,this.inactive=a,this.endpoints=[],this.schema=s,this.injectedPartial=c,this.dbState=this.schema.dbState,this.generateId(),this.processEndpoints(n)}generateId(){this.id=this.dbState.generateId(`refId`)}processEndpoints(e){e.forEach(e=>{this.endpoints.push(new t.default({...e,ref:this})),e.schemaName}),this.endpoints[0].equals(this.endpoints[1])&&this.error(`Two endpoints are the same`),this.endpoints[0].fields.length!==this.endpoints[1].fields.length&&this.error(`Two endpoints have unequal number of fields`)}equals(e){return n(this.endpoints,e.endpoints)||n(this.endpoints,e.endpoints.slice().reverse())}export(){return{...this.shallowExport(),...this.exportChild()}}shallowExport(){return{name:this.name,color:this.color,onDelete:this.onDelete,onUpdate:this.onUpdate,inactive:this.inactive,injectedPartialId:this.injectedPartial?.id}}exportChild(){return{endpoints:this.endpoints.map(e=>e.export())}}exportChildIds(){return{endpointIds:this.endpoints.map(e=>e.id)}}exportParentIds(){return{schemaId:this.schema.id}}normalize(e){e.refs[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.endpoints.forEach(t=>t.normalize(e))}};exports.default=r;
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs"),require("./config.cjs");const e=require("./element.cjs"),t=require("./endpoint.cjs");function n(e,t){return e[0].equals(t[0])&&e[1].equals(t[1])}var r=class extends e.default{constructor({name:e,color:t,endpoints:n,onDelete:r,onUpdate:i,inactive:a,token:o,schema:s={},injectedPartial:c=null,metadata:l={}}={}){super(o),this.name=e,this.color=t,this.onDelete=r,this.onUpdate=i,this.inactive=a,this.metadata=l,this.endpoints=[],this.schema=s,this.injectedPartial=c,this.dbState=this.schema.dbState,this.generateId(),this.processEndpoints(n)}generateId(){this.id=this.dbState.generateId(`refId`)}processEndpoints(e){e.forEach(e=>{this.endpoints.push(new t.default({...e,ref:this})),e.schemaName}),this.endpoints[0].equals(this.endpoints[1])&&this.error(`Two endpoints are the same`),this.endpoints[0].fields.length!==this.endpoints[1].fields.length&&this.error(`Two endpoints have unequal number of fields`)}equals(e){return n(this.endpoints,e.endpoints)||n(this.endpoints,e.endpoints.slice().reverse())}export(){return{...this.shallowExport(),...this.exportChild()}}shallowExport(){return{name:this.name,color:this.color,onDelete:this.onDelete,onUpdate:this.onUpdate,inactive:this.inactive,metadata:this.metadata,injectedPartialId:this.injectedPartial?.id}}exportChild(){return{endpoints:this.endpoints.map(e=>e.export())}}exportChildIds(){return{endpointIds:this.endpoints.map(e=>e.id)}}exportParentIds(){return{schemaId:this.schema.id}}normalize(e){e.refs[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.endpoints.forEach(t=>t.normalize(e))}};exports.default=r;
|
|
@@ -6,8 +6,8 @@ function n(e, t) {
|
|
|
6
6
|
return e[0].equals(t[0]) && e[1].equals(t[1]);
|
|
7
7
|
}
|
|
8
8
|
var r = class extends e {
|
|
9
|
-
constructor({ name: e, color: t, endpoints: n, onDelete: r, onUpdate: i, inactive: a, token: o, schema: s = {}, injectedPartial: c = null } = {}) {
|
|
10
|
-
super(o), this.name = e, this.color = t, this.onDelete = r, this.onUpdate = i, this.inactive = a, this.endpoints = [], this.schema = s, this.injectedPartial = c, this.dbState = this.schema.dbState, this.generateId(), this.processEndpoints(n);
|
|
9
|
+
constructor({ name: e, color: t, endpoints: n, onDelete: r, onUpdate: i, inactive: a, token: o, schema: s = {}, injectedPartial: c = null, metadata: l = {} } = {}) {
|
|
10
|
+
super(o), this.name = e, this.color = t, this.onDelete = r, this.onUpdate = i, this.inactive = a, this.metadata = l, this.endpoints = [], this.schema = s, this.injectedPartial = c, this.dbState = this.schema.dbState, this.generateId(), this.processEndpoints(n);
|
|
11
11
|
}
|
|
12
12
|
generateId() {
|
|
13
13
|
this.id = this.dbState.generateId("refId");
|
|
@@ -36,6 +36,7 @@ var r = class extends e {
|
|
|
36
36
|
onDelete: this.onDelete,
|
|
37
37
|
onUpdate: this.onUpdate,
|
|
38
38
|
inactive: this.inactive,
|
|
39
|
+
metadata: this.metadata,
|
|
39
40
|
injectedPartialId: this.injectedPartial?.id
|
|
40
41
|
};
|
|
41
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs"),n=require("./utils.cjs"),r=require("./element.cjs"),i=require("./dep.cjs"),a=require("./enum.cjs"),o=require("./ref.cjs"),s=require("./table.cjs"),c=require("./tableGroup.cjs");t.init_lodash();var l=class extends r.default{constructor({name:t,alias:n,note:r,tables:i=[],refs:a=[],deps:o=[],enums:s=[],tableGroups:c=[],token:l,database:u={},noteToken:d=null}={}){super(l),this.tables=[],this.enums=[],this.tableGroups=[],this.refs=[],this.deps=[],this.name=t,this.note=r?e.default(r,`value`,typeof r==`string`?r:null):null,this.noteToken=r?e.default(r,`token`,d):null,this.alias=n,this.database=u,this.dbState=this.database.dbState,this.generateId(),this.processEnums(s),this.processTables(i),this.processRefs(a),this.processDeps(o),this.processTableGroups(c)}generateId(){this.id=this.dbState.generateId(`schemaId`)}processTables(e){e.forEach(e=>{this.pushTable(new s.default({...e,schema:this}))})}pushTable(e){this.checkTable(e),this.tables.push(e)}checkTable(e){this.tables.some(t=>t.name===e.name)&&e.error(`Table ${n.shouldPrintSchema(this)?`"${this.name}".`:``}"${e.name}" existed`)}findTable(e){return this.tables.find(t=>t.name===e)}processEnums(e){e.forEach(e=>{this.pushEnum(new a.default({...e,schema:this}))})}pushEnum(e){this.checkEnum(e),this.enums.push(e)}checkEnum(e){this.enums.some(t=>t.name===e.name)&&e.error(`Enum ${n.shouldPrintSchema(this)?`"${this.name}".`:``}"${e.name}" existed`)}processRefs(e){e.forEach(e=>{this.pushRef(new o.default({...e,schema:this}))})}pushRef(e){this.checkRef(e),this.refs.push(e)}checkRef(e){if(this.refs.some(t=>t.equals(e))){let t=e.endpoints[0],n=t.fieldNames.map(e=>JSON.stringify(e)).join(`, `),r=e.endpoints[1],i=r.fieldNames.map(e=>JSON.stringify(e)).join(`, `),a=`"${t.schemaName?`${t.schemaName}"."`:``}${t.tableName}"(${n})`,o=`"${r.schemaName?`${r.schemaName}"."`:``}${r.tableName}"(${i})`;e.error(`Reference with the same endpoints already exists: ${a} references ${o}`)}}processDeps(e){e.forEach(e=>{this.pushDep(new i.default({...e,schema:this}))})}pushDep(e){this.deps.push(e)}processTableGroups(e){e.forEach(e=>{this.pushTableGroup(new c.default({...e,schema:this}))})}pushTableGroup(e){this.checkTableGroup(e),this.tableGroups.push(e)}checkTableGroup(e){this.tableGroups.some(t=>t.name===e.name)&&e.error(`Table Group ${n.shouldPrintSchema(this)?`"${this.name}".`:``}"${e.name}" existed`)}checkSameId(e){return this.name===e.name||this.alias===e.name||this.name===e.alias||!!this.alias&&this.alias===e.alias}export(){return{...this.shallowExport(),...this.exportChild()}}exportChild(){return{tables:this.tables.map(e=>e.export()),enums:this.enums.map(e=>e.export()),tableGroups:this.tableGroups.map(e=>e.export()),refs:this.refs.map(e=>e.export()),deps:this.deps.map(e=>e.export())}}exportChildIds(){return{tableIds:this.tables.map(e=>e.id),enumIds:this.enums.map(e=>e.id),tableGroupIds:this.tableGroups.map(e=>e.id),refIds:this.refs.map(e=>e.id),depIds:this.deps.map(e=>e.id)}}exportParentIds(){return{databaseId:this.database.id}}shallowExport(){return{name:this.name,note:this.note,alias:this.alias}}normalize(e){e.schemas[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()},this.tables.forEach(t=>t.normalize(e)),this.enums.forEach(t=>t.normalize(e)),this.tableGroups.forEach(t=>t.normalize(e)),this.refs.forEach(t=>t.normalize(e)),this.deps.forEach(t=>t.normalize(e))}};exports.default=l;
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/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,5 +1,5 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/get.mjs";
|
|
2
|
-
import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.mjs";
|
|
2
|
+
import { init_lodash as t } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
3
3
|
import { shouldPrintSchema as n } from "./utils.mjs";
|
|
4
4
|
import r from "./element.mjs";
|
|
5
5
|
import i from "./dep.mjs";
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNil.cjs"),n=require("../node_modules/.pnpm/lodash-es@4.18.1/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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/get.mjs";
|
|
2
|
-
import t from "../node_modules/lodash-es/isNil.mjs";
|
|
3
|
-
import { init_lodash as n } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.mjs";
|
|
2
|
+
import t from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNil.mjs";
|
|
3
|
+
import { init_lodash as n } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
4
4
|
import "./config.mjs";
|
|
5
5
|
import { shouldPrintSchema as r } from "./utils.mjs";
|
|
6
6
|
import i from "./element.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/lodash-es/get.cjs"),t=require("../node_modules/lodash-es/lodash.cjs"),n=require("./utils.cjs"),r=require("./element.cjs");t.init_lodash();var i=class extends r.default{constructor({name:t,token:n,tables:r=[],schema:i={},note:a,color:o,noteToken:s=null,metadata:c={}}){super(n),this.metadata=c,this.name=t,this.tables=[],this.schema=i,this.dbState=this.schema.dbState,this.note=a?e.default(a,`value`,a):null,this.noteToken=a?e.default(a,`token`,s):null,this.color=o,this.generateId(),this.processTables(r)}generateId(){this.id=this.dbState.generateId(`tableGroupId`)}processTables(e){e.forEach(e=>{let t=this.schema.database.findTable(e.schemaName,e.name);t||this.error(`Table ${e.schemaName?`"${e.schemaName}".`:``}${e.name} don't exist`),this.pushTable(t)})}pushTable(e){this.checkTable(e),this.tables.push(e),e.group=this}checkTable(e){this.tables.some(t=>t.id===e.id)&&this.error(`Table ${n.shouldPrintSchema(e.schema)?`"${e.schema.name}".`:``}.${e.name} is already in the group`),e.group&&this.error(`Table ${n.shouldPrintSchema(e.schema)?`"${e.schema.name}".`:``}.${e.name} is already in group ${n.shouldPrintSchema(e.group.schema)?`"${e.group.schema.name}".`:``}${e.group.name}`)}export(){return{...this.shallowExport(),...this.exportChild()}}exportChild(){return{tables:this.tables.map(e=>({tableName:e.name,schemaName:e.schema.name}))}}exportChildIds(){return{tableIds:this.tables.map(e=>e.id)}}exportParentIds(){return{schemaId:this.schema.id}}shallowExport(){return{name:this.name,note:this.note,color:this.color,metadata:this.metadata}}normalize(e){e.tableGroups[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()}}};exports.default=i;
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.cjs"),n=require("./utils.cjs"),r=require("./element.cjs");t.init_lodash();var i=class extends r.default{constructor({name:t,token:n,tables:r=[],schema:i={},note:a,color:o,noteToken:s=null,metadata:c={}}){super(n),this.metadata=c,this.name=t,this.tables=[],this.schema=i,this.dbState=this.schema.dbState,this.note=a?e.default(a,`value`,a):null,this.noteToken=a?e.default(a,`token`,s):null,this.color=o,this.generateId(),this.processTables(r)}generateId(){this.id=this.dbState.generateId(`tableGroupId`)}processTables(e){e.forEach(e=>{let t=this.schema.database.findTable(e.schemaName,e.name);t||this.error(`Table ${e.schemaName?`"${e.schemaName}".`:``}${e.name} don't exist`),this.pushTable(t)})}pushTable(e){this.checkTable(e),this.tables.push(e),e.group=this}checkTable(e){this.tables.some(t=>t.id===e.id)&&this.error(`Table ${n.shouldPrintSchema(e.schema)?`"${e.schema.name}".`:``}.${e.name} is already in the group`),e.group&&this.error(`Table ${n.shouldPrintSchema(e.schema)?`"${e.schema.name}".`:``}.${e.name} is already in group ${n.shouldPrintSchema(e.group.schema)?`"${e.group.schema.name}".`:``}${e.group.name}`)}export(){return{...this.shallowExport(),...this.exportChild()}}exportChild(){return{tables:this.tables.map(e=>({tableName:e.name,schemaName:e.schema.name}))}}exportChildIds(){return{tableIds:this.tables.map(e=>e.id)}}exportParentIds(){return{schemaId:this.schema.id}}shallowExport(){return{name:this.name,note:this.note,color:this.color,metadata:this.metadata}}normalize(e){e.tableGroups[this.id]={id:this.id,...this.shallowExport(),...this.exportChildIds(),...this.exportParentIds()}}};exports.default=i;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/get.mjs";
|
|
2
|
-
import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.mjs";
|
|
2
|
+
import { init_lodash as t } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
3
3
|
import { shouldPrintSchema as n } from "./utils.mjs";
|
|
4
4
|
import r from "./element.mjs";
|
|
5
5
|
//#region src/model_structure/tableGroup.ts
|
|
@@ -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("./element.cjs");t.init_lodash();var r=class extends n.default{constructor({name:t,note:n,fields:r=[],indexes:i=[],checks:a=[],token:o,headerColor:s,noteToken:c=null,dbState:l}={}){super(o),this.name=t,this.note=n?e.default(n,`value`,n):null,this.noteToken=n?e.default(n,`token`,c):null,this.headerColor=s,this.fields=r,this.indexes=i,this.checks=a,this.dbState=l,this.generateId()}generateId(){this.id=this.dbState.generateId(`tablePartialId`)}export(){return{...this.shallowExport()}}shallowExport(){return{name:this.name,note:this.note,headerColor:this.headerColor,fields:this.fields,indexes:this.indexes}}normalize(e){e.tablePartials[this.id]={id:this.id,...this.shallowExport()}}};exports.default=r;
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.cjs"),t=require("../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.cjs"),n=require("./element.cjs");t.init_lodash();var r=class extends n.default{constructor({name:t,note:n,fields:r=[],indexes:i=[],checks:a=[],token:o,headerColor:s,noteToken:c=null,dbState:l}={}){super(o),this.name=t,this.note=n?e.default(n,`value`,n):null,this.noteToken=n?e.default(n,`token`,c):null,this.headerColor=s,this.fields=r,this.indexes=i,this.checks=a,this.dbState=l,this.generateId()}generateId(){this.id=this.dbState.generateId(`tablePartialId`)}export(){return{...this.shallowExport()}}shallowExport(){return{name:this.name,note:this.note,headerColor:this.headerColor,fields:this.fields,indexes:this.indexes}}normalize(e){e.tablePartials[this.id]={id:this.id,...this.shallowExport()}}};exports.default=r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import e from "../node_modules/lodash-es/get.mjs";
|
|
2
|
-
import { init_lodash as t } from "../node_modules/lodash-es/lodash.mjs";
|
|
1
|
+
import e from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.mjs";
|
|
2
|
+
import { init_lodash as t } from "../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/lodash.mjs";
|
|
3
3
|
import n from "./element.mjs";
|
|
4
4
|
//#region src/model_structure/tablePartial.js
|
|
5
5
|
t();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../../../../_virtual/_rolldown/runtime.cjs"),t=require("./_root.cjs"),n=require("./_getNative.cjs");var r,i=e.__esmMin((()=>{n.init__getNative(),t.init__root(),r=n.default(t.default,`DataView`)}));i(),exports.default=r,Object.defineProperty(exports,"init__DataView",{enumerable:!0,get:function(){return i}});
|
package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_DataView.mjs
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __esmMin as e } from "
|
|
1
|
+
import { __esmMin as e } from "../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import t, { init__root as n } from "./_root.mjs";
|
|
3
3
|
import r, { init__getNative as i } from "./_getNative.mjs";
|
|
4
|
-
//#region
|
|
4
|
+
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js
|
|
5
5
|
var a, o = e((() => {
|
|
6
6
|
i(), n(), a = r(t, "DataView");
|
|
7
7
|
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../../../../_virtual/_rolldown/runtime.cjs"),t=require("./_hashClear.cjs"),n=require("./_hashDelete.cjs"),r=require("./_hashGet.cjs"),i=require("./_hashHas.cjs"),a=require("./_hashSet.cjs");function o(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var s=e.__esmMin((()=>{t.init__hashClear(),n.init__hashDelete(),r.init__hashGet(),i.init__hashHas(),a.init__hashSet(),o.prototype.clear=t.default,o.prototype.delete=n.default,o.prototype.get=r.default,o.prototype.has=i.default,o.prototype.set=a.default}));s(),exports.default=o,Object.defineProperty(exports,"init__Hash",{enumerable:!0,get:function(){return s}});
|
package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_Hash.mjs
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { __esmMin as e } from "
|
|
1
|
+
import { __esmMin as e } from "../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import t, { init__hashClear as n } from "./_hashClear.mjs";
|
|
3
3
|
import r, { init__hashDelete as i } from "./_hashDelete.mjs";
|
|
4
4
|
import a, { init__hashGet as o } from "./_hashGet.mjs";
|
|
5
5
|
import s, { init__hashHas as c } from "./_hashHas.mjs";
|
|
6
6
|
import l, { init__hashSet as u } from "./_hashSet.mjs";
|
|
7
|
-
//#region
|
|
7
|
+
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js
|
|
8
8
|
function d(e) {
|
|
9
9
|
var t = -1, n = e == null ? 0 : e.length;
|
|
10
10
|
for (this.clear(); ++t < n;) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../../../../_virtual/_rolldown/runtime.cjs"),t=require("./_listCacheClear.cjs"),n=require("./_listCacheDelete.cjs"),r=require("./_listCacheGet.cjs"),i=require("./_listCacheHas.cjs"),a=require("./_listCacheSet.cjs");function o(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var s=e.__esmMin((()=>{t.init__listCacheClear(),n.init__listCacheDelete(),r.init__listCacheGet(),i.init__listCacheHas(),a.init__listCacheSet(),o.prototype.clear=t.default,o.prototype.delete=n.default,o.prototype.get=r.default,o.prototype.has=i.default,o.prototype.set=a.default}));s(),exports.default=o,Object.defineProperty(exports,"init__ListCache",{enumerable:!0,get:function(){return s}});
|
package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_ListCache.mjs
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { __esmMin as e } from "
|
|
1
|
+
import { __esmMin as e } from "../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import t, { init__listCacheClear as n } from "./_listCacheClear.mjs";
|
|
3
3
|
import r, { init__listCacheDelete as i } from "./_listCacheDelete.mjs";
|
|
4
4
|
import a, { init__listCacheGet as o } from "./_listCacheGet.mjs";
|
|
5
5
|
import s, { init__listCacheHas as c } from "./_listCacheHas.mjs";
|
|
6
6
|
import l, { init__listCacheSet as u } from "./_listCacheSet.mjs";
|
|
7
|
-
//#region
|
|
7
|
+
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js
|
|
8
8
|
function d(e) {
|
|
9
9
|
var t = -1, n = e == null ? 0 : e.length;
|
|
10
10
|
for (this.clear(); ++t < n;) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../../../../_virtual/_rolldown/runtime.cjs"),t=require("./_root.cjs"),n=require("./_getNative.cjs");var r,i=e.__esmMin((()=>{n.init__getNative(),t.init__root(),r=n.default(t.default,`Map`)}));i(),exports.default=r,Object.defineProperty(exports,"init__Map",{enumerable:!0,get:function(){return i}});
|
package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_Map.mjs
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __esmMin as e } from "
|
|
1
|
+
import { __esmMin as e } from "../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import t, { init__root as n } from "./_root.mjs";
|
|
3
3
|
import r, { init__getNative as i } from "./_getNative.mjs";
|
|
4
|
-
//#region
|
|
4
|
+
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Map.js
|
|
5
5
|
var a, o = e((() => {
|
|
6
6
|
i(), n(), a = r(t, "Map");
|
|
7
7
|
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../../../../_virtual/_rolldown/runtime.cjs"),t=require("./_mapCacheClear.cjs"),n=require("./_mapCacheDelete.cjs"),r=require("./_mapCacheGet.cjs"),i=require("./_mapCacheHas.cjs"),a=require("./_mapCacheSet.cjs");function o(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var s=e.__esmMin((()=>{t.init__mapCacheClear(),n.init__mapCacheDelete(),r.init__mapCacheGet(),i.init__mapCacheHas(),a.init__mapCacheSet(),o.prototype.clear=t.default,o.prototype.delete=n.default,o.prototype.get=r.default,o.prototype.has=i.default,o.prototype.set=a.default}));s(),exports.default=o,Object.defineProperty(exports,"init__MapCache",{enumerable:!0,get:function(){return s}});
|
package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_MapCache.mjs
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { __esmMin as e } from "
|
|
1
|
+
import { __esmMin as e } from "../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import t, { init__mapCacheClear as n } from "./_mapCacheClear.mjs";
|
|
3
3
|
import r, { init__mapCacheDelete as i } from "./_mapCacheDelete.mjs";
|
|
4
4
|
import a, { init__mapCacheGet as o } from "./_mapCacheGet.mjs";
|
|
5
5
|
import s, { init__mapCacheHas as c } from "./_mapCacheHas.mjs";
|
|
6
6
|
import l, { init__mapCacheSet as u } from "./_mapCacheSet.mjs";
|
|
7
|
-
//#region
|
|
7
|
+
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js
|
|
8
8
|
function d(e) {
|
|
9
9
|
var t = -1, n = e == null ? 0 : e.length;
|
|
10
10
|
for (this.clear(); ++t < n;) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../../../../_virtual/_rolldown/runtime.cjs"),t=require("./_root.cjs"),n=require("./_getNative.cjs");var r,i=e.__esmMin((()=>{n.init__getNative(),t.init__root(),r=n.default(t.default,`Promise`)}));i(),exports.default=r,Object.defineProperty(exports,"init__Promise",{enumerable:!0,get:function(){return i}});
|
package/lib/node_modules/{lodash-es → .pnpm/lodash-es@4.18.1/node_modules/lodash-es}/_Promise.mjs
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __esmMin as e } from "
|
|
1
|
+
import { __esmMin as e } from "../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import t, { init__root as n } from "./_root.mjs";
|
|
3
3
|
import r, { init__getNative as i } from "./_getNative.mjs";
|
|
4
|
-
//#region
|
|
4
|
+
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js
|
|
5
5
|
var a, o = e((() => {
|
|
6
6
|
i(), n(), a = r(t, "Promise");
|
|
7
7
|
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../../../../_virtual/_rolldown/runtime.cjs"),t=require("./_root.cjs"),n=require("./_getNative.cjs");var r,i=e.__esmMin((()=>{n.init__getNative(),t.init__root(),r=n.default(t.default,`Set`)}));i(),exports.default=r,Object.defineProperty(exports,"init__Set",{enumerable:!0,get:function(){return i}});
|