@dbml/core 10.3.0-alpha.0 → 10.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/export/DbmlExporter.cjs +13 -13
- package/lib/export/DbmlExporter.mjs +88 -84
- package/lib/export/MysqlExporter.cjs +8 -8
- package/lib/export/MysqlExporter.mjs +54 -50
- package/lib/export/OracleExporter.cjs +7 -7
- package/lib/export/OracleExporter.mjs +79 -74
- package/lib/export/PostgresExporter.cjs +9 -9
- package/lib/export/PostgresExporter.mjs +82 -78
- package/lib/export/SqlServerExporter.cjs +11 -11
- package/lib/export/SqlServerExporter.mjs +64 -60
- package/lib/model_structure/database.cjs +1 -1
- package/lib/model_structure/database.mjs +56 -53
- package/lib/model_structure/dep.cjs +1 -1
- package/lib/model_structure/dep.mjs +11 -9
- package/lib/model_structure/enum.cjs +1 -1
- package/lib/model_structure/enum.mjs +15 -13
- package/lib/model_structure/enumValue.cjs +1 -1
- package/lib/model_structure/enumValue.mjs +8 -6
- package/lib/model_structure/field.cjs +1 -1
- package/lib/model_structure/field.mjs +10 -8
- package/lib/model_structure/schema.cjs +1 -1
- package/lib/model_structure/schema.mjs +25 -23
- package/lib/model_structure/table.cjs +1 -1
- package/lib/model_structure/table.mjs +43 -40
- package/lib/model_structure/tableGroup.cjs +1 -1
- package/lib/model_structure/tableGroup.mjs +11 -9
- package/lib/model_structure/tablePartial.cjs +1 -1
- package/lib/model_structure/tablePartial.mjs +8 -6
- package/lib/node_modules/lodash-es/_DataView.cjs +1 -0
- package/lib/node_modules/lodash-es/_DataView.mjs +10 -0
- package/lib/node_modules/lodash-es/_Hash.cjs +1 -0
- package/lib/node_modules/lodash-es/_Hash.mjs +20 -0
- package/lib/node_modules/lodash-es/_ListCache.cjs +1 -0
- package/lib/node_modules/lodash-es/_ListCache.mjs +20 -0
- package/lib/node_modules/lodash-es/_Map.cjs +1 -0
- package/lib/node_modules/lodash-es/_Map.mjs +10 -0
- package/lib/node_modules/lodash-es/_MapCache.cjs +1 -0
- package/lib/node_modules/lodash-es/_MapCache.mjs +20 -0
- package/lib/node_modules/lodash-es/_Promise.cjs +1 -0
- package/lib/node_modules/lodash-es/_Promise.mjs +10 -0
- package/lib/node_modules/lodash-es/_Set.cjs +1 -0
- package/lib/node_modules/lodash-es/_Set.mjs +10 -0
- package/lib/node_modules/lodash-es/_SetCache.cjs +1 -0
- package/lib/node_modules/lodash-es/_SetCache.mjs +15 -0
- package/lib/node_modules/lodash-es/_Stack.cjs +1 -0
- package/lib/node_modules/lodash-es/_Stack.mjs +18 -0
- package/lib/node_modules/lodash-es/_Symbol.cjs +1 -0
- package/lib/node_modules/lodash-es/_Symbol.mjs +9 -0
- package/lib/node_modules/lodash-es/_Uint8Array.cjs +1 -0
- package/lib/node_modules/lodash-es/_Uint8Array.mjs +9 -0
- package/lib/node_modules/lodash-es/_WeakMap.cjs +1 -0
- package/lib/node_modules/lodash-es/_WeakMap.mjs +10 -0
- package/lib/node_modules/lodash-es/_arrayAggregator.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayAggregator.mjs +13 -0
- package/lib/node_modules/lodash-es/_arrayEach.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayEach.mjs +10 -0
- package/lib/node_modules/lodash-es/_arrayFilter.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayFilter.mjs +13 -0
- package/lib/node_modules/lodash-es/_arrayLikeKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayLikeKeys.mjs +19 -0
- package/lib/node_modules/lodash-es/_arrayMap.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayMap.mjs +10 -0
- package/lib/node_modules/lodash-es/_arrayPush.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayPush.mjs +10 -0
- package/lib/node_modules/lodash-es/_arrayReduce.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayReduce.mjs +11 -0
- package/lib/node_modules/lodash-es/_arraySome.cjs +1 -0
- package/lib/node_modules/lodash-es/_arraySome.mjs +10 -0
- package/lib/node_modules/lodash-es/_asciiToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_asciiToArray.mjs +9 -0
- package/lib/node_modules/lodash-es/_assocIndexOf.cjs +1 -0
- package/lib/node_modules/lodash-es/_assocIndexOf.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseAggregator.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseAggregator.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseAssignValue.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseAssignValue.mjs +17 -0
- package/lib/node_modules/lodash-es/_baseEach.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseEach.mjs +10 -0
- package/lib/node_modules/lodash-es/_baseFlatten.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseFlatten.mjs +18 -0
- package/lib/node_modules/lodash-es/_baseFor.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseFor.mjs +9 -0
- package/lib/node_modules/lodash-es/_baseForOwn.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseForOwn.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseGet.mjs +15 -0
- package/lib/node_modules/lodash-es/_baseGetAllKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseGetAllKeys.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseGetTag.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseGetTag.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseHasIn.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseHasIn.mjs +9 -0
- package/lib/node_modules/lodash-es/_baseIsArguments.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsArguments.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseIsEqual.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsEqual.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseIsEqualDeep.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsEqualDeep.mjs +34 -0
- package/lib/node_modules/lodash-es/_baseIsMatch.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsMatch.mjs +30 -0
- package/lib/node_modules/lodash-es/_baseIsNative.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsNative.mjs +15 -0
- package/lib/node_modules/lodash-es/_baseIsTypedArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsTypedArray.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseIteratee.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIteratee.mjs +16 -0
- package/lib/node_modules/lodash-es/_baseKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseKeys.mjs +16 -0
- package/lib/node_modules/lodash-es/_baseMatches.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseMatches.mjs +17 -0
- package/lib/node_modules/lodash-es/_baseMatchesProperty.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseMatchesProperty.mjs +21 -0
- package/lib/node_modules/lodash-es/_baseNth.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseNth.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseProperty.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseProperty.mjs +11 -0
- package/lib/node_modules/lodash-es/_basePropertyDeep.cjs +1 -0
- package/lib/node_modules/lodash-es/_basePropertyDeep.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseReduce.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseReduce.mjs +11 -0
- package/lib/node_modules/lodash-es/_baseSlice.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseSlice.mjs +12 -0
- package/lib/node_modules/lodash-es/_baseTimes.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseTimes.mjs +10 -0
- package/lib/node_modules/lodash-es/_baseToString.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseToString.mjs +19 -0
- package/lib/node_modules/lodash-es/_baseTrim.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseTrim.mjs +12 -0
- package/lib/node_modules/lodash-es/_baseUnary.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseUnary.mjs +11 -0
- package/lib/node_modules/lodash-es/_cacheHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_cacheHas.mjs +9 -0
- package/lib/node_modules/lodash-es/_castFunction.cjs +1 -0
- package/lib/node_modules/lodash-es/_castFunction.mjs +12 -0
- package/lib/node_modules/lodash-es/_castPath.cjs +1 -0
- package/lib/node_modules/lodash-es/_castPath.mjs +15 -0
- package/lib/node_modules/lodash-es/_castSlice.cjs +1 -0
- package/lib/node_modules/lodash-es/_castSlice.mjs +13 -0
- package/lib/node_modules/lodash-es/_copyArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_copyArray.mjs +11 -0
- package/lib/node_modules/lodash-es/_coreJsData.cjs +1 -0
- package/lib/node_modules/lodash-es/_coreJsData.mjs +9 -0
- package/lib/node_modules/lodash-es/_createAggregator.cjs +1 -0
- package/lib/node_modules/lodash-es/_createAggregator.mjs +18 -0
- package/lib/node_modules/lodash-es/_createBaseEach.cjs +1 -0
- package/lib/node_modules/lodash-es/_createBaseEach.mjs +17 -0
- package/lib/node_modules/lodash-es/_createBaseFor.cjs +1 -0
- package/lib/node_modules/lodash-es/_createBaseFor.mjs +15 -0
- package/lib/node_modules/lodash-es/_createCaseFirst.cjs +1 -0
- package/lib/node_modules/lodash-es/_createCaseFirst.mjs +19 -0
- package/lib/node_modules/lodash-es/_defineProperty.cjs +1 -0
- package/lib/node_modules/lodash-es/_defineProperty.mjs +14 -0
- package/lib/node_modules/lodash-es/_equalArrays.cjs +1 -0
- package/lib/node_modules/lodash-es/_equalArrays.mjs +39 -0
- package/lib/node_modules/lodash-es/_equalByTag.cjs +1 -0
- package/lib/node_modules/lodash-es/_equalByTag.mjs +39 -0
- package/lib/node_modules/lodash-es/_equalObjects.cjs +1 -0
- package/lib/node_modules/lodash-es/_equalObjects.mjs +36 -0
- package/lib/node_modules/lodash-es/_freeGlobal.cjs +1 -0
- package/lib/node_modules/lodash-es/_freeGlobal.mjs +8 -0
- package/lib/node_modules/lodash-es/_getAllKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_getAllKeys.mjs +14 -0
- package/lib/node_modules/lodash-es/_getMapData.cjs +1 -0
- package/lib/node_modules/lodash-es/_getMapData.mjs +13 -0
- package/lib/node_modules/lodash-es/_getMatchData.cjs +1 -0
- package/lib/node_modules/lodash-es/_getMatchData.mjs +21 -0
- package/lib/node_modules/lodash-es/_getNative.cjs +1 -0
- package/lib/node_modules/lodash-es/_getNative.mjs +14 -0
- package/lib/node_modules/lodash-es/_getRawTag.cjs +1 -0
- package/lib/node_modules/lodash-es/_getRawTag.mjs +18 -0
- package/lib/node_modules/lodash-es/_getSymbols.cjs +1 -0
- package/lib/node_modules/lodash-es/_getSymbols.mjs +14 -0
- package/lib/node_modules/lodash-es/_getTag.cjs +1 -0
- package/lib/node_modules/lodash-es/_getTag.mjs +25 -0
- package/lib/node_modules/lodash-es/_getValue.cjs +1 -0
- package/lib/node_modules/lodash-es/_getValue.mjs +9 -0
- package/lib/node_modules/lodash-es/_hasPath.cjs +1 -0
- package/lib/node_modules/lodash-es/_hasPath.mjs +23 -0
- package/lib/node_modules/lodash-es/_hasUnicode.cjs +1 -0
- package/lib/node_modules/lodash-es/_hasUnicode.mjs +11 -0
- package/lib/node_modules/lodash-es/_hashClear.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashClear.mjs +12 -0
- package/lib/node_modules/lodash-es/_hashDelete.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashDelete.mjs +10 -0
- package/lib/node_modules/lodash-es/_hashGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashGet.mjs +17 -0
- package/lib/node_modules/lodash-es/_hashHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashHas.mjs +13 -0
- package/lib/node_modules/lodash-es/_hashSet.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashSet.mjs +13 -0
- package/lib/node_modules/lodash-es/_isFlattenable.cjs +1 -0
- package/lib/node_modules/lodash-es/_isFlattenable.mjs +14 -0
- package/lib/node_modules/lodash-es/_isIndex.cjs +1 -0
- package/lib/node_modules/lodash-es/_isIndex.mjs +12 -0
- package/lib/node_modules/lodash-es/_isKey.cjs +1 -0
- package/lib/node_modules/lodash-es/_isKey.mjs +15 -0
- package/lib/node_modules/lodash-es/_isKeyable.cjs +1 -0
- package/lib/node_modules/lodash-es/_isKeyable.mjs +10 -0
- package/lib/node_modules/lodash-es/_isMasked.cjs +1 -0
- package/lib/node_modules/lodash-es/_isMasked.mjs +15 -0
- package/lib/node_modules/lodash-es/_isPrototype.cjs +1 -0
- package/lib/node_modules/lodash-es/_isPrototype.mjs +12 -0
- package/lib/node_modules/lodash-es/_isStrictComparable.cjs +1 -0
- package/lib/node_modules/lodash-es/_isStrictComparable.mjs +12 -0
- package/lib/node_modules/lodash-es/_listCacheClear.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheClear.mjs +9 -0
- package/lib/node_modules/lodash-es/_listCacheDelete.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheDelete.mjs +13 -0
- package/lib/node_modules/lodash-es/_listCacheGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheGet.mjs +13 -0
- package/lib/node_modules/lodash-es/_listCacheHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheHas.mjs +12 -0
- package/lib/node_modules/lodash-es/_listCacheSet.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheSet.mjs +13 -0
- package/lib/node_modules/lodash-es/_mapCacheClear.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheClear.mjs +18 -0
- package/lib/node_modules/lodash-es/_mapCacheDelete.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheDelete.mjs +13 -0
- package/lib/node_modules/lodash-es/_mapCacheGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheGet.mjs +12 -0
- package/lib/node_modules/lodash-es/_mapCacheHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheHas.mjs +12 -0
- package/lib/node_modules/lodash-es/_mapCacheSet.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheSet.mjs +13 -0
- package/lib/node_modules/lodash-es/_mapToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapToArray.mjs +12 -0
- package/lib/node_modules/lodash-es/_matchesStrictComparable.cjs +1 -0
- package/lib/node_modules/lodash-es/_matchesStrictComparable.mjs +11 -0
- package/lib/node_modules/lodash-es/_memoizeCapped.cjs +1 -0
- package/lib/node_modules/lodash-es/_memoizeCapped.mjs +15 -0
- package/lib/node_modules/lodash-es/_nativeCreate.cjs +1 -0
- package/lib/node_modules/lodash-es/_nativeCreate.mjs +9 -0
- package/lib/node_modules/lodash-es/_nativeKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_nativeKeys.mjs +9 -0
- package/lib/node_modules/lodash-es/_nodeUtil.cjs +1 -0
- package/lib/node_modules/lodash-es/_nodeUtil.mjs +13 -0
- package/lib/node_modules/lodash-es/_objectToString.cjs +1 -0
- package/lib/node_modules/lodash-es/_objectToString.mjs +11 -0
- package/lib/node_modules/lodash-es/_overArg.cjs +1 -0
- package/lib/node_modules/lodash-es/_overArg.mjs +11 -0
- package/lib/node_modules/lodash-es/_root.cjs +1 -0
- package/lib/node_modules/lodash-es/_root.mjs +9 -0
- package/lib/node_modules/lodash-es/_setCacheAdd.cjs +1 -0
- package/lib/node_modules/lodash-es/_setCacheAdd.mjs +11 -0
- package/lib/node_modules/lodash-es/_setCacheHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_setCacheHas.mjs +9 -0
- package/lib/node_modules/lodash-es/_setToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_setToArray.mjs +12 -0
- package/lib/node_modules/lodash-es/_stackClear.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackClear.mjs +12 -0
- package/lib/node_modules/lodash-es/_stackDelete.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackDelete.mjs +10 -0
- package/lib/node_modules/lodash-es/_stackGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackGet.mjs +9 -0
- package/lib/node_modules/lodash-es/_stackHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackHas.mjs +9 -0
- package/lib/node_modules/lodash-es/_stackSet.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackSet.mjs +20 -0
- package/lib/node_modules/lodash-es/_stringToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_stringToArray.mjs +14 -0
- package/lib/node_modules/lodash-es/_stringToPath.cjs +1 -0
- package/lib/node_modules/lodash-es/_stringToPath.mjs +14 -0
- package/lib/node_modules/lodash-es/_toKey.cjs +1 -0
- package/lib/node_modules/lodash-es/_toKey.mjs +14 -0
- package/lib/node_modules/lodash-es/_toSource.cjs +1 -0
- package/lib/node_modules/lodash-es/_toSource.mjs +19 -0
- package/lib/node_modules/lodash-es/_trimmedEndIndex.cjs +1 -0
- package/lib/node_modules/lodash-es/_trimmedEndIndex.mjs +12 -0
- package/lib/node_modules/lodash-es/_unicodeToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_unicodeToArray.mjs +21 -0
- package/lib/node_modules/lodash-es/capitalize.cjs +1 -0
- package/lib/node_modules/lodash-es/capitalize.mjs +13 -0
- package/lib/node_modules/lodash-es/concat.cjs +1 -0
- package/lib/node_modules/lodash-es/concat.mjs +18 -0
- package/lib/node_modules/lodash-es/eq.cjs +1 -0
- package/lib/node_modules/lodash-es/eq.mjs +9 -0
- package/lib/node_modules/lodash-es/first.cjs +1 -0
- package/lib/node_modules/lodash-es/first.mjs +9 -0
- package/lib/node_modules/lodash-es/flatten.cjs +1 -0
- package/lib/node_modules/lodash-es/flatten.mjs +12 -0
- package/lib/node_modules/lodash-es/flattenDeep.cjs +1 -0
- package/lib/node_modules/lodash-es/flattenDeep.mjs +12 -0
- package/lib/node_modules/lodash-es/flattenDepth.cjs +1 -0
- package/lib/node_modules/lodash-es/flattenDepth.mjs +13 -0
- package/lib/node_modules/lodash-es/forEach.cjs +1 -0
- package/lib/node_modules/lodash-es/forEach.mjs +15 -0
- package/lib/node_modules/lodash-es/get.cjs +1 -0
- package/lib/node_modules/lodash-es/get.mjs +13 -0
- package/lib/node_modules/lodash-es/groupBy.cjs +1 -0
- package/lib/node_modules/lodash-es/groupBy.mjs +12 -0
- package/lib/node_modules/lodash-es/hasIn.cjs +1 -0
- package/lib/node_modules/lodash-es/hasIn.mjs +13 -0
- package/lib/node_modules/lodash-es/head.cjs +1 -0
- package/lib/node_modules/lodash-es/head.mjs +9 -0
- package/lib/node_modules/lodash-es/identity.cjs +1 -0
- package/lib/node_modules/lodash-es/identity.mjs +9 -0
- package/lib/node_modules/lodash-es/isArguments.cjs +1 -0
- package/lib/node_modules/lodash-es/isArguments.mjs +14 -0
- package/lib/node_modules/lodash-es/isArray.cjs +1 -0
- package/lib/node_modules/lodash-es/isArray.mjs +8 -0
- package/lib/node_modules/lodash-es/isArrayLike.cjs +1 -0
- package/lib/node_modules/lodash-es/isArrayLike.mjs +13 -0
- package/lib/node_modules/lodash-es/isBuffer.cjs +1 -0
- package/lib/node_modules/lodash-es/isBuffer.mjs +10 -0
- package/lib/node_modules/lodash-es/isEmpty.cjs +1 -0
- package/lib/node_modules/lodash-es/isEmpty.mjs +25 -0
- package/lib/node_modules/lodash-es/isFunction.cjs +1 -0
- package/lib/node_modules/lodash-es/isFunction.mjs +15 -0
- package/lib/node_modules/lodash-es/isLength.cjs +1 -0
- package/lib/node_modules/lodash-es/isLength.mjs +11 -0
- package/lib/node_modules/lodash-es/isNil.cjs +1 -0
- package/lib/node_modules/lodash-es/isNil.mjs +9 -0
- package/lib/node_modules/lodash-es/isObject.cjs +1 -0
- package/lib/node_modules/lodash-es/isObject.mjs +10 -0
- package/lib/node_modules/lodash-es/isObjectLike.cjs +1 -0
- package/lib/node_modules/lodash-es/isObjectLike.mjs +9 -0
- package/lib/node_modules/lodash-es/isSymbol.cjs +1 -0
- package/lib/node_modules/lodash-es/isSymbol.mjs +13 -0
- package/lib/node_modules/lodash-es/isTypedArray.cjs +1 -0
- package/lib/node_modules/lodash-es/isTypedArray.mjs +11 -0
- package/lib/node_modules/lodash-es/keys.cjs +1 -0
- package/lib/node_modules/lodash-es/keys.mjs +14 -0
- package/lib/node_modules/lodash-es/last.cjs +1 -0
- package/lib/node_modules/lodash-es/last.mjs +10 -0
- package/lib/node_modules/lodash-es/lodash.cjs +1 -0
- package/lib/node_modules/lodash-es/lodash.mjs +46 -0
- package/lib/node_modules/lodash-es/memoize.cjs +1 -0
- package/lib/node_modules/lodash-es/memoize.mjs +19 -0
- package/lib/node_modules/lodash-es/nth.cjs +1 -0
- package/lib/node_modules/lodash-es/nth.mjs +13 -0
- package/lib/node_modules/lodash-es/property.cjs +1 -0
- package/lib/node_modules/lodash-es/property.mjs +15 -0
- package/lib/node_modules/lodash-es/reduce.cjs +1 -0
- package/lib/node_modules/lodash-es/reduce.mjs +17 -0
- package/lib/node_modules/lodash-es/stubArray.cjs +1 -0
- package/lib/node_modules/lodash-es/stubArray.mjs +9 -0
- package/lib/node_modules/lodash-es/stubFalse.cjs +1 -0
- package/lib/node_modules/lodash-es/stubFalse.mjs +9 -0
- package/lib/node_modules/lodash-es/toFinite.cjs +1 -0
- package/lib/node_modules/lodash-es/toFinite.mjs +12 -0
- package/lib/node_modules/lodash-es/toInteger.cjs +1 -0
- package/lib/node_modules/lodash-es/toInteger.mjs +13 -0
- package/lib/node_modules/lodash-es/toNumber.cjs +1 -0
- package/lib/node_modules/lodash-es/toNumber.mjs +23 -0
- package/lib/node_modules/lodash-es/toString.cjs +1 -0
- package/lib/node_modules/lodash-es/toString.mjs +12 -0
- package/lib/node_modules/lodash-es/upperFirst.cjs +1 -0
- package/lib/node_modules/lodash-es/upperFirst.mjs +9 -0
- package/lib/packages/dbml-core/package.json.cjs +1 -0
- package/lib/{package.json.mjs → packages/dbml-core/package.json.mjs} +1 -1
- package/lib/parse/ANTLR/ASTGeneration/helpers.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/helpers.mjs +5 -3
- package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.mjs +149 -143
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.mjs +146 -142
- package/lib/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.mjs +184 -181
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.mjs +149 -145
- package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.mjs +89 -85
- package/lib/parse/deprecated/mssql/column_definition/actions.cjs +1 -1
- package/lib/parse/deprecated/mssql/column_definition/actions.mjs +9 -6
- package/lib/parse/deprecated/mssql/expression.cjs +1 -1
- package/lib/parse/deprecated/mssql/expression.mjs +26 -25
- package/lib/parse/deprecated/mssql/statements/actions.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/actions.mjs +36 -33
- package/lib/parse/deprecated/mssql/utils.cjs +1 -1
- package/lib/parse/deprecated/mssql/utils.mjs +23 -22
- package/lib/utils/version.cjs +1 -1
- package/lib/utils/version.mjs +1 -1
- package/package.json +2 -2
- package/lib/package.json.cjs +0 -1
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
1
|
+
import e from "../../../../node_modules/lodash-es/flatten.mjs";
|
|
2
|
+
import t from "../../../../node_modules/lodash-es/flattenDepth.mjs";
|
|
3
|
+
import n from "../../../../node_modules/lodash-es/isEmpty.mjs";
|
|
4
|
+
import { init_lodash as r } from "../../../../node_modules/lodash-es/lodash.mjs";
|
|
5
|
+
import i from "../../parsers/snowflake/SnowflakeParserVisitor.mjs";
|
|
6
|
+
import { Enum as a, Field as o, Index as s, Table as c, TableRecord as l } from "../AST.mjs";
|
|
7
|
+
import { COLUMN_CONSTRAINT_KIND as u, CONSTRAINT_TYPE as d, TABLE_CONSTRAINT_KIND as f } from "../constants.mjs";
|
|
8
|
+
import { getOriginalText as p } from "../helpers.mjs";
|
|
9
|
+
import { CARDINALITY_MANY as m, CARDINALITY_MAYBE as h } from "@dbml/parse";
|
|
7
10
|
//#region src/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.js
|
|
8
|
-
|
|
11
|
+
r();
|
|
12
|
+
var g = "public", _ = (e) => p(e).replace(/''/g, "'").slice(1, -1), v = class extends i {
|
|
9
13
|
constructor() {
|
|
10
14
|
super(), this.data = {
|
|
11
15
|
schemas: [],
|
|
@@ -19,8 +23,8 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
19
23
|
};
|
|
20
24
|
}
|
|
21
25
|
findTable(e, t) {
|
|
22
|
-
let n = e ||
|
|
23
|
-
return this.data.tables.find((e) => (e.schemaName ||
|
|
26
|
+
let n = e || g;
|
|
27
|
+
return this.data.tables.find((e) => (e.schemaName || g) === n && e.name === t);
|
|
24
28
|
}
|
|
25
29
|
visitSnowflake_file(e) {
|
|
26
30
|
return e.batch()?.accept(this), this.data;
|
|
@@ -44,27 +48,27 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
44
48
|
let t = e.create_table().accept(this);
|
|
45
49
|
this.data.tables.push(t);
|
|
46
50
|
} else if (e.create_table_like()) {
|
|
47
|
-
let [t, n, r,
|
|
48
|
-
if (
|
|
49
|
-
let e = new
|
|
51
|
+
let [t, n, r, i] = e.create_table_like().accept(this), a = this.data.tables.reduce((e, t) => t.name === i && t.schemaName === r ? t : e, null);
|
|
52
|
+
if (a) {
|
|
53
|
+
let e = new c({
|
|
50
54
|
name: n,
|
|
51
55
|
schemaName: t,
|
|
52
|
-
fields:
|
|
56
|
+
fields: a.fields
|
|
53
57
|
});
|
|
54
58
|
this.data.tables.push(e);
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
62
|
visitCreate_database(e) {
|
|
59
|
-
let t =
|
|
63
|
+
let t = p(e.object_name());
|
|
60
64
|
this.data.schemas.push(t);
|
|
61
65
|
}
|
|
62
|
-
visitCreate_table(
|
|
63
|
-
let [n, r,
|
|
64
|
-
if (t.kind ===
|
|
65
|
-
else if (t.kind ===
|
|
66
|
-
else if (t.kind ===
|
|
67
|
-
else if (t.kind ===
|
|
66
|
+
visitCreate_table(t) {
|
|
67
|
+
let [n, r, i] = t.object_name().accept(this), { definitions: o, tableNote: s } = t.create_table_clause().accept(this), l = t.comment_clause()?.accept(this) || s, [u, d, p, m] = o.reduce((e, t) => {
|
|
68
|
+
if (t.kind === f.FIELD) e[0].push(t.value);
|
|
69
|
+
else if (t.kind === f.UNIQUE) e[1].push(t.value);
|
|
70
|
+
else if (t.kind === f.FK) e[2].push(t.value);
|
|
71
|
+
else if (t.kind === f.PK) {
|
|
68
72
|
let n = t.value;
|
|
69
73
|
n.columns.length > 1 ? e[1].push(t.value) : e[3] = n;
|
|
70
74
|
}
|
|
@@ -74,26 +78,26 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
74
78
|
[],
|
|
75
79
|
[],
|
|
76
80
|
null
|
|
77
|
-
]), h =
|
|
78
|
-
let { field:
|
|
79
|
-
if (
|
|
80
|
-
let e =
|
|
81
|
-
name: `${
|
|
81
|
+
]), h = u.map((e) => {
|
|
82
|
+
let { field: t, inlineRefs: n } = e;
|
|
83
|
+
if (t.type.type_name?.toLowerCase() === "enum") {
|
|
84
|
+
let e = t.type.args.map((e) => ({ name: e.replace(/'|"|`/g, "").trim() })), n = new a({
|
|
85
|
+
name: `${i}_${t.name}_enum`,
|
|
82
86
|
schemaName: r,
|
|
83
87
|
values: e
|
|
84
88
|
});
|
|
85
|
-
|
|
89
|
+
t.type.type_name = n.name, t.type.schemaName = n.schemaName, this.data.enums.push(n);
|
|
86
90
|
}
|
|
87
|
-
return
|
|
88
|
-
e.endpoints[0].tableName =
|
|
89
|
-
}),
|
|
91
|
+
return n.forEach((e) => {
|
|
92
|
+
e.endpoints[0].tableName = i, e.endpoints[0].schemaName = r, e.endpoints[0].fieldNames = [t.name];
|
|
93
|
+
}), n;
|
|
90
94
|
});
|
|
91
|
-
this.data.refs.push(...
|
|
92
|
-
let g = new
|
|
93
|
-
name:
|
|
95
|
+
this.data.refs.push(...e(h)), this.data.refs.push(...p.map((e) => (e.endpoints[0].tableName = i, e.endpoints[0].schemaName = r, e)));
|
|
96
|
+
let g = new c({
|
|
97
|
+
name: i,
|
|
94
98
|
schemaName: r,
|
|
95
|
-
fields:
|
|
96
|
-
indexes:
|
|
99
|
+
fields: u.map((e) => e.field),
|
|
100
|
+
indexes: d,
|
|
97
101
|
note: l
|
|
98
102
|
});
|
|
99
103
|
if (m) {
|
|
@@ -107,7 +111,7 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
107
111
|
let [t, n, r] = e.object_name()[0].accept(this), i = e.constraint_action().accept(this);
|
|
108
112
|
if (i) {
|
|
109
113
|
let e = [], t = [], a = [];
|
|
110
|
-
i.kind ===
|
|
114
|
+
i.kind === f.FIELD ? e.push(i.value) : i.kind === f.UNIQUE ? t.push(i.value) : i.kind === f.FK && a.push(i.value), this.data.refs.push(...a.map((e) => (e.endpoints[0].tableName = r, e.endpoints[0].schemaName = n, e)));
|
|
111
115
|
let o = this.data.tables.reduce((e, t) => t.name === r && t.schemaName === n ? t : e, null);
|
|
112
116
|
return o && (o.fields.push(...e), o.indexes.push(...t)), o;
|
|
113
117
|
}
|
|
@@ -131,7 +135,7 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
131
135
|
];
|
|
132
136
|
}
|
|
133
137
|
visitId_(e) {
|
|
134
|
-
return e.DOUBLE_QUOTE_ID() ?
|
|
138
|
+
return e.DOUBLE_QUOTE_ID() ? p(e).slice(1, -1) : p(e);
|
|
135
139
|
}
|
|
136
140
|
visitCreate_table_clause(e) {
|
|
137
141
|
return {
|
|
@@ -140,7 +144,7 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
140
144
|
};
|
|
141
145
|
}
|
|
142
146
|
visitComment_clause(e) {
|
|
143
|
-
return
|
|
147
|
+
return _(e.string());
|
|
144
148
|
}
|
|
145
149
|
visitColumn_decl_item_list_paren(e) {
|
|
146
150
|
return e.column_decl_item_list().accept(this);
|
|
@@ -150,36 +154,36 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
150
154
|
}
|
|
151
155
|
visitColumn_decl_item(e) {
|
|
152
156
|
return e.full_col_decl() ? {
|
|
153
|
-
kind:
|
|
157
|
+
kind: f.FIELD,
|
|
154
158
|
value: e.full_col_decl().accept(this)
|
|
155
159
|
} : e.out_of_line_constraint() ? e.out_of_line_constraint().accept(this) : null;
|
|
156
160
|
}
|
|
157
161
|
visitFull_col_decl(e) {
|
|
158
|
-
let t = e.col_decl().accept(this),
|
|
162
|
+
let t = e.col_decl().accept(this), r = [];
|
|
159
163
|
if (e.inline_constraint()) {
|
|
160
|
-
let
|
|
161
|
-
|
|
162
|
-
e.kind ===
|
|
164
|
+
let i = e.inline_constraint().map((e) => e.accept(this));
|
|
165
|
+
n(i) || i.forEach((e) => {
|
|
166
|
+
e.kind === u.UNIQUE ? t.unique = !0 : e.kind === u.PK ? t.pk = !0 : e.kind === u.FK && r.push(e.value);
|
|
163
167
|
});
|
|
164
168
|
}
|
|
165
169
|
if (e.null_not_null()) {
|
|
166
|
-
let
|
|
167
|
-
|
|
168
|
-
e.kind ===
|
|
170
|
+
let r = e.null_not_null().map((e) => e.accept(this));
|
|
171
|
+
n(r) || r.forEach((e) => {
|
|
172
|
+
e.kind === u.NOT_NULL && (t.not_null = e.value);
|
|
169
173
|
});
|
|
170
174
|
}
|
|
171
175
|
return e.default_value() && e.default_value().map((e) => e.accept(this)).forEach((e) => {
|
|
172
|
-
e.kind ===
|
|
173
|
-
}), e.COMMENT() && (t.note =
|
|
176
|
+
e.kind === u.DEFAULT ? t.dbdefault = e.value : e.kind === u.INCREMENT && (t.increment = e.value);
|
|
177
|
+
}), e.COMMENT() && (t.note = _(e.string())), {
|
|
174
178
|
field: t,
|
|
175
|
-
inlineRefs:
|
|
179
|
+
inlineRefs: r
|
|
176
180
|
};
|
|
177
181
|
}
|
|
178
182
|
visitCol_decl(e) {
|
|
179
|
-
return new
|
|
183
|
+
return new o({
|
|
180
184
|
name: e.column_name().accept(this),
|
|
181
185
|
type: {
|
|
182
|
-
type_name:
|
|
186
|
+
type_name: p(e.data_type()),
|
|
183
187
|
schemaName: null
|
|
184
188
|
}
|
|
185
189
|
});
|
|
@@ -189,27 +193,27 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
189
193
|
}
|
|
190
194
|
visitInline_constraint(e) {
|
|
191
195
|
if (e.UNIQUE()) return {
|
|
192
|
-
kind:
|
|
196
|
+
kind: u.UNIQUE,
|
|
193
197
|
value: !0
|
|
194
198
|
};
|
|
195
199
|
if (e.primary_key()) return {
|
|
196
|
-
kind:
|
|
200
|
+
kind: u.PK,
|
|
197
201
|
value: !0
|
|
198
202
|
};
|
|
199
203
|
if (e.foreign_key() && e.column_name()) {
|
|
200
204
|
let [t, n, r] = e.object_name().accept(this), i = [e.column_name().accept(this)];
|
|
201
205
|
return {
|
|
202
|
-
kind:
|
|
206
|
+
kind: u.FK,
|
|
203
207
|
value: { endpoints: [{
|
|
204
208
|
tableName: null,
|
|
205
209
|
schemaName: null,
|
|
206
210
|
fieldNames: null,
|
|
207
|
-
relation:
|
|
211
|
+
relation: m
|
|
208
212
|
}, {
|
|
209
213
|
tableName: r,
|
|
210
214
|
schemaName: n,
|
|
211
215
|
fieldNames: i,
|
|
212
|
-
relation:
|
|
216
|
+
relation: h
|
|
213
217
|
}] }
|
|
214
218
|
};
|
|
215
219
|
}
|
|
@@ -218,39 +222,39 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
218
222
|
value: null
|
|
219
223
|
};
|
|
220
224
|
}
|
|
221
|
-
visitOut_of_line_constraint(
|
|
222
|
-
if (
|
|
223
|
-
let
|
|
225
|
+
visitOut_of_line_constraint(t) {
|
|
226
|
+
if (t.UNIQUE()) {
|
|
227
|
+
let n = t.id_()?.accept(this), r = new s({
|
|
224
228
|
unique: !0,
|
|
225
|
-
columns:
|
|
229
|
+
columns: e(t.column_list_in_parentheses().map((e) => e.accept(this))).map((e) => ({
|
|
226
230
|
value: e,
|
|
227
|
-
type:
|
|
231
|
+
type: d.COLUMN
|
|
228
232
|
}))
|
|
229
233
|
});
|
|
230
234
|
return {
|
|
231
|
-
name:
|
|
232
|
-
kind:
|
|
233
|
-
value:
|
|
235
|
+
name: n,
|
|
236
|
+
kind: f.UNIQUE,
|
|
237
|
+
value: r
|
|
234
238
|
};
|
|
235
239
|
}
|
|
236
|
-
if (
|
|
237
|
-
let
|
|
238
|
-
name:
|
|
240
|
+
if (t.primary_key()) {
|
|
241
|
+
let n = t.id_()?.accept(this), r = new s({
|
|
242
|
+
name: n,
|
|
239
243
|
pk: !0,
|
|
240
|
-
columns:
|
|
244
|
+
columns: e(t.column_list_in_parentheses().map((e) => e.accept(this))).map((e) => ({
|
|
241
245
|
value: e,
|
|
242
|
-
type:
|
|
246
|
+
type: d.COLUMN
|
|
243
247
|
}))
|
|
244
248
|
});
|
|
245
249
|
return {
|
|
246
|
-
kind:
|
|
247
|
-
value:
|
|
250
|
+
kind: f.PK,
|
|
251
|
+
value: r
|
|
248
252
|
};
|
|
249
253
|
}
|
|
250
|
-
if (
|
|
251
|
-
let [
|
|
254
|
+
if (t.foreign_key() && t.column_list_in_parentheses().length === 2) {
|
|
255
|
+
let [e, n, r] = t.object_name().accept(this), i = t.column_list_in_parentheses()[0].accept(this), a = t.column_list_in_parentheses()[1].accept(this);
|
|
252
256
|
return {
|
|
253
|
-
kind:
|
|
257
|
+
kind: f.FK,
|
|
254
258
|
value: { endpoints: [{
|
|
255
259
|
tableName: null,
|
|
256
260
|
schemaName: null,
|
|
@@ -274,22 +278,22 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
274
278
|
}
|
|
275
279
|
visitNull_not_null(e) {
|
|
276
280
|
return {
|
|
277
|
-
kind:
|
|
281
|
+
kind: u.NOT_NULL,
|
|
278
282
|
value: !!e.NOT()
|
|
279
283
|
};
|
|
280
284
|
}
|
|
281
285
|
visitDefault_value(e) {
|
|
282
286
|
return e.DEFAULT() ? {
|
|
283
|
-
kind:
|
|
287
|
+
kind: u.DEFAULT,
|
|
284
288
|
value: e.expr().accept(this)
|
|
285
289
|
} : e.AUTOINCREMENT() || e.IDENTITY() ? {
|
|
286
|
-
kind:
|
|
290
|
+
kind: u.INCREMENT,
|
|
287
291
|
value: !0
|
|
288
292
|
} : null;
|
|
289
293
|
}
|
|
290
294
|
visitExpr(e) {
|
|
291
295
|
return e.primitive_expression() ? e.primitive_expression().accept(this) : {
|
|
292
|
-
value:
|
|
296
|
+
value: p(e),
|
|
293
297
|
type: "expression"
|
|
294
298
|
};
|
|
295
299
|
}
|
|
@@ -298,22 +302,22 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
298
302
|
value: null,
|
|
299
303
|
type: "boolean"
|
|
300
304
|
} : e.literal() ? e.literal().accept(this) : {
|
|
301
|
-
value:
|
|
305
|
+
value: p(e),
|
|
302
306
|
type: "expression"
|
|
303
307
|
};
|
|
304
308
|
}
|
|
305
309
|
visitLiteral(e) {
|
|
306
310
|
return e.STRING() ? {
|
|
307
|
-
value:
|
|
311
|
+
value: _(e),
|
|
308
312
|
type: "string"
|
|
309
313
|
} : e.DECIMAL() || e.REAL || e.FLOAT ? {
|
|
310
|
-
value:
|
|
314
|
+
value: p(e),
|
|
311
315
|
type: "number"
|
|
312
316
|
} : e.true_false() || e.NULL_() ? {
|
|
313
|
-
value:
|
|
317
|
+
value: p(e),
|
|
314
318
|
type: "boolean"
|
|
315
319
|
} : {
|
|
316
|
-
value:
|
|
320
|
+
value: p(e),
|
|
317
321
|
type: "expression"
|
|
318
322
|
};
|
|
319
323
|
}
|
|
@@ -321,7 +325,7 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
321
325
|
return e.ADD() ? e.out_of_line_constraint().accept(this) : null;
|
|
322
326
|
}
|
|
323
327
|
visitInsert_statement(e) {
|
|
324
|
-
let [t, n, r] = e.object_name().accept(this), i = new
|
|
328
|
+
let [t, n, r] = e.object_name().accept(this), i = new l({
|
|
325
329
|
schemaName: n,
|
|
326
330
|
tableName: r,
|
|
327
331
|
columns: e.column_list_in_parentheses() ? e.column_list_in_parentheses().accept(this) : this.findTable(n, r)?.fields.map((e) => e.name) || [],
|
|
@@ -330,11 +334,11 @@ var h = "public", g = (e) => l(e).replace(/''/g, "'").slice(1, -1), _ = class ex
|
|
|
330
334
|
this.data.records.push(i);
|
|
331
335
|
}
|
|
332
336
|
visitValues_builder(e) {
|
|
333
|
-
return e.expr_list().map((e) =>
|
|
337
|
+
return e.expr_list().map((e) => t(e.accept(this), 1));
|
|
334
338
|
}
|
|
335
339
|
visitExpr_list(e) {
|
|
336
340
|
return e.expr().map((e) => e.accept(this));
|
|
337
341
|
}
|
|
338
342
|
};
|
|
339
343
|
//#endregion
|
|
340
|
-
export {
|
|
344
|
+
export { v as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../../../../_virtual/_rolldown/runtime.cjs")
|
|
1
|
+
const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../node_modules/lodash-es/last.cjs"),n=require("../../../../node_modules/lodash-es/lodash.cjs");function r(e,n){let r=n?n.join(`,`):null;return{type:`type`,value:{type_name:r?`${t.default(e)}(${r})`:t.default(e),schemaName:e.length>1?e[0]:null,args:r}}}function i(e,t,n){let r={};return r[t.type]=t.value,n.forEach(e=>{e&&(r[e.type]=e.value)}),r.name=e[0],r.inline_refs||=[],{type:`fields`,value:r}}var a=e.__esmMin((()=>{n.init_lodash()}));a(),Object.defineProperty(exports,"init_actions",{enumerable:!0,get:function(){return a}}),exports.makeColumn=i,exports.makeDataType=r;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { __esmMin as e } from "../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import
|
|
2
|
+
import t from "../../../../node_modules/lodash-es/last.mjs";
|
|
3
|
+
import { init_lodash as n } from "../../../../node_modules/lodash-es/lodash.mjs";
|
|
3
4
|
//#region src/parse/deprecated/mssql/column_definition/actions.js
|
|
4
|
-
function
|
|
5
|
+
function r(e, n) {
|
|
5
6
|
let r = n ? n.join(",") : null;
|
|
6
7
|
return {
|
|
7
8
|
type: "type",
|
|
@@ -12,7 +13,7 @@ function n(e, n) {
|
|
|
12
13
|
}
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function i(e, t, n) {
|
|
16
17
|
let r = {};
|
|
17
18
|
return r[t.type] = t.value, n.forEach((e) => {
|
|
18
19
|
e && (r[e.type] = e.value);
|
|
@@ -21,7 +22,9 @@ function r(e, t, n) {
|
|
|
21
22
|
value: r
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
|
-
var
|
|
25
|
+
var a = e((() => {
|
|
26
|
+
n();
|
|
27
|
+
}));
|
|
25
28
|
//#endregion
|
|
26
|
-
|
|
27
|
-
export {
|
|
29
|
+
a();
|
|
30
|
+
export { a as init_actions, i as makeColumn, r as makeDataType };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("
|
|
1
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/lodash-es/flattenDeep.cjs"),n=require("../../../node_modules/lodash-es/lodash.cjs"),r=require("./whitespaces.cjs"),i=require("./keyword_parsers.cjs"),a=require("./utils.cjs"),o=require("./base_parsers.cjs");let s=require("parsimmon");s=e.__toESM(s);function c(e){return e.many().map(e=>e.join(``)).fallback(null).thru(a.streamline(`token`))}function l(e){let t=i.RParen.thru(c),n=i.LParen.thru(c);return s.default.seq(n,e,t)}function u(e){return s.default.alt(l(e),e)}var d,f,p=e.__esmMin((()=>{o.init_base_parsers(),i.init_keyword_parsers(),r.init_whitespaces(),a.init_utils(),n.init_lodash(),d=s.default.createLanguage({ExpressionFinal:e=>e.Expression.map(e=>t.default(e).map(e=>e?e.value:``).join(``)),Expression:e=>u(s.default.seq(s.default.alt(e.UnaryExpression,e.SimpleExpression),e.BinaryExpressionLR.fallback(null)).skip(r.default)),UnaryExpression:e=>{let t=s.default.regex(/[+\-~]/).thru(a.streamline(`unary_operator`));return u(s.default.seq(t,e.Expression).skip(r.default))},BinaryExpressionLR:e=>{let t=s.default.regexp(/[+\-*/%=!<>&^|]{1,2}/).map(e=>` ${e} `).thru(a.streamline(`binary_operator`)).skip(r.default);return s.default.seq(t,e.Expression).skip(r.default)},SimpleExpression:e=>u(s.default.alt(o.pFunction,o.pConst,e.ExpressionDDN).skip(r.default)),ExpressionDDN:()=>o.pDotDelimitedName.map(e=>e.join(`.`)).thru(a.streamline(`identifier`))}),f=d.ExpressionFinal}));p(),exports.default=f,Object.defineProperty(exports,"init_expression",{enumerable:!0,get:function(){return p}});
|
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
import { __esmMin as e } from "../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import t
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import p from "
|
|
2
|
+
import t from "../../../node_modules/lodash-es/flattenDeep.mjs";
|
|
3
|
+
import { init_lodash as n } from "../../../node_modules/lodash-es/lodash.mjs";
|
|
4
|
+
import r, { init_whitespaces as i } from "./whitespaces.mjs";
|
|
5
|
+
import { LParen as a, RParen as o, init_keyword_parsers as s } from "./keyword_parsers.mjs";
|
|
6
|
+
import { init_utils as c, streamline as l } from "./utils.mjs";
|
|
7
|
+
import { init_base_parsers as u, pConst as d, pDotDelimitedName as f, pFunction as p } from "./base_parsers.mjs";
|
|
8
|
+
import m from "parsimmon";
|
|
8
9
|
//#region src/parse/deprecated/mssql/expression.js
|
|
9
|
-
function m(e) {
|
|
10
|
-
return e.many().map((e) => e.join("")).fallback(null).thru(s("token"));
|
|
11
|
-
}
|
|
12
10
|
function h(e) {
|
|
13
|
-
|
|
14
|
-
return p.seq(n, e, t);
|
|
11
|
+
return e.many().map((e) => e.join("")).fallback(null).thru(l("token"));
|
|
15
12
|
}
|
|
16
13
|
function g(e) {
|
|
17
|
-
|
|
14
|
+
let t = o.thru(h), n = a.thru(h);
|
|
15
|
+
return m.seq(n, e, t);
|
|
16
|
+
}
|
|
17
|
+
function _(e) {
|
|
18
|
+
return m.alt(g(e), e);
|
|
18
19
|
}
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
ExpressionFinal: (e) => e.Expression.map((e) =>
|
|
22
|
-
Expression: (e) =>
|
|
20
|
+
var v, y, b = e((() => {
|
|
21
|
+
u(), s(), i(), c(), n(), v = m.createLanguage({
|
|
22
|
+
ExpressionFinal: (e) => e.Expression.map((e) => t(e).map((e) => e ? e.value : "").join("")),
|
|
23
|
+
Expression: (e) => _(m.seq(m.alt(e.UnaryExpression, e.SimpleExpression), e.BinaryExpressionLR.fallback(null)).skip(r)),
|
|
23
24
|
UnaryExpression: (e) => {
|
|
24
|
-
let
|
|
25
|
-
return
|
|
25
|
+
let t = m.regex(/[+\-~]/).thru(l("unary_operator"));
|
|
26
|
+
return _(m.seq(t, e.Expression).skip(r));
|
|
26
27
|
},
|
|
27
28
|
BinaryExpressionLR: (e) => {
|
|
28
|
-
let
|
|
29
|
-
return
|
|
29
|
+
let t = m.regexp(/[+\-*/%=!<>&^|]{1,2}/).map((e) => ` ${e} `).thru(l("binary_operator")).skip(r);
|
|
30
|
+
return m.seq(t, e.Expression).skip(r);
|
|
30
31
|
},
|
|
31
|
-
SimpleExpression: (e) =>
|
|
32
|
-
ExpressionDDN: () =>
|
|
33
|
-
}),
|
|
32
|
+
SimpleExpression: (e) => _(m.alt(p, d, e.ExpressionDDN).skip(r)),
|
|
33
|
+
ExpressionDDN: () => f.map((e) => e.join(".")).thru(l("identifier"))
|
|
34
|
+
}), y = v.ExpressionFinal;
|
|
34
35
|
}));
|
|
35
36
|
//#endregion
|
|
36
|
-
|
|
37
|
-
export {
|
|
37
|
+
b();
|
|
38
|
+
export { y as default, b as init_expression };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../../../../_virtual/_rolldown/runtime.cjs")
|
|
1
|
+
const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../node_modules/lodash-es/flatten.cjs"),n=require("../../../../node_modules/lodash-es/lodash.cjs");function r(e,t,n){let r=n||`public`;return e.tables.find(e=>(e.schemaName||`public`)===r&&e.name===t)}function i(e,t){return e.fields.find(e=>e.name===t)}function a(e,t){r(t,e.tableName,e.schemaName).indexes.push(e),e.tableName=null}function o(e,t){e.forEach(e=>{t.push(e)})}function s(e,t){o(e.enums,t.enums),o(e.refs,t.refs),e.enums.forEach(e=>{e.fieldName=null}),e.enums=null,e.refs=null}function c(e,t){let n=i(r(t,e.tableName,e.schemaName),e.fieldName);e.fieldName=null,e.tableName=null,n.dbdefault=e}function l(e,t){let n=i(r(t,e.tableName,e.schemaName),e.fieldName);e.name=`${e.tableName}_${e.fieldName}_enum`,e.fieldName=null,e.tableName=null,n.type.type_name=e.name,n.type.args=e.values.map(e=>`'${e.name}'`).join(`, `)}function u(e,t){let{schemaName:n}=e;n===`dbo`&&(n=null);let i=r(t,e.tableName,n);i&&(i.note=e.note?{value:e.note}:null)}function d(e,t){let{schemaName:n}=e;n===`dbo`&&(n=null);let a=r(t,e.tableName,n);if(a){let t=i(a,e.columnName);t&&(t.note=e.note?{value:e.note}:null)}}function f(e,t){e.type===`table`?u(e,t):e.type===`column`&&d(e,t)}function p(e){let n={tables:[],refs:[],indexes:[],enums:[]};return t.default(e).forEach(e=>{if(e){switch(e.type){case`tables`:s(e.value,n);break;case`indexes`:a(e.value,n);break;case`dbdefault`:c(e.value,n);break;case`enums`:l(e.value,n);break;case`comment`:f(e.value,n);break;default:break}e.type&&n[e.type]&&n[e.type].push(e.value)}}),n.indexes=null,n}var m=e.__esmMin((()=>{n.init_lodash()}));m(),exports.handleStatement=p,Object.defineProperty(exports,"init_actions",{enumerable:!0,get:function(){return m}});
|
|
@@ -1,53 +1,54 @@
|
|
|
1
1
|
import { __esmMin as e } from "../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import
|
|
2
|
+
import t from "../../../../node_modules/lodash-es/flatten.mjs";
|
|
3
|
+
import { init_lodash as n } from "../../../../node_modules/lodash-es/lodash.mjs";
|
|
3
4
|
//#region src/parse/deprecated/mssql/statements/actions.js
|
|
4
|
-
function
|
|
5
|
+
function r(e, t, n) {
|
|
5
6
|
let r = n || "public";
|
|
6
7
|
return e.tables.find((e) => (e.schemaName || "public") === r && e.name === t);
|
|
7
8
|
}
|
|
8
|
-
function r(e, t) {
|
|
9
|
-
return e.fields.find((e) => e.name === t);
|
|
10
|
-
}
|
|
11
9
|
function i(e, t) {
|
|
12
|
-
|
|
10
|
+
return e.fields.find((e) => e.name === t);
|
|
13
11
|
}
|
|
14
12
|
function a(e, t) {
|
|
13
|
+
r(t, e.tableName, e.schemaName).indexes.push(e), e.tableName = null;
|
|
14
|
+
}
|
|
15
|
+
function o(e, t) {
|
|
15
16
|
e.forEach((e) => {
|
|
16
17
|
t.push(e);
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
20
|
+
function s(e, t) {
|
|
21
|
+
o(e.enums, t.enums), o(e.refs, t.refs), e.enums.forEach((e) => {
|
|
21
22
|
e.fieldName = null;
|
|
22
23
|
}), e.enums = null, e.refs = null;
|
|
23
24
|
}
|
|
24
|
-
function s(e, t) {
|
|
25
|
-
let i = r(n(t, e.tableName, e.schemaName), e.fieldName);
|
|
26
|
-
e.fieldName = null, e.tableName = null, i.dbdefault = e;
|
|
27
|
-
}
|
|
28
25
|
function c(e, t) {
|
|
29
|
-
let
|
|
30
|
-
e.
|
|
26
|
+
let n = i(r(t, e.tableName, e.schemaName), e.fieldName);
|
|
27
|
+
e.fieldName = null, e.tableName = null, n.dbdefault = e;
|
|
31
28
|
}
|
|
32
29
|
function l(e, t) {
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
let i = n(t, e.tableName, r);
|
|
36
|
-
i && (i.note = e.note ? { value: e.note } : null);
|
|
30
|
+
let n = i(r(t, e.tableName, e.schemaName), e.fieldName);
|
|
31
|
+
e.name = `${e.tableName}_${e.fieldName}_enum`, e.fieldName = null, e.tableName = null, n.type.type_name = e.name, n.type.args = e.values.map((e) => `'${e.name}'`).join(", ");
|
|
37
32
|
}
|
|
38
33
|
function u(e, t) {
|
|
39
|
-
let { schemaName:
|
|
40
|
-
|
|
41
|
-
let
|
|
34
|
+
let { schemaName: n } = e;
|
|
35
|
+
n === "dbo" && (n = null);
|
|
36
|
+
let i = r(t, e.tableName, n);
|
|
37
|
+
i && (i.note = e.note ? { value: e.note } : null);
|
|
38
|
+
}
|
|
39
|
+
function d(e, t) {
|
|
40
|
+
let { schemaName: n } = e;
|
|
41
|
+
n === "dbo" && (n = null);
|
|
42
|
+
let a = r(t, e.tableName, n);
|
|
42
43
|
if (a) {
|
|
43
|
-
let t =
|
|
44
|
+
let t = i(a, e.columnName);
|
|
44
45
|
t && (t.note = e.note ? { value: e.note } : null);
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
-
e.type === "table" ?
|
|
48
|
+
function f(e, t) {
|
|
49
|
+
e.type === "table" ? u(e, t) : e.type === "column" && d(e, t);
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function p(e) {
|
|
51
52
|
let n = {
|
|
52
53
|
tables: [],
|
|
53
54
|
refs: [],
|
|
@@ -58,19 +59,19 @@ function f(e) {
|
|
|
58
59
|
if (e) {
|
|
59
60
|
switch (e.type) {
|
|
60
61
|
case "tables":
|
|
61
|
-
|
|
62
|
+
s(e.value, n);
|
|
62
63
|
break;
|
|
63
64
|
case "indexes":
|
|
64
|
-
|
|
65
|
+
a(e.value, n);
|
|
65
66
|
break;
|
|
66
67
|
case "dbdefault":
|
|
67
|
-
|
|
68
|
+
c(e.value, n);
|
|
68
69
|
break;
|
|
69
70
|
case "enums":
|
|
70
|
-
|
|
71
|
+
l(e.value, n);
|
|
71
72
|
break;
|
|
72
73
|
case "comment":
|
|
73
|
-
|
|
74
|
+
f(e.value, n);
|
|
74
75
|
break;
|
|
75
76
|
default: break;
|
|
76
77
|
}
|
|
@@ -78,7 +79,9 @@ function f(e) {
|
|
|
78
79
|
}
|
|
79
80
|
}), n.indexes = null, n;
|
|
80
81
|
}
|
|
81
|
-
var
|
|
82
|
+
var m = e((() => {
|
|
83
|
+
n();
|
|
84
|
+
}));
|
|
82
85
|
//#endregion
|
|
83
|
-
|
|
84
|
-
export {
|
|
86
|
+
m();
|
|
87
|
+
export { p as handleStatement, m as init_actions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("
|
|
1
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/lodash-es/last.cjs"),n=require("../../../node_modules/lodash-es/lodash.cjs"),r=require("./whitespaces.cjs"),i=require("./keyword_parsers.cjs");let a=require("parsimmon");a=e.__toESM(a);function o(){return function(e){return a.default.seqMap(a.default.index,e,a.default.index,(t,n,r)=>n?(typeof n.value!=`object`&&(n.value={value:n.value}),n.value.token={start:t,end:r},n):e).skip(r.default)}}function s(e,t=!1){let n=e.sepBy1(i.Comma);return t&&(n=e.sepBy(i.Comma)),a.default.seq(i.LParen,n,i.RParen).map(e=>e[1])}function c(e){return function(t){return t.skip(r.default).map(t=>(t!==0&&!t&&(t=``),{type:e,value:t}))}}function l(e){let n=null;return e.length>1&&(n=e[e.length-2]),{name:t.default(e),schemaName:n}}var u=e.__esmMin((()=>{n.init_lodash(),i.init_keyword_parsers(),r.init_whitespaces()}));u(),exports.getFullTableName=l,Object.defineProperty(exports,"init_utils",{enumerable:!0,get:function(){return u}}),exports.makeList=s,exports.makeNode=o,exports.streamline=c;
|