@dbml/core 10.3.0-alpha.0 → 10.3.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/export/DbmlExporter.cjs +13 -13
- package/lib/export/DbmlExporter.mjs +88 -84
- package/lib/export/MysqlExporter.cjs +8 -8
- package/lib/export/MysqlExporter.mjs +54 -50
- package/lib/export/OracleExporter.cjs +7 -7
- package/lib/export/OracleExporter.mjs +79 -74
- package/lib/export/PostgresExporter.cjs +9 -9
- package/lib/export/PostgresExporter.mjs +82 -78
- package/lib/export/SqlServerExporter.cjs +11 -11
- package/lib/export/SqlServerExporter.mjs +64 -60
- package/lib/model_structure/database.cjs +1 -1
- package/lib/model_structure/database.mjs +56 -53
- package/lib/model_structure/dep.cjs +1 -1
- package/lib/model_structure/dep.mjs +11 -9
- package/lib/model_structure/enum.cjs +1 -1
- package/lib/model_structure/enum.mjs +15 -13
- package/lib/model_structure/enumValue.cjs +1 -1
- package/lib/model_structure/enumValue.mjs +8 -6
- package/lib/model_structure/field.cjs +1 -1
- package/lib/model_structure/field.mjs +10 -8
- package/lib/model_structure/schema.cjs +1 -1
- package/lib/model_structure/schema.mjs +25 -23
- package/lib/model_structure/table.cjs +1 -1
- package/lib/model_structure/table.mjs +43 -40
- package/lib/model_structure/tableGroup.cjs +1 -1
- package/lib/model_structure/tableGroup.mjs +11 -9
- package/lib/model_structure/tablePartial.cjs +1 -1
- package/lib/model_structure/tablePartial.mjs +8 -6
- package/lib/node_modules/lodash-es/_DataView.cjs +1 -0
- package/lib/node_modules/lodash-es/_DataView.mjs +10 -0
- package/lib/node_modules/lodash-es/_Hash.cjs +1 -0
- package/lib/node_modules/lodash-es/_Hash.mjs +20 -0
- package/lib/node_modules/lodash-es/_ListCache.cjs +1 -0
- package/lib/node_modules/lodash-es/_ListCache.mjs +20 -0
- package/lib/node_modules/lodash-es/_Map.cjs +1 -0
- package/lib/node_modules/lodash-es/_Map.mjs +10 -0
- package/lib/node_modules/lodash-es/_MapCache.cjs +1 -0
- package/lib/node_modules/lodash-es/_MapCache.mjs +20 -0
- package/lib/node_modules/lodash-es/_Promise.cjs +1 -0
- package/lib/node_modules/lodash-es/_Promise.mjs +10 -0
- package/lib/node_modules/lodash-es/_Set.cjs +1 -0
- package/lib/node_modules/lodash-es/_Set.mjs +10 -0
- package/lib/node_modules/lodash-es/_SetCache.cjs +1 -0
- package/lib/node_modules/lodash-es/_SetCache.mjs +15 -0
- package/lib/node_modules/lodash-es/_Stack.cjs +1 -0
- package/lib/node_modules/lodash-es/_Stack.mjs +18 -0
- package/lib/node_modules/lodash-es/_Symbol.cjs +1 -0
- package/lib/node_modules/lodash-es/_Symbol.mjs +9 -0
- package/lib/node_modules/lodash-es/_Uint8Array.cjs +1 -0
- package/lib/node_modules/lodash-es/_Uint8Array.mjs +9 -0
- package/lib/node_modules/lodash-es/_WeakMap.cjs +1 -0
- package/lib/node_modules/lodash-es/_WeakMap.mjs +10 -0
- package/lib/node_modules/lodash-es/_arrayAggregator.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayAggregator.mjs +13 -0
- package/lib/node_modules/lodash-es/_arrayEach.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayEach.mjs +10 -0
- package/lib/node_modules/lodash-es/_arrayFilter.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayFilter.mjs +13 -0
- package/lib/node_modules/lodash-es/_arrayLikeKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayLikeKeys.mjs +19 -0
- package/lib/node_modules/lodash-es/_arrayMap.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayMap.mjs +10 -0
- package/lib/node_modules/lodash-es/_arrayPush.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayPush.mjs +10 -0
- package/lib/node_modules/lodash-es/_arrayReduce.cjs +1 -0
- package/lib/node_modules/lodash-es/_arrayReduce.mjs +11 -0
- package/lib/node_modules/lodash-es/_arraySome.cjs +1 -0
- package/lib/node_modules/lodash-es/_arraySome.mjs +10 -0
- package/lib/node_modules/lodash-es/_asciiToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_asciiToArray.mjs +9 -0
- package/lib/node_modules/lodash-es/_assocIndexOf.cjs +1 -0
- package/lib/node_modules/lodash-es/_assocIndexOf.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseAggregator.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseAggregator.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseAssignValue.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseAssignValue.mjs +17 -0
- package/lib/node_modules/lodash-es/_baseEach.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseEach.mjs +10 -0
- package/lib/node_modules/lodash-es/_baseFlatten.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseFlatten.mjs +18 -0
- package/lib/node_modules/lodash-es/_baseFor.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseFor.mjs +9 -0
- package/lib/node_modules/lodash-es/_baseForOwn.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseForOwn.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseGet.mjs +15 -0
- package/lib/node_modules/lodash-es/_baseGetAllKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseGetAllKeys.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseGetTag.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseGetTag.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseHasIn.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseHasIn.mjs +9 -0
- package/lib/node_modules/lodash-es/_baseIsArguments.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsArguments.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseIsEqual.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsEqual.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseIsEqualDeep.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsEqualDeep.mjs +34 -0
- package/lib/node_modules/lodash-es/_baseIsMatch.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsMatch.mjs +30 -0
- package/lib/node_modules/lodash-es/_baseIsNative.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsNative.mjs +15 -0
- package/lib/node_modules/lodash-es/_baseIsTypedArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIsTypedArray.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseIteratee.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseIteratee.mjs +16 -0
- package/lib/node_modules/lodash-es/_baseKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseKeys.mjs +16 -0
- package/lib/node_modules/lodash-es/_baseMatches.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseMatches.mjs +17 -0
- package/lib/node_modules/lodash-es/_baseMatchesProperty.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseMatchesProperty.mjs +21 -0
- package/lib/node_modules/lodash-es/_baseNth.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseNth.mjs +13 -0
- package/lib/node_modules/lodash-es/_baseProperty.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseProperty.mjs +11 -0
- package/lib/node_modules/lodash-es/_basePropertyDeep.cjs +1 -0
- package/lib/node_modules/lodash-es/_basePropertyDeep.mjs +14 -0
- package/lib/node_modules/lodash-es/_baseReduce.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseReduce.mjs +11 -0
- package/lib/node_modules/lodash-es/_baseSlice.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseSlice.mjs +12 -0
- package/lib/node_modules/lodash-es/_baseTimes.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseTimes.mjs +10 -0
- package/lib/node_modules/lodash-es/_baseToString.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseToString.mjs +19 -0
- package/lib/node_modules/lodash-es/_baseTrim.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseTrim.mjs +12 -0
- package/lib/node_modules/lodash-es/_baseUnary.cjs +1 -0
- package/lib/node_modules/lodash-es/_baseUnary.mjs +11 -0
- package/lib/node_modules/lodash-es/_cacheHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_cacheHas.mjs +9 -0
- package/lib/node_modules/lodash-es/_castFunction.cjs +1 -0
- package/lib/node_modules/lodash-es/_castFunction.mjs +12 -0
- package/lib/node_modules/lodash-es/_castPath.cjs +1 -0
- package/lib/node_modules/lodash-es/_castPath.mjs +15 -0
- package/lib/node_modules/lodash-es/_castSlice.cjs +1 -0
- package/lib/node_modules/lodash-es/_castSlice.mjs +13 -0
- package/lib/node_modules/lodash-es/_copyArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_copyArray.mjs +11 -0
- package/lib/node_modules/lodash-es/_coreJsData.cjs +1 -0
- package/lib/node_modules/lodash-es/_coreJsData.mjs +9 -0
- package/lib/node_modules/lodash-es/_createAggregator.cjs +1 -0
- package/lib/node_modules/lodash-es/_createAggregator.mjs +18 -0
- package/lib/node_modules/lodash-es/_createBaseEach.cjs +1 -0
- package/lib/node_modules/lodash-es/_createBaseEach.mjs +17 -0
- package/lib/node_modules/lodash-es/_createBaseFor.cjs +1 -0
- package/lib/node_modules/lodash-es/_createBaseFor.mjs +15 -0
- package/lib/node_modules/lodash-es/_createCaseFirst.cjs +1 -0
- package/lib/node_modules/lodash-es/_createCaseFirst.mjs +19 -0
- package/lib/node_modules/lodash-es/_defineProperty.cjs +1 -0
- package/lib/node_modules/lodash-es/_defineProperty.mjs +14 -0
- package/lib/node_modules/lodash-es/_equalArrays.cjs +1 -0
- package/lib/node_modules/lodash-es/_equalArrays.mjs +39 -0
- package/lib/node_modules/lodash-es/_equalByTag.cjs +1 -0
- package/lib/node_modules/lodash-es/_equalByTag.mjs +39 -0
- package/lib/node_modules/lodash-es/_equalObjects.cjs +1 -0
- package/lib/node_modules/lodash-es/_equalObjects.mjs +36 -0
- package/lib/node_modules/lodash-es/_freeGlobal.cjs +1 -0
- package/lib/node_modules/lodash-es/_freeGlobal.mjs +8 -0
- package/lib/node_modules/lodash-es/_getAllKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_getAllKeys.mjs +14 -0
- package/lib/node_modules/lodash-es/_getMapData.cjs +1 -0
- package/lib/node_modules/lodash-es/_getMapData.mjs +13 -0
- package/lib/node_modules/lodash-es/_getMatchData.cjs +1 -0
- package/lib/node_modules/lodash-es/_getMatchData.mjs +21 -0
- package/lib/node_modules/lodash-es/_getNative.cjs +1 -0
- package/lib/node_modules/lodash-es/_getNative.mjs +14 -0
- package/lib/node_modules/lodash-es/_getRawTag.cjs +1 -0
- package/lib/node_modules/lodash-es/_getRawTag.mjs +18 -0
- package/lib/node_modules/lodash-es/_getSymbols.cjs +1 -0
- package/lib/node_modules/lodash-es/_getSymbols.mjs +14 -0
- package/lib/node_modules/lodash-es/_getTag.cjs +1 -0
- package/lib/node_modules/lodash-es/_getTag.mjs +25 -0
- package/lib/node_modules/lodash-es/_getValue.cjs +1 -0
- package/lib/node_modules/lodash-es/_getValue.mjs +9 -0
- package/lib/node_modules/lodash-es/_hasPath.cjs +1 -0
- package/lib/node_modules/lodash-es/_hasPath.mjs +23 -0
- package/lib/node_modules/lodash-es/_hasUnicode.cjs +1 -0
- package/lib/node_modules/lodash-es/_hasUnicode.mjs +11 -0
- package/lib/node_modules/lodash-es/_hashClear.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashClear.mjs +12 -0
- package/lib/node_modules/lodash-es/_hashDelete.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashDelete.mjs +10 -0
- package/lib/node_modules/lodash-es/_hashGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashGet.mjs +17 -0
- package/lib/node_modules/lodash-es/_hashHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashHas.mjs +13 -0
- package/lib/node_modules/lodash-es/_hashSet.cjs +1 -0
- package/lib/node_modules/lodash-es/_hashSet.mjs +13 -0
- package/lib/node_modules/lodash-es/_isFlattenable.cjs +1 -0
- package/lib/node_modules/lodash-es/_isFlattenable.mjs +14 -0
- package/lib/node_modules/lodash-es/_isIndex.cjs +1 -0
- package/lib/node_modules/lodash-es/_isIndex.mjs +12 -0
- package/lib/node_modules/lodash-es/_isKey.cjs +1 -0
- package/lib/node_modules/lodash-es/_isKey.mjs +15 -0
- package/lib/node_modules/lodash-es/_isKeyable.cjs +1 -0
- package/lib/node_modules/lodash-es/_isKeyable.mjs +10 -0
- package/lib/node_modules/lodash-es/_isMasked.cjs +1 -0
- package/lib/node_modules/lodash-es/_isMasked.mjs +15 -0
- package/lib/node_modules/lodash-es/_isPrototype.cjs +1 -0
- package/lib/node_modules/lodash-es/_isPrototype.mjs +12 -0
- package/lib/node_modules/lodash-es/_isStrictComparable.cjs +1 -0
- package/lib/node_modules/lodash-es/_isStrictComparable.mjs +12 -0
- package/lib/node_modules/lodash-es/_listCacheClear.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheClear.mjs +9 -0
- package/lib/node_modules/lodash-es/_listCacheDelete.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheDelete.mjs +13 -0
- package/lib/node_modules/lodash-es/_listCacheGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheGet.mjs +13 -0
- package/lib/node_modules/lodash-es/_listCacheHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheHas.mjs +12 -0
- package/lib/node_modules/lodash-es/_listCacheSet.cjs +1 -0
- package/lib/node_modules/lodash-es/_listCacheSet.mjs +13 -0
- package/lib/node_modules/lodash-es/_mapCacheClear.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheClear.mjs +18 -0
- package/lib/node_modules/lodash-es/_mapCacheDelete.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheDelete.mjs +13 -0
- package/lib/node_modules/lodash-es/_mapCacheGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheGet.mjs +12 -0
- package/lib/node_modules/lodash-es/_mapCacheHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheHas.mjs +12 -0
- package/lib/node_modules/lodash-es/_mapCacheSet.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapCacheSet.mjs +13 -0
- package/lib/node_modules/lodash-es/_mapToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_mapToArray.mjs +12 -0
- package/lib/node_modules/lodash-es/_matchesStrictComparable.cjs +1 -0
- package/lib/node_modules/lodash-es/_matchesStrictComparable.mjs +11 -0
- package/lib/node_modules/lodash-es/_memoizeCapped.cjs +1 -0
- package/lib/node_modules/lodash-es/_memoizeCapped.mjs +15 -0
- package/lib/node_modules/lodash-es/_nativeCreate.cjs +1 -0
- package/lib/node_modules/lodash-es/_nativeCreate.mjs +9 -0
- package/lib/node_modules/lodash-es/_nativeKeys.cjs +1 -0
- package/lib/node_modules/lodash-es/_nativeKeys.mjs +9 -0
- package/lib/node_modules/lodash-es/_nodeUtil.cjs +1 -0
- package/lib/node_modules/lodash-es/_nodeUtil.mjs +13 -0
- package/lib/node_modules/lodash-es/_objectToString.cjs +1 -0
- package/lib/node_modules/lodash-es/_objectToString.mjs +11 -0
- package/lib/node_modules/lodash-es/_overArg.cjs +1 -0
- package/lib/node_modules/lodash-es/_overArg.mjs +11 -0
- package/lib/node_modules/lodash-es/_root.cjs +1 -0
- package/lib/node_modules/lodash-es/_root.mjs +9 -0
- package/lib/node_modules/lodash-es/_setCacheAdd.cjs +1 -0
- package/lib/node_modules/lodash-es/_setCacheAdd.mjs +11 -0
- package/lib/node_modules/lodash-es/_setCacheHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_setCacheHas.mjs +9 -0
- package/lib/node_modules/lodash-es/_setToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_setToArray.mjs +12 -0
- package/lib/node_modules/lodash-es/_stackClear.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackClear.mjs +12 -0
- package/lib/node_modules/lodash-es/_stackDelete.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackDelete.mjs +10 -0
- package/lib/node_modules/lodash-es/_stackGet.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackGet.mjs +9 -0
- package/lib/node_modules/lodash-es/_stackHas.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackHas.mjs +9 -0
- package/lib/node_modules/lodash-es/_stackSet.cjs +1 -0
- package/lib/node_modules/lodash-es/_stackSet.mjs +20 -0
- package/lib/node_modules/lodash-es/_stringToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_stringToArray.mjs +14 -0
- package/lib/node_modules/lodash-es/_stringToPath.cjs +1 -0
- package/lib/node_modules/lodash-es/_stringToPath.mjs +14 -0
- package/lib/node_modules/lodash-es/_toKey.cjs +1 -0
- package/lib/node_modules/lodash-es/_toKey.mjs +14 -0
- package/lib/node_modules/lodash-es/_toSource.cjs +1 -0
- package/lib/node_modules/lodash-es/_toSource.mjs +19 -0
- package/lib/node_modules/lodash-es/_trimmedEndIndex.cjs +1 -0
- package/lib/node_modules/lodash-es/_trimmedEndIndex.mjs +12 -0
- package/lib/node_modules/lodash-es/_unicodeToArray.cjs +1 -0
- package/lib/node_modules/lodash-es/_unicodeToArray.mjs +21 -0
- package/lib/node_modules/lodash-es/capitalize.cjs +1 -0
- package/lib/node_modules/lodash-es/capitalize.mjs +13 -0
- package/lib/node_modules/lodash-es/concat.cjs +1 -0
- package/lib/node_modules/lodash-es/concat.mjs +18 -0
- package/lib/node_modules/lodash-es/eq.cjs +1 -0
- package/lib/node_modules/lodash-es/eq.mjs +9 -0
- package/lib/node_modules/lodash-es/first.cjs +1 -0
- package/lib/node_modules/lodash-es/first.mjs +9 -0
- package/lib/node_modules/lodash-es/flatten.cjs +1 -0
- package/lib/node_modules/lodash-es/flatten.mjs +12 -0
- package/lib/node_modules/lodash-es/flattenDeep.cjs +1 -0
- package/lib/node_modules/lodash-es/flattenDeep.mjs +12 -0
- package/lib/node_modules/lodash-es/flattenDepth.cjs +1 -0
- package/lib/node_modules/lodash-es/flattenDepth.mjs +13 -0
- package/lib/node_modules/lodash-es/forEach.cjs +1 -0
- package/lib/node_modules/lodash-es/forEach.mjs +15 -0
- package/lib/node_modules/lodash-es/get.cjs +1 -0
- package/lib/node_modules/lodash-es/get.mjs +13 -0
- package/lib/node_modules/lodash-es/groupBy.cjs +1 -0
- package/lib/node_modules/lodash-es/groupBy.mjs +12 -0
- package/lib/node_modules/lodash-es/hasIn.cjs +1 -0
- package/lib/node_modules/lodash-es/hasIn.mjs +13 -0
- package/lib/node_modules/lodash-es/head.cjs +1 -0
- package/lib/node_modules/lodash-es/head.mjs +9 -0
- package/lib/node_modules/lodash-es/identity.cjs +1 -0
- package/lib/node_modules/lodash-es/identity.mjs +9 -0
- package/lib/node_modules/lodash-es/isArguments.cjs +1 -0
- package/lib/node_modules/lodash-es/isArguments.mjs +14 -0
- package/lib/node_modules/lodash-es/isArray.cjs +1 -0
- package/lib/node_modules/lodash-es/isArray.mjs +8 -0
- package/lib/node_modules/lodash-es/isArrayLike.cjs +1 -0
- package/lib/node_modules/lodash-es/isArrayLike.mjs +13 -0
- package/lib/node_modules/lodash-es/isBuffer.cjs +1 -0
- package/lib/node_modules/lodash-es/isBuffer.mjs +10 -0
- package/lib/node_modules/lodash-es/isEmpty.cjs +1 -0
- package/lib/node_modules/lodash-es/isEmpty.mjs +25 -0
- package/lib/node_modules/lodash-es/isFunction.cjs +1 -0
- package/lib/node_modules/lodash-es/isFunction.mjs +15 -0
- package/lib/node_modules/lodash-es/isLength.cjs +1 -0
- package/lib/node_modules/lodash-es/isLength.mjs +11 -0
- package/lib/node_modules/lodash-es/isNil.cjs +1 -0
- package/lib/node_modules/lodash-es/isNil.mjs +9 -0
- package/lib/node_modules/lodash-es/isObject.cjs +1 -0
- package/lib/node_modules/lodash-es/isObject.mjs +10 -0
- package/lib/node_modules/lodash-es/isObjectLike.cjs +1 -0
- package/lib/node_modules/lodash-es/isObjectLike.mjs +9 -0
- package/lib/node_modules/lodash-es/isSymbol.cjs +1 -0
- package/lib/node_modules/lodash-es/isSymbol.mjs +13 -0
- package/lib/node_modules/lodash-es/isTypedArray.cjs +1 -0
- package/lib/node_modules/lodash-es/isTypedArray.mjs +11 -0
- package/lib/node_modules/lodash-es/keys.cjs +1 -0
- package/lib/node_modules/lodash-es/keys.mjs +14 -0
- package/lib/node_modules/lodash-es/last.cjs +1 -0
- package/lib/node_modules/lodash-es/last.mjs +10 -0
- package/lib/node_modules/lodash-es/lodash.cjs +1 -0
- package/lib/node_modules/lodash-es/lodash.mjs +46 -0
- package/lib/node_modules/lodash-es/memoize.cjs +1 -0
- package/lib/node_modules/lodash-es/memoize.mjs +19 -0
- package/lib/node_modules/lodash-es/nth.cjs +1 -0
- package/lib/node_modules/lodash-es/nth.mjs +13 -0
- package/lib/node_modules/lodash-es/property.cjs +1 -0
- package/lib/node_modules/lodash-es/property.mjs +15 -0
- package/lib/node_modules/lodash-es/reduce.cjs +1 -0
- package/lib/node_modules/lodash-es/reduce.mjs +17 -0
- package/lib/node_modules/lodash-es/stubArray.cjs +1 -0
- package/lib/node_modules/lodash-es/stubArray.mjs +9 -0
- package/lib/node_modules/lodash-es/stubFalse.cjs +1 -0
- package/lib/node_modules/lodash-es/stubFalse.mjs +9 -0
- package/lib/node_modules/lodash-es/toFinite.cjs +1 -0
- package/lib/node_modules/lodash-es/toFinite.mjs +12 -0
- package/lib/node_modules/lodash-es/toInteger.cjs +1 -0
- package/lib/node_modules/lodash-es/toInteger.mjs +13 -0
- package/lib/node_modules/lodash-es/toNumber.cjs +1 -0
- package/lib/node_modules/lodash-es/toNumber.mjs +23 -0
- package/lib/node_modules/lodash-es/toString.cjs +1 -0
- package/lib/node_modules/lodash-es/toString.mjs +12 -0
- package/lib/node_modules/lodash-es/upperFirst.cjs +1 -0
- package/lib/node_modules/lodash-es/upperFirst.mjs +9 -0
- package/lib/node_modules/parsimmon/build/parsimmon.umd.min.cjs +16 -0
- package/lib/node_modules/parsimmon/build/parsimmon.umd.min.mjs +689 -0
- package/lib/node_modules/pluralize/pluralize.cjs +1 -0
- package/lib/node_modules/pluralize/pluralize.mjs +276 -0
- package/lib/packages/dbml-core/node_modules/lodash/lodash.cjs +20 -0
- package/lib/packages/dbml-core/node_modules/lodash/lodash.mjs +3306 -0
- package/lib/packages/dbml-core/package.json.cjs +1 -0
- package/lib/{package.json.mjs → packages/dbml-core/package.json.mjs} +1 -1
- package/lib/parse/ANTLR/ASTGeneration/helpers.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/helpers.mjs +5 -3
- package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.mjs +149 -143
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.mjs +146 -142
- package/lib/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.mjs +184 -181
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.mjs +149 -145
- package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.cjs +1 -1
- package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.mjs +89 -85
- package/lib/parse/deprecated/dbmlParser.cjs +3 -3
- package/lib/parse/deprecated/dbmlParser.mjs +27 -25
- package/lib/parse/deprecated/mssql/base_parsers.cjs +1 -1
- package/lib/parse/deprecated/mssql/base_parsers.mjs +38 -38
- package/lib/parse/deprecated/mssql/column_definition/actions.cjs +1 -1
- package/lib/parse/deprecated/mssql/column_definition/actions.mjs +9 -6
- package/lib/parse/deprecated/mssql/column_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/column_definition/index.mjs +28 -28
- package/lib/parse/deprecated/mssql/constraint_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/constraint_definition/index.mjs +24 -24
- package/lib/parse/deprecated/mssql/expression.cjs +1 -1
- package/lib/parse/deprecated/mssql/expression.mjs +28 -27
- package/lib/parse/deprecated/mssql/fk_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/fk_definition/index.mjs +20 -20
- package/lib/parse/deprecated/mssql/index_definition/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/index_definition/index.mjs +21 -21
- package/lib/parse/deprecated/mssql/keyword_utils.cjs +1 -1
- package/lib/parse/deprecated/mssql/keyword_utils.mjs +13 -13
- package/lib/parse/deprecated/mssql/statements/actions.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/actions.mjs +36 -33
- package/lib/parse/deprecated/mssql/statements/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/index.mjs +28 -28
- package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/add/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/add/index.mjs +24 -24
- package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/alter_table/index.mjs +16 -16
- package/lib/parse/deprecated/mssql/statements/statement_types/comments/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/comments/index.mjs +31 -31
- package/lib/parse/deprecated/mssql/statements/statement_types/create_index/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/create_index/index.mjs +20 -20
- package/lib/parse/deprecated/mssql/statements/statement_types/create_table/index.cjs +1 -1
- package/lib/parse/deprecated/mssql/statements/statement_types/create_table/index.mjs +21 -21
- package/lib/parse/deprecated/mssql/utils.cjs +1 -1
- package/lib/parse/deprecated/mssql/utils.mjs +21 -20
- package/lib/parse/deprecated/mssql/whitespaces.cjs +1 -1
- package/lib/parse/deprecated/mssql/whitespaces.mjs +11 -11
- package/lib/parse/deprecated/mysqlParser.cjs +6 -6
- package/lib/parse/deprecated/mysqlParser.mjs +20 -18
- package/lib/parse/deprecated/postgresParser.cjs +2 -2
- package/lib/parse/deprecated/postgresParser.mjs +25 -23
- package/lib/parse/deprecated/schemarbParser.cjs +10 -10
- package/lib/parse/deprecated/schemarbParser.mjs +313 -311
- package/lib/utils/version.cjs +1 -1
- package/lib/utils/version.mjs +1 -1
- package/package.json +2 -2
- package/lib/package.json.cjs +0 -1
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import e from "../../../../node_modules/lodash-es/flatten.mjs";
|
|
2
|
+
import t from "../../../../node_modules/lodash-es/last.mjs";
|
|
3
|
+
import { init_lodash as n } from "../../../../node_modules/lodash-es/lodash.mjs";
|
|
4
|
+
import r from "../../parsers/oraclesql/OracleSqlParserVisitor.mjs";
|
|
5
|
+
import i from "../../parsers/oraclesql/OracleSqlParser.mjs";
|
|
6
|
+
import { Endpoint as a, Field as o, Index as s, Ref as c, Table as l, TableRecord as u } from "../AST.mjs";
|
|
7
|
+
import { CONSTRAINT_TYPE as d, DATA_TYPE as f } from "../constants.mjs";
|
|
8
|
+
import { getOriginalText as p } from "../helpers.mjs";
|
|
9
|
+
import { CompilerError as m } from "../../../error.mjs";
|
|
10
|
+
import { CARDINALITY_MANY as h, CARDINALITY_MAYBE as g, normalizeQualifiedName as _ } from "@dbml/parse";
|
|
11
|
+
import { ParseTreeListener as v, ParseTreeWalker as y } from "antlr4";
|
|
10
12
|
//#region src/parse/ANTLR/ASTGeneration/oraclesql/OracleSQLASTGen.js
|
|
11
|
-
|
|
13
|
+
n();
|
|
14
|
+
var b = {
|
|
12
15
|
FIELD: "table_field",
|
|
13
16
|
INDEX: "table_index",
|
|
14
17
|
FK: "table_fk",
|
|
@@ -16,7 +19,7 @@ var y = {
|
|
|
16
19
|
PK: "table_pk",
|
|
17
20
|
DEFAULT: "table_default",
|
|
18
21
|
CHECK: "table_check"
|
|
19
|
-
},
|
|
22
|
+
}, x = {
|
|
20
23
|
NOT_NULL: "col_not_null",
|
|
21
24
|
NULLABLE: "col_nullable",
|
|
22
25
|
UNIQUE: "col_unique",
|
|
@@ -26,30 +29,30 @@ var y = {
|
|
|
26
29
|
INLINE_REF: "col_inline_ref",
|
|
27
30
|
NOTE: "col_note",
|
|
28
31
|
CHECK: "col_check"
|
|
29
|
-
},
|
|
32
|
+
}, S = (e, t, n) => {
|
|
30
33
|
let r = t ?? null;
|
|
31
34
|
return e.find((e) => (e.schemaName ?? null) === r && e.name === n);
|
|
32
|
-
},
|
|
33
|
-
value: e.type ===
|
|
34
|
-
type: e.type ===
|
|
35
|
-
}),
|
|
35
|
+
}, C = (e, t) => e.fields.find((e) => e.name === t), w = (e) => ({
|
|
36
|
+
value: e.type === d.COLUMN ? e.rawValue : e.value,
|
|
37
|
+
type: e.type === d.COLUMN ? f.EXPRESSION : e.type
|
|
38
|
+
}), T = (e) => {
|
|
36
39
|
let t;
|
|
37
40
|
switch (e.type) {
|
|
38
|
-
case
|
|
39
|
-
t =
|
|
41
|
+
case d.COLUMN:
|
|
42
|
+
t = d.COLUMN;
|
|
40
43
|
break;
|
|
41
|
-
case
|
|
42
|
-
t =
|
|
44
|
+
case f.STRING:
|
|
45
|
+
t = d.STRING;
|
|
43
46
|
break;
|
|
44
47
|
default:
|
|
45
|
-
t =
|
|
48
|
+
t = d.EXPRESSION;
|
|
46
49
|
break;
|
|
47
50
|
}
|
|
48
51
|
return {
|
|
49
52
|
value: e.value.toString(),
|
|
50
53
|
type: t
|
|
51
54
|
};
|
|
52
|
-
},
|
|
55
|
+
}, E = (e, t) => m.create([{
|
|
53
56
|
message: t,
|
|
54
57
|
location: {
|
|
55
58
|
start: {
|
|
@@ -58,10 +61,10 @@ var y = {
|
|
|
58
61
|
},
|
|
59
62
|
end: {
|
|
60
63
|
line: e.stop.line,
|
|
61
|
-
column: e.stop.column +
|
|
64
|
+
column: e.stop.column + p(e).length + 1
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
|
-
}]),
|
|
67
|
+
}]), D = (e, t = "\"") => e.startsWith(t) ? e.slice(1, -1).replaceAll(`${t}${t}`, t) : e, O = class extends r {
|
|
65
68
|
constructor() {
|
|
66
69
|
super(), this.data = {
|
|
67
70
|
schemas: [],
|
|
@@ -78,7 +81,7 @@ var y = {
|
|
|
78
81
|
visitCreate_view(e) {
|
|
79
82
|
let t = e.id_expression ? e.id_expression() : null;
|
|
80
83
|
if (!t) return;
|
|
81
|
-
let n = t.getText().replace(/"/g, ""), r = e.schema_name ? e.schema_name() : null, i = r ? r.getText().replace(/"/g, "") : void 0, a =
|
|
84
|
+
let n = t.getText().replace(/"/g, ""), r = e.schema_name ? e.schema_name() : null, i = r ? r.getText().replace(/"/g, "") : void 0, a = p(e);
|
|
82
85
|
this.data.tables.push({
|
|
83
86
|
name: n,
|
|
84
87
|
schemaName: i,
|
|
@@ -91,12 +94,12 @@ var y = {
|
|
|
91
94
|
query: a,
|
|
92
95
|
kind: "view"
|
|
93
96
|
}
|
|
94
|
-
}),
|
|
97
|
+
}), k(this, e.select_only_statement(), n, i);
|
|
95
98
|
}
|
|
96
99
|
visitCreate_materialized_view(e) {
|
|
97
100
|
let t = (e.getText ? e.getText() : "").match(/MATERIALIZEDVIEW(?:IFNOTEXISTS)?(?:"([^"]+)"\.)?"?([^("\s]+)"?/i);
|
|
98
101
|
if (!t) return;
|
|
99
|
-
let n = t[1] || void 0, r = t[2], i =
|
|
102
|
+
let n = t[1] || void 0, r = t[2], i = p(e);
|
|
100
103
|
this.data.tables.push({
|
|
101
104
|
name: r,
|
|
102
105
|
schemaName: n,
|
|
@@ -110,7 +113,7 @@ var y = {
|
|
|
110
113
|
kind: "materialized_view",
|
|
111
114
|
materialized: !0
|
|
112
115
|
}
|
|
113
|
-
}),
|
|
116
|
+
}), k(this, e.select_only_statement(), r, n);
|
|
114
117
|
}
|
|
115
118
|
visitSql_script(e) {
|
|
116
119
|
return e.unit_statement()?.forEach((e) => e.accept(this)), this.data;
|
|
@@ -121,24 +124,24 @@ var y = {
|
|
|
121
124
|
visitData_manipulation_language_statements(e) {
|
|
122
125
|
e.insert_statement() && e.insert_statement().accept(this);
|
|
123
126
|
}
|
|
124
|
-
visitCreate_table(
|
|
125
|
-
let
|
|
126
|
-
if (
|
|
127
|
-
let [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
].includes(t.type) ? e[1].push(t.value) : t.type ===
|
|
127
|
+
visitCreate_table(t) {
|
|
128
|
+
let n = t.table_name().accept(this), r = t.schema_name() ? t.schema_name().accept(this) : void 0;
|
|
129
|
+
if (t.relational_table()) {
|
|
130
|
+
let [i, a, o, s] = t.relational_table().accept(this).reduce((e, t) => (t.type === b.FIELD ? e[0].push(t.value) : [
|
|
131
|
+
b.INDEX,
|
|
132
|
+
b.UNIQUE,
|
|
133
|
+
b.PK
|
|
134
|
+
].includes(t.type) ? e[1].push(t.value) : t.type === b.FK ? e[2].push(t.value) : t.type === b.CHECK && e[3].push(...t.value.checks), e), [
|
|
132
135
|
[],
|
|
133
136
|
[],
|
|
134
137
|
[],
|
|
135
138
|
[]
|
|
136
139
|
]);
|
|
137
|
-
this.data.refs.push(...
|
|
138
|
-
name:
|
|
139
|
-
schemaName:
|
|
140
|
-
fields:
|
|
141
|
-
indexes:
|
|
140
|
+
this.data.refs.push(...e(i.map((e) => e.inline_refs.map((t) => (t.endpoints[0].tableName = n, t.endpoints[0].schemaName = r, t.endpoints[0].fieldNames = [e.field.name], t))))), this.data.refs.push(...o.map((e) => (e.endpoints[0].tableName = n, e.endpoints[0].schemaName = r, e))), this.data.tables.push(new l({
|
|
141
|
+
name: n,
|
|
142
|
+
schemaName: r,
|
|
143
|
+
fields: i.map((e) => e.field),
|
|
144
|
+
indexes: a,
|
|
142
145
|
checks: s
|
|
143
146
|
}));
|
|
144
147
|
}
|
|
@@ -150,18 +153,18 @@ var y = {
|
|
|
150
153
|
return e.column_definition() ? e.column_definition().accept(this) : e.out_of_line_constraint() ? e.out_of_line_constraint().accept(this) : e.out_of_line_ref_constraint() ? e.out_of_line_ref_constraint().accept(this) : null;
|
|
151
154
|
}
|
|
152
155
|
visitColumn_definition(e) {
|
|
153
|
-
let
|
|
154
|
-
if (!
|
|
156
|
+
let n = t(e.column_name().accept(this)), r = e.datatype()?.accept(this) || e.type_name()?.accept(this);
|
|
157
|
+
if (!r) throw E(e, "Importing a column definition without a type is not supported");
|
|
155
158
|
let i = (e.inline_constraint() || []).map((e) => e.accept(this)).filter(Boolean);
|
|
156
159
|
if (e.DEFAULT()) {
|
|
157
160
|
let t = e.expression().accept(this);
|
|
158
161
|
i.push({
|
|
159
|
-
type:
|
|
160
|
-
value: { dbdefault:
|
|
162
|
+
type: x.DEFAULT,
|
|
163
|
+
value: { dbdefault: w(t) }
|
|
161
164
|
});
|
|
162
165
|
}
|
|
163
166
|
e.identity_clause() && i.push({
|
|
164
|
-
type:
|
|
167
|
+
type: x.INCREMENT,
|
|
165
168
|
value: { increment: !0 }
|
|
166
169
|
});
|
|
167
170
|
let a = {
|
|
@@ -170,68 +173,68 @@ var y = {
|
|
|
170
173
|
};
|
|
171
174
|
i.forEach((e) => {
|
|
172
175
|
switch (e.type) {
|
|
173
|
-
case
|
|
176
|
+
case x.DEFAULT:
|
|
174
177
|
a.dbdefault = e.value.dbdefault;
|
|
175
178
|
break;
|
|
176
|
-
case
|
|
179
|
+
case x.NOT_NULL:
|
|
177
180
|
a.not_null = !0;
|
|
178
181
|
break;
|
|
179
|
-
case
|
|
182
|
+
case x.NULLABLE:
|
|
180
183
|
a.not_null = !1;
|
|
181
184
|
break;
|
|
182
|
-
case
|
|
185
|
+
case x.PK:
|
|
183
186
|
a.pk = !0;
|
|
184
187
|
break;
|
|
185
|
-
case
|
|
188
|
+
case x.UNIQUE:
|
|
186
189
|
a.unique = !0;
|
|
187
190
|
break;
|
|
188
|
-
case
|
|
191
|
+
case x.CHECK:
|
|
189
192
|
a.checks.push(...e.value.checks);
|
|
190
193
|
break;
|
|
191
|
-
case
|
|
194
|
+
case x.INCREMENT:
|
|
192
195
|
a.increment = !0;
|
|
193
196
|
break;
|
|
194
|
-
case
|
|
197
|
+
case x.FK:
|
|
195
198
|
a.inline_refs.push(...e.value.inline_refs);
|
|
196
199
|
break;
|
|
197
200
|
default:
|
|
198
201
|
}
|
|
199
202
|
});
|
|
200
|
-
let
|
|
201
|
-
name:
|
|
202
|
-
type:
|
|
203
|
+
let s = new o({
|
|
204
|
+
name: n,
|
|
205
|
+
type: r,
|
|
203
206
|
...a
|
|
204
207
|
});
|
|
205
208
|
return {
|
|
206
|
-
type:
|
|
209
|
+
type: b.FIELD,
|
|
207
210
|
value: {
|
|
208
|
-
field:
|
|
211
|
+
field: s,
|
|
209
212
|
inline_refs: a.inline_refs || []
|
|
210
213
|
}
|
|
211
214
|
};
|
|
212
215
|
}
|
|
213
216
|
visitInline_constraint(e) {
|
|
214
217
|
if (e.NULL_() && e.NOT()) return {
|
|
215
|
-
type:
|
|
218
|
+
type: x.NOT_NULL,
|
|
216
219
|
value: { not_null: !0 }
|
|
217
220
|
};
|
|
218
221
|
if (e.NULL_()) return {
|
|
219
|
-
type:
|
|
222
|
+
type: x.NULLABLE,
|
|
220
223
|
value: { not_null: !1 }
|
|
221
224
|
};
|
|
222
225
|
if (e.UNIQUE()) return {
|
|
223
|
-
type:
|
|
226
|
+
type: x.UNIQUE,
|
|
224
227
|
value: { unique: !0 }
|
|
225
228
|
};
|
|
226
229
|
if (e.PRIMARY()) return {
|
|
227
|
-
type:
|
|
230
|
+
type: x.PK,
|
|
228
231
|
value: { pk: !0 }
|
|
229
232
|
};
|
|
230
233
|
let t = e.constraint_name()?.accept(this);
|
|
231
234
|
if (e.references_clause()) {
|
|
232
235
|
let n = e.references_clause().accept(this);
|
|
233
236
|
return n.name = t, {
|
|
234
|
-
type:
|
|
237
|
+
type: x.FK,
|
|
235
238
|
value: { inline_refs: [n] }
|
|
236
239
|
};
|
|
237
240
|
}
|
|
@@ -245,28 +248,28 @@ var y = {
|
|
|
245
248
|
}
|
|
246
249
|
visitOut_of_line_constraint(e) {
|
|
247
250
|
if (e.UNIQUE()) {
|
|
248
|
-
let
|
|
249
|
-
value:
|
|
250
|
-
type:
|
|
251
|
+
let n = e.column_name().map((e) => ({
|
|
252
|
+
value: t(e.accept(this)),
|
|
253
|
+
type: d.COLUMN
|
|
251
254
|
}));
|
|
252
255
|
return {
|
|
253
|
-
type:
|
|
254
|
-
value: new
|
|
255
|
-
columns:
|
|
256
|
+
type: b.UNIQUE,
|
|
257
|
+
value: new s({
|
|
258
|
+
columns: n,
|
|
256
259
|
unique: !0,
|
|
257
260
|
name: e.constraint_name()?.accept(this)
|
|
258
261
|
})
|
|
259
262
|
};
|
|
260
263
|
}
|
|
261
264
|
if (e.PRIMARY()) {
|
|
262
|
-
let
|
|
263
|
-
value:
|
|
264
|
-
type:
|
|
265
|
+
let n = e.column_name().map((e) => ({
|
|
266
|
+
value: t(e.accept(this)),
|
|
267
|
+
type: d.COLUMN
|
|
265
268
|
}));
|
|
266
269
|
return {
|
|
267
|
-
type:
|
|
268
|
-
value: new
|
|
269
|
-
columns:
|
|
270
|
+
type: b.PK,
|
|
271
|
+
value: new s({
|
|
272
|
+
columns: n,
|
|
270
273
|
pk: !0,
|
|
271
274
|
name: e.constraint_name()?.accept(this)
|
|
272
275
|
})
|
|
@@ -277,9 +280,9 @@ var y = {
|
|
|
277
280
|
return t.value.name = e.constraint_name()?.accept(this), t;
|
|
278
281
|
}
|
|
279
282
|
if (e.condition()) {
|
|
280
|
-
let t =
|
|
283
|
+
let t = p(e.condition());
|
|
281
284
|
return {
|
|
282
|
-
type:
|
|
285
|
+
type: b.CHECK,
|
|
283
286
|
value: { checks: [{
|
|
284
287
|
name: e.constraint_name()?.accept(this),
|
|
285
288
|
expression: t
|
|
@@ -291,39 +294,39 @@ var y = {
|
|
|
291
294
|
visitOut_of_line_ref_constraint(e) {
|
|
292
295
|
let t = e.constraint_name()?.accept(this), n = e.regular_id().map((e) => e.accept(this)), r = e.references_clause().accept(this);
|
|
293
296
|
return r.endpoints[0].fieldNames = n, t && (r.name = t), {
|
|
294
|
-
type:
|
|
297
|
+
type: b.FK,
|
|
295
298
|
value: r
|
|
296
299
|
};
|
|
297
300
|
}
|
|
298
301
|
visitForeign_key_clause(e) {
|
|
299
|
-
let
|
|
300
|
-
return
|
|
301
|
-
type:
|
|
302
|
-
value:
|
|
302
|
+
let n = e.paren_column_list().accept(this).map((e) => t(e)), r = e.references_clause().accept(this);
|
|
303
|
+
return r.endpoints[0].fieldNames = n, e.on_delete_clause() && (r.onDelete = e.on_delete_clause().accept(this)), {
|
|
304
|
+
type: b.FK,
|
|
305
|
+
value: r
|
|
303
306
|
};
|
|
304
307
|
}
|
|
305
308
|
visitReferences_clause(e) {
|
|
306
|
-
if (!e.paren_column_list()) throw
|
|
307
|
-
let
|
|
308
|
-
return new
|
|
309
|
+
if (!e.paren_column_list()) throw E(e.tableview_name(), "Importing a foreign key with implicit referenced columns is not supported");
|
|
310
|
+
let n = e.tableview_name().accept(this), r = t(n), i = n.length > 1 ? n[n.length - 2] : void 0, o = e.paren_column_list().accept(this).map((e) => t(e));
|
|
311
|
+
return new c({ endpoints: [new a({
|
|
309
312
|
tableName: null,
|
|
310
313
|
schemaName: null,
|
|
311
314
|
fieldNames: [],
|
|
312
|
-
relation:
|
|
313
|
-
}), new
|
|
315
|
+
relation: h
|
|
316
|
+
}), new a({
|
|
314
317
|
tableName: r,
|
|
315
318
|
schemaName: i,
|
|
316
319
|
fieldNames: o,
|
|
317
|
-
relation:
|
|
320
|
+
relation: g
|
|
318
321
|
})] });
|
|
319
322
|
}
|
|
320
323
|
visitOn_delete_clause(e) {
|
|
321
324
|
return e.CASCADE() ? "cascade" : e.SET() && e.NULL_() ? "set null" : null;
|
|
322
325
|
}
|
|
323
326
|
visitCheck_constraint(e) {
|
|
324
|
-
let t =
|
|
327
|
+
let t = p(e.condition());
|
|
325
328
|
return {
|
|
326
|
-
type: e.isColumn ?
|
|
329
|
+
type: e.isColumn ? x.CHECK : b.CHECK,
|
|
327
330
|
value: { checks: [{ expression: t }] }
|
|
328
331
|
};
|
|
329
332
|
}
|
|
@@ -344,70 +347,70 @@ var y = {
|
|
|
344
347
|
return [e.identifier().accept(this)].concat(e.id_expression().map((e) => e.accept(this)));
|
|
345
348
|
}
|
|
346
349
|
visitIdentifier(e) {
|
|
347
|
-
return
|
|
350
|
+
return D(p(e));
|
|
348
351
|
}
|
|
349
352
|
visitType_name(e) {
|
|
350
|
-
let
|
|
353
|
+
let n = e.id_expression().map((e) => e.accept(this));
|
|
351
354
|
return {
|
|
352
|
-
type_name:
|
|
353
|
-
schemaName:
|
|
355
|
+
type_name: t(n),
|
|
356
|
+
schemaName: n.length > 1 ? n[n.length - 2] : void 0
|
|
354
357
|
};
|
|
355
358
|
}
|
|
356
359
|
visitDatatype(e) {
|
|
357
|
-
return { type_name:
|
|
360
|
+
return { type_name: D(p(e)) };
|
|
358
361
|
}
|
|
359
362
|
visitComment_on_table(e) {
|
|
360
|
-
let
|
|
361
|
-
if (!
|
|
362
|
-
|
|
363
|
+
let n = e.tableview_name().accept(this), r = t(n), i = n.length > 1 ? n[n.length - 2] : void 0, a = S(this.data.tables, i, r);
|
|
364
|
+
if (!a) throw E(e.tableview_name(), `Table "${r}" not found`);
|
|
365
|
+
a.note = { value: e.quoted_string().accept(this) };
|
|
363
366
|
}
|
|
364
367
|
visitComment_on_column(e) {
|
|
365
|
-
let
|
|
366
|
-
|
|
367
|
-
let
|
|
368
|
-
|
|
369
|
-
let
|
|
370
|
-
if (!
|
|
371
|
-
let
|
|
372
|
-
if (!
|
|
373
|
-
|
|
368
|
+
let n = e.column_name().accept(this), r = t(n);
|
|
369
|
+
n.pop();
|
|
370
|
+
let i = t(n);
|
|
371
|
+
n.pop();
|
|
372
|
+
let a = t(n), o = S(this.data.tables, a, i);
|
|
373
|
+
if (!o) throw E(e.column_name(), `Table "${i}" not found`);
|
|
374
|
+
let s = C(o, r);
|
|
375
|
+
if (!s) throw E(e.column_name(), `Column "${r}" not found in table "${i}"`);
|
|
376
|
+
s.note = { value: e.quoted_string().accept(this) };
|
|
374
377
|
}
|
|
375
378
|
visitAlter_table(e) {
|
|
376
|
-
let
|
|
377
|
-
if (!
|
|
378
|
-
function
|
|
379
|
+
let n = e.tableview_name().accept(this), r = t(n), i = n.length > 1 ? n[n.length - 2] : void 0, a = S(this.data.tables, i, r);
|
|
380
|
+
if (!a) throw E(e.tableview_name(), `Table "${r}" not found`);
|
|
381
|
+
function o(e, t) {
|
|
379
382
|
switch (t.type) {
|
|
380
|
-
case y.FK:
|
|
381
383
|
case b.FK:
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
case y.CHECK:
|
|
385
|
-
i.checks ||= [], i.checks.push(...t.value.checks);
|
|
384
|
+
case x.FK:
|
|
385
|
+
t.value.endpoints[0].tableName = r, t.value.endpoints[0].schemaName = i, this.data.refs.push(t.value);
|
|
386
386
|
break;
|
|
387
387
|
case b.CHECK:
|
|
388
|
-
|
|
388
|
+
a.checks ||= [], a.checks.push(...t.value.checks);
|
|
389
389
|
break;
|
|
390
|
-
case
|
|
390
|
+
case x.CHECK:
|
|
391
|
+
e.checks || (a.checks = []), e.checks.push(...t.value.checks);
|
|
392
|
+
break;
|
|
393
|
+
case x.PK:
|
|
391
394
|
e.pk = !0, e.unique = void 0;
|
|
392
395
|
break;
|
|
393
|
-
case
|
|
396
|
+
case x.UNIQUE:
|
|
394
397
|
e.unique = !0;
|
|
395
398
|
break;
|
|
396
|
-
case
|
|
397
|
-
case
|
|
398
|
-
case
|
|
399
|
-
|
|
399
|
+
case b.UNIQUE:
|
|
400
|
+
case b.INDEX:
|
|
401
|
+
case b.PK:
|
|
402
|
+
a.indexes ||= [], a.indexes.push(t.value);
|
|
400
403
|
break;
|
|
401
|
-
case
|
|
404
|
+
case x.DEFAULT:
|
|
402
405
|
e.dbdefault = t.value.dbdefault;
|
|
403
406
|
break;
|
|
404
|
-
case
|
|
407
|
+
case x.NOT_NULL:
|
|
405
408
|
e.not_null = !0;
|
|
406
409
|
break;
|
|
407
|
-
case
|
|
410
|
+
case x.NULLABLE:
|
|
408
411
|
e.not_null = !1;
|
|
409
412
|
break;
|
|
410
|
-
case
|
|
413
|
+
case x.INCREMENT:
|
|
411
414
|
e.increment = !0;
|
|
412
415
|
break;
|
|
413
416
|
default:
|
|
@@ -417,9 +420,9 @@ var y = {
|
|
|
417
420
|
column: null,
|
|
418
421
|
constraints: e.constraint_clauses().accept(this)
|
|
419
422
|
}] : e.column_clauses().accept(this)).forEach((t) => {
|
|
420
|
-
let
|
|
421
|
-
if (t.column !== null && !
|
|
422
|
-
t.constraints.forEach((e) =>
|
|
423
|
+
let n = t.column === null ? null : C(a, t.column);
|
|
424
|
+
if (t.column !== null && !n) throw E(e.tableview_name(), `Column "${t.column}" not found on Table "${r}"`);
|
|
425
|
+
t.constraints.forEach((e) => o.bind(this)(n, e));
|
|
423
426
|
});
|
|
424
427
|
}
|
|
425
428
|
visitColumn_clauses(e) {
|
|
@@ -436,17 +439,17 @@ var y = {
|
|
|
436
439
|
return e.modify_col_properties().map((e) => e.accept(this));
|
|
437
440
|
}
|
|
438
441
|
visitModify_col_properties(e) {
|
|
439
|
-
let
|
|
442
|
+
let n = [], r = t(e.column_name().accept(this));
|
|
440
443
|
if (e.DEFAULT()) {
|
|
441
|
-
let
|
|
442
|
-
|
|
443
|
-
type:
|
|
444
|
-
value: { dbdefault:
|
|
444
|
+
let t = e.expression().accept(this);
|
|
445
|
+
n.push({
|
|
446
|
+
type: x.DEFAULT,
|
|
447
|
+
value: { dbdefault: w(t) }
|
|
445
448
|
});
|
|
446
|
-
} else e.inline_constraint() &&
|
|
449
|
+
} else e.inline_constraint() && n.push(...e.inline_constraint().map((e) => e.accept(this)));
|
|
447
450
|
return {
|
|
448
|
-
column:
|
|
449
|
-
constraints:
|
|
451
|
+
column: r,
|
|
452
|
+
constraints: n
|
|
450
453
|
};
|
|
451
454
|
}
|
|
452
455
|
visitConstraint_clauses(e) {
|
|
@@ -454,13 +457,13 @@ var y = {
|
|
|
454
457
|
}
|
|
455
458
|
visitCreate_index(e) {
|
|
456
459
|
if (!e.table_index_clause()) return;
|
|
457
|
-
let
|
|
458
|
-
if (!
|
|
459
|
-
|
|
460
|
-
name:
|
|
460
|
+
let n = !!e.UNIQUE(), r = !!e.BITMAP(), i = e.index_name().accept(this), { names: a, columns: o } = e.table_index_clause().accept(this), c = t(a), l = a.length > 1 ? a[a.length - 2] : void 0, u = S(this.data.tables, l, c);
|
|
461
|
+
if (!u) throw E(e.table_index_clause(), `Table ${c} not found`);
|
|
462
|
+
u.indexes ||= [], u.indexes.push(new s({
|
|
463
|
+
name: i,
|
|
461
464
|
columns: o,
|
|
462
|
-
unique:
|
|
463
|
-
type:
|
|
465
|
+
unique: n,
|
|
466
|
+
type: r ? "bitmap" : void 0
|
|
464
467
|
}));
|
|
465
468
|
}
|
|
466
469
|
visitTable_index_clause(e) {
|
|
@@ -470,22 +473,22 @@ var y = {
|
|
|
470
473
|
};
|
|
471
474
|
}
|
|
472
475
|
visitConstraint_name(e) {
|
|
473
|
-
return
|
|
476
|
+
return D(p(e));
|
|
474
477
|
}
|
|
475
478
|
visitIndex_name(e) {
|
|
476
479
|
return e.identifier().accept(this);
|
|
477
480
|
}
|
|
478
481
|
visitIndex_expr(e) {
|
|
479
482
|
if (e.expression()) {
|
|
480
|
-
let t =
|
|
483
|
+
let t = T(e.expression().accept(this));
|
|
481
484
|
return {
|
|
482
485
|
value: t.value,
|
|
483
486
|
type: t.type
|
|
484
487
|
};
|
|
485
488
|
}
|
|
486
489
|
return {
|
|
487
|
-
value:
|
|
488
|
-
type:
|
|
490
|
+
value: t(e.column_name().accept(this)),
|
|
491
|
+
type: d.COLUMN
|
|
489
492
|
};
|
|
490
493
|
}
|
|
491
494
|
visitInsert_statement(e) {
|
|
@@ -494,7 +497,7 @@ var y = {
|
|
|
494
497
|
visitSingle_table_insert(e) {
|
|
495
498
|
let t = e.insert_into_clause().accept(this), n = e.values_clause().accept(this);
|
|
496
499
|
if (t && n) {
|
|
497
|
-
let { tableName: e, schemaName: r, columns: i } = t, { values: a } = n, o = new
|
|
500
|
+
let { tableName: e, schemaName: r, columns: i } = t, { values: a } = n, o = new u({
|
|
498
501
|
schemaName: r,
|
|
499
502
|
tableName: e,
|
|
500
503
|
columns: i,
|
|
@@ -515,7 +518,7 @@ var y = {
|
|
|
515
518
|
values: a
|
|
516
519
|
});
|
|
517
520
|
}), n.forEach((e) => {
|
|
518
|
-
let t = new
|
|
521
|
+
let t = new u({
|
|
519
522
|
schemaName: e.schemaName,
|
|
520
523
|
tableName: e.tableName,
|
|
521
524
|
columns: e.columns,
|
|
@@ -538,11 +541,11 @@ var y = {
|
|
|
538
541
|
return null;
|
|
539
542
|
}
|
|
540
543
|
visitInsert_into_clause(e) {
|
|
541
|
-
let
|
|
544
|
+
let n = e.general_table_ref().accept(this), r = t(n), i = n.length > 1 ? n[n.length - 2] : void 0;
|
|
542
545
|
return {
|
|
543
|
-
tableName:
|
|
544
|
-
schemaName:
|
|
545
|
-
columns: e.paren_column_list() ? e.paren_column_list().accept(this).map((e) =>
|
|
546
|
+
tableName: r,
|
|
547
|
+
schemaName: i,
|
|
548
|
+
columns: e.paren_column_list() ? e.paren_column_list().accept(this).map((e) => t(e)) : S(this.data.tables, i, r)?.fields.map((e) => e.name)
|
|
546
549
|
};
|
|
547
550
|
}
|
|
548
551
|
visitGeneral_table_ref(e) {
|
|
@@ -556,64 +559,64 @@ var y = {
|
|
|
556
559
|
}
|
|
557
560
|
visitValues_clause(e) {
|
|
558
561
|
return { values: [e.expressions_().accept(this).map((e) => ({
|
|
559
|
-
value: e.type ===
|
|
560
|
-
type: e.type ===
|
|
562
|
+
value: e.type === d.COLUMN ? e.rawValue : e.value,
|
|
563
|
+
type: e.type === d.COLUMN ? f.EXPRESSION : e.type
|
|
561
564
|
}))] };
|
|
562
565
|
}
|
|
563
566
|
visitExpressions_(e) {
|
|
564
567
|
return e.expression().map((e) => e.accept(this));
|
|
565
568
|
}
|
|
566
569
|
visitId_expression(e) {
|
|
567
|
-
return
|
|
570
|
+
return D(p(e));
|
|
568
571
|
}
|
|
569
572
|
visitExpression(e) {
|
|
570
|
-
let t =
|
|
573
|
+
let t = p(e);
|
|
571
574
|
return e.CHAR_STRING() ? {
|
|
572
|
-
type:
|
|
573
|
-
value:
|
|
575
|
+
type: f.STRING,
|
|
576
|
+
value: D(t, "'")
|
|
574
577
|
} : e.TRUE() ? {
|
|
575
|
-
type:
|
|
578
|
+
type: f.BOOLEAN,
|
|
576
579
|
value: !0
|
|
577
580
|
} : e.FALSE() ? {
|
|
578
|
-
type:
|
|
581
|
+
type: f.BOOLEAN,
|
|
579
582
|
value: !1
|
|
580
583
|
} : e.NULL_() ? {
|
|
581
|
-
type:
|
|
584
|
+
type: f.BOOLEAN,
|
|
582
585
|
value: null
|
|
583
586
|
} : e.APPROXIMATE_NUM_LIT() || e.UNSIGNED_INTEGER() ? {
|
|
584
|
-
type:
|
|
587
|
+
type: f.NUMBER,
|
|
585
588
|
value: parseFloat(t)
|
|
586
589
|
} : e.column_name() ? {
|
|
587
|
-
type:
|
|
588
|
-
rawValue:
|
|
589
|
-
value:
|
|
590
|
+
type: d.COLUMN,
|
|
591
|
+
rawValue: D(t),
|
|
592
|
+
value: D(p(e.column_name()))
|
|
590
593
|
} : {
|
|
591
|
-
type:
|
|
594
|
+
type: d.EXPRESSION,
|
|
592
595
|
value: t
|
|
593
596
|
};
|
|
594
597
|
}
|
|
595
598
|
visitQuoted_string(e) {
|
|
596
|
-
return
|
|
599
|
+
return D(p(e), "'");
|
|
597
600
|
}
|
|
598
601
|
visitRegular_id(e) {
|
|
599
|
-
return
|
|
602
|
+
return D(p(e), "\"");
|
|
600
603
|
}
|
|
601
604
|
};
|
|
602
|
-
function
|
|
605
|
+
function k(e, n, r, a) {
|
|
603
606
|
if (!n) return;
|
|
604
|
-
let
|
|
605
|
-
|
|
606
|
-
if (!(n instanceof
|
|
607
|
-
let
|
|
608
|
-
|
|
607
|
+
let o = /* @__PURE__ */ new Set(), s = _(a ?? "", r), c = new v();
|
|
608
|
+
c.enterEveryRule = (n) => {
|
|
609
|
+
if (!(n instanceof i.Tableview_nameContext)) return;
|
|
610
|
+
let c = n.accept(e), l = Array.isArray(c) ? t(c) : c, u = Array.isArray(c) && c.length > 1 ? c[c.length - 2] : void 0, d = _(u ?? "", l);
|
|
611
|
+
d !== s && (o.has(d) || S(e.data.tables, u, l) && (o.add(d), e.data.deps.push({
|
|
609
612
|
edges: [{
|
|
610
613
|
upstream: {
|
|
611
|
-
schemaName:
|
|
612
|
-
tableName:
|
|
614
|
+
schemaName: u,
|
|
615
|
+
tableName: l,
|
|
613
616
|
fieldNames: []
|
|
614
617
|
},
|
|
615
618
|
downstream: {
|
|
616
|
-
schemaName:
|
|
619
|
+
schemaName: a,
|
|
617
620
|
tableName: r,
|
|
618
621
|
fieldNames: []
|
|
619
622
|
}
|
|
@@ -621,7 +624,7 @@ function O(e, n, r, i) {
|
|
|
621
624
|
note: null,
|
|
622
625
|
custom: {}
|
|
623
626
|
})));
|
|
624
|
-
},
|
|
627
|
+
}, y.DEFAULT.walk(c, n);
|
|
625
628
|
}
|
|
626
629
|
//#endregion
|
|
627
|
-
export {
|
|
630
|
+
export { O as default };
|