@nshiab/simple-data-analysis-core 2.0.9 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/class/SDAError.d.ts +6 -6
- package/esm/class/SDAError.js +6 -6
- package/esm/class/Simple.d.ts +9 -9
- package/esm/class/Simple.js +9 -9
- package/esm/class/SimpleDB.d.ts +80 -76
- package/esm/class/SimpleDB.d.ts.map +1 -1
- package/esm/class/SimpleDB.js +80 -76
- package/esm/class/SimpleTable.d.ts +2795 -1139
- package/esm/class/SimpleTable.d.ts.map +1 -1
- package/esm/class/SimpleTable.js +2781 -1149
- package/esm/helpers/buildApproximateMutualReachabilityMst.d.ts +45 -0
- package/esm/helpers/buildApproximateMutualReachabilityMst.d.ts.map +1 -0
- package/esm/helpers/buildApproximateMutualReachabilityMst.js +212 -0
- package/esm/helpers/buildChronologicalGraphComponentsSql.d.ts +14 -0
- package/esm/helpers/buildChronologicalGraphComponentsSql.d.ts.map +1 -0
- package/esm/helpers/buildChronologicalGraphComponentsSql.js +167 -0
- package/esm/helpers/buildExactMutualReachabilityMst.d.ts +28 -0
- package/esm/helpers/buildExactMutualReachabilityMst.d.ts.map +1 -0
- package/esm/helpers/buildExactMutualReachabilityMst.js +97 -0
- package/esm/helpers/buildGraphTemporalCostStateSql.d.ts +12 -0
- package/esm/helpers/buildGraphTemporalCostStateSql.d.ts.map +1 -0
- package/esm/helpers/buildGraphTemporalCostStateSql.js +86 -0
- package/esm/helpers/buildGraphTemporalReachabilitySql.d.ts +13 -0
- package/esm/helpers/buildGraphTemporalReachabilitySql.d.ts.map +1 -0
- package/esm/helpers/buildGraphTemporalReachabilitySql.js +70 -0
- package/esm/helpers/buildSparseMutualReachabilityMst.d.ts +10 -0
- package/esm/helpers/buildSparseMutualReachabilityMst.d.ts.map +1 -0
- package/esm/helpers/buildSparseMutualReachabilityMst.js +47 -0
- package/esm/helpers/buildUmapGraph.d.ts +2 -5
- package/esm/helpers/buildUmapGraph.d.ts.map +1 -1
- package/esm/helpers/buildUmapGraph.js +6 -100
- package/esm/helpers/buildVectorNeighbors.d.ts +45 -0
- package/esm/helpers/buildVectorNeighbors.d.ts.map +1 -0
- package/esm/helpers/buildVectorNeighbors.js +170 -0
- package/esm/helpers/buildWeakGraphComponentsSql.d.ts +3 -0
- package/esm/helpers/buildWeakGraphComponentsSql.d.ts.map +1 -0
- package/esm/helpers/buildWeakGraphComponentsSql.js +32 -0
- package/esm/helpers/camelCase.d.ts +7 -5
- package/esm/helpers/camelCase.d.ts.map +1 -1
- package/esm/helpers/camelCase.js +7 -5
- package/esm/helpers/capitalize.d.ts +6 -4
- package/esm/helpers/capitalize.d.ts.map +1 -1
- package/esm/helpers/capitalize.js +6 -4
- package/esm/helpers/clusterHdbscan.d.ts +18 -0
- package/esm/helpers/clusterHdbscan.d.ts.map +1 -0
- package/esm/helpers/clusterHdbscan.js +342 -0
- package/esm/helpers/computeCovariance.d.ts +16 -0
- package/esm/helpers/computeCovariance.d.ts.map +1 -0
- package/esm/helpers/computeCovariance.js +99 -0
- package/esm/helpers/computeMahalanobisDistances.d.ts +14 -0
- package/esm/helpers/computeMahalanobisDistances.d.ts.map +1 -0
- package/esm/helpers/computeMahalanobisDistances.js +87 -0
- package/esm/helpers/createDirectory.d.ts +4 -3
- package/esm/helpers/createDirectory.d.ts.map +1 -1
- package/esm/helpers/createDirectory.js +4 -3
- package/esm/helpers/dataToArrays.d.ts +6 -4
- package/esm/helpers/dataToArrays.d.ts.map +1 -1
- package/esm/helpers/dataToArrays.js +6 -4
- package/esm/helpers/extractTypes.d.ts +1 -1
- package/esm/helpers/extractTypes.js +4 -9
- package/esm/helpers/factorCovariance.d.ts +17 -0
- package/esm/helpers/factorCovariance.d.ts.map +1 -0
- package/esm/helpers/factorCovariance.js +189 -0
- package/esm/helpers/findGeoColumn.d.ts +6 -4
- package/esm/helpers/findGeoColumn.d.ts.map +1 -1
- package/esm/helpers/findGeoColumn.js +6 -4
- package/esm/helpers/findGeoColumnFromSchema.d.ts +8 -5
- package/esm/helpers/findGeoColumnFromSchema.d.ts.map +1 -1
- package/esm/helpers/findGeoColumnFromSchema.js +8 -5
- package/esm/helpers/formatDate.d.ts +12 -6
- package/esm/helpers/formatDate.d.ts.map +1 -1
- package/esm/helpers/formatDate.js +12 -6
- package/esm/helpers/formatMissingTables.d.ts +8 -5
- package/esm/helpers/formatMissingTables.d.ts.map +1 -1
- package/esm/helpers/formatMissingTables.js +8 -5
- package/esm/helpers/formatNumber.d.ts +19 -10
- package/esm/helpers/formatNumber.d.ts.map +1 -1
- package/esm/helpers/formatNumber.js +32 -17
- package/esm/helpers/getGraphEdgeIdColumn.d.ts +9 -0
- package/esm/helpers/getGraphEdgeIdColumn.d.ts.map +1 -0
- package/esm/helpers/getGraphEdgeIdColumn.js +25 -0
- package/esm/helpers/getGraphEndpointColumns.d.ts +11 -0
- package/esm/helpers/getGraphEndpointColumns.d.ts.map +1 -0
- package/esm/helpers/getGraphEndpointColumns.js +160 -0
- package/esm/helpers/getGraphWeightColumn.d.ts +10 -0
- package/esm/helpers/getGraphWeightColumn.d.ts.map +1 -0
- package/esm/helpers/getGraphWeightColumn.js +40 -0
- package/esm/helpers/graphRouteResultSchema.d.ts +4 -0
- package/esm/helpers/graphRouteResultSchema.d.ts.map +1 -0
- package/esm/helpers/graphRouteResultSchema.js +12 -0
- package/esm/helpers/graphRouteResultSelect.d.ts +4 -0
- package/esm/helpers/graphRouteResultSelect.d.ts.map +1 -0
- package/esm/helpers/graphRouteResultSelect.js +22 -0
- package/esm/helpers/hasGeometryColumn.d.ts +4 -3
- package/esm/helpers/hasGeometryColumn.d.ts.map +1 -1
- package/esm/helpers/hasGeometryColumn.js +4 -3
- package/esm/helpers/inspectGraphConnectivity.d.ts +10 -0
- package/esm/helpers/inspectGraphConnectivity.d.ts.map +1 -0
- package/esm/helpers/inspectGraphConnectivity.js +55 -0
- package/esm/helpers/mergeOptions.d.ts +24 -13
- package/esm/helpers/mergeOptions.d.ts.map +1 -1
- package/esm/helpers/mergeOptions.js +24 -13
- package/esm/helpers/parseValue.d.ts +6 -4
- package/esm/helpers/parseValue.d.ts.map +1 -1
- package/esm/helpers/parseValue.js +6 -4
- package/esm/helpers/prepareGraphRouteSql.d.ts +31 -0
- package/esm/helpers/prepareGraphRouteSql.d.ts.map +1 -0
- package/esm/helpers/prepareGraphRouteSql.js +86 -0
- package/esm/helpers/prepareGraphStarts.d.ts +9 -0
- package/esm/helpers/prepareGraphStarts.d.ts.map +1 -0
- package/esm/helpers/prepareGraphStarts.js +68 -0
- package/esm/helpers/prepareGraphTemporalSql.d.ts +28 -0
- package/esm/helpers/prepareGraphTemporalSql.d.ts.map +1 -0
- package/esm/helpers/prepareGraphTemporalSql.js +154 -0
- package/esm/helpers/prepareGraphTraversal.d.ts +19 -0
- package/esm/helpers/prepareGraphTraversal.d.ts.map +1 -0
- package/esm/helpers/prepareGraphTraversal.js +79 -0
- package/esm/helpers/prepareNumericFeatures.d.ts +41 -0
- package/esm/helpers/prepareNumericFeatures.d.ts.map +1 -0
- package/esm/helpers/prepareNumericFeatures.js +210 -0
- package/esm/helpers/prettyDuration.d.ts +14 -8
- package/esm/helpers/prettyDuration.d.ts.map +1 -1
- package/esm/helpers/prettyDuration.js +14 -8
- package/esm/helpers/printTable.d.ts +18 -13
- package/esm/helpers/printTable.d.ts.map +1 -1
- package/esm/helpers/printTable.js +18 -13
- package/esm/helpers/publishPreparedColumns.d.ts +37 -0
- package/esm/helpers/publishPreparedColumns.d.ts.map +1 -0
- package/esm/helpers/publishPreparedColumns.js +113 -0
- package/esm/helpers/queryDB.d.ts +24 -13
- package/esm/helpers/queryDB.d.ts.map +1 -1
- package/esm/helpers/queryDB.js +24 -13
- package/esm/helpers/queueAsyncBarrier.d.ts +12 -7
- package/esm/helpers/queueAsyncBarrier.d.ts.map +1 -1
- package/esm/helpers/queueAsyncBarrier.js +12 -7
- package/esm/helpers/queueGraphResult.d.ts +18 -0
- package/esm/helpers/queueGraphResult.d.ts.map +1 -0
- package/esm/helpers/queueGraphResult.js +39 -0
- package/esm/helpers/quoteIdentifier.d.ts +4 -3
- package/esm/helpers/quoteIdentifier.d.ts.map +1 -1
- package/esm/helpers/quoteIdentifier.js +4 -3
- package/esm/helpers/quoteQualifiedIdentifier.d.ts +6 -4
- package/esm/helpers/quoteQualifiedIdentifier.d.ts.map +1 -1
- package/esm/helpers/quoteQualifiedIdentifier.js +6 -4
- package/esm/helpers/runQuery.d.ts.map +1 -1
- package/esm/helpers/runQuery.js +17 -3
- package/esm/helpers/selectFuzzyReplacements.d.ts +11 -0
- package/esm/helpers/selectFuzzyReplacements.d.ts.map +1 -0
- package/esm/helpers/selectFuzzyReplacements.js +124 -0
- package/esm/helpers/stabilizeCosineVectors.d.ts +14 -0
- package/esm/helpers/stabilizeCosineVectors.d.ts.map +1 -0
- package/esm/helpers/stabilizeCosineVectors.js +34 -0
- package/esm/helpers/stringToArray.d.ts +4 -3
- package/esm/helpers/stringToArray.d.ts.map +1 -1
- package/esm/helpers/stringToArray.js +4 -3
- package/esm/helpers/updateColumnsWithJS.d.ts +12 -6
- package/esm/helpers/updateColumnsWithJS.d.ts.map +1 -1
- package/esm/helpers/updateColumnsWithJS.js +12 -6
- package/esm/helpers/validateGraphRouteResultSchema.d.ts +4 -0
- package/esm/helpers/validateGraphRouteResultSchema.d.ts.map +1 -0
- package/esm/helpers/validateGraphRouteResultSchema.js +13 -0
- package/esm/helpers/validateGraphTemporalEvents.d.ts +7 -0
- package/esm/helpers/validateGraphTemporalEvents.d.ts.map +1 -0
- package/esm/helpers/validateGraphTemporalEvents.js +47 -0
- package/esm/helpers/validateNumericalAnalysis.d.ts +10 -6
- package/esm/helpers/validateNumericalAnalysis.d.ts.map +1 -1
- package/esm/helpers/validateNumericalAnalysis.js +10 -6
- package/esm/helpers/validateVectorRowIds.d.ts +4 -0
- package/esm/helpers/validateVectorRowIds.d.ts.map +1 -0
- package/esm/helpers/validateVectorRowIds.js +16 -0
- package/esm/helpers/vectorDistanceExpression.d.ts +6 -0
- package/esm/helpers/vectorDistanceExpression.d.ts.map +1 -0
- package/esm/helpers/vectorDistanceExpression.js +11 -0
- package/esm/helpers/wrapString.d.ts +10 -7
- package/esm/helpers/wrapString.d.ts.map +1 -1
- package/esm/helpers/wrapString.js +10 -7
- package/esm/methods/addId.d.ts +5 -0
- package/esm/methods/addId.d.ts.map +1 -0
- package/esm/methods/addId.js +38 -0
- package/esm/methods/commonNeighbors.d.ts +10 -0
- package/esm/methods/commonNeighbors.d.ts.map +1 -0
- package/esm/methods/commonNeighbors.js +101 -0
- package/esm/methods/connectedComponents.d.ts +9 -0
- package/esm/methods/connectedComponents.d.ts.map +1 -0
- package/esm/methods/connectedComponents.js +147 -0
- package/esm/methods/degree.d.ts +9 -0
- package/esm/methods/degree.d.ts.map +1 -0
- package/esm/methods/degree.js +135 -0
- package/esm/methods/distances.d.ts +12 -0
- package/esm/methods/distances.d.ts.map +1 -0
- package/esm/methods/distances.js +164 -0
- package/esm/methods/findCycles.d.ts +12 -0
- package/esm/methods/findCycles.d.ts.map +1 -0
- package/esm/methods/findCycles.js +330 -0
- package/esm/methods/fuzzyClean.d.ts.map +1 -1
- package/esm/methods/fuzzyClean.js +17 -136
- package/esm/methods/fuzzyJoin.js +70 -16
- package/esm/methods/getTypes.d.ts +1 -1
- package/esm/methods/hdbscan.d.ts +5 -0
- package/esm/methods/hdbscan.d.ts.map +1 -0
- package/esm/methods/hdbscan.js +208 -0
- package/esm/methods/mahalanobis.d.ts +5 -0
- package/esm/methods/mahalanobis.d.ts.map +1 -0
- package/esm/methods/mahalanobis.js +92 -0
- package/esm/methods/neighbors.d.ts +9 -0
- package/esm/methods/neighbors.d.ts.map +1 -0
- package/esm/methods/neighbors.js +81 -0
- package/esm/methods/normalizeVector.d.ts +5 -0
- package/esm/methods/normalizeVector.d.ts.map +1 -0
- package/esm/methods/normalizeVector.js +132 -0
- package/esm/methods/paths.d.ts +12 -0
- package/esm/methods/paths.d.ts.map +1 -0
- package/esm/methods/paths.js +287 -0
- package/esm/methods/reachable.d.ts +11 -0
- package/esm/methods/reachable.d.ts.map +1 -0
- package/esm/methods/reachable.js +131 -0
- package/esm/methods/rowToVector.d.ts +5 -0
- package/esm/methods/rowToVector.d.ts.map +1 -0
- package/esm/methods/rowToVector.js +77 -0
- package/esm/methods/shortestPath.d.ts +12 -0
- package/esm/methods/shortestPath.d.ts.map +1 -0
- package/esm/methods/shortestPath.js +337 -0
- package/esm/methods/topologicalSort.d.ts +7 -0
- package/esm/methods/topologicalSort.d.ts.map +1 -0
- package/esm/methods/topologicalSort.js +164 -0
- package/llm.md +2106 -143
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/script/class/SDAError.d.ts +6 -6
- package/script/class/SDAError.js +6 -6
- package/script/class/Simple.d.ts +9 -9
- package/script/class/Simple.js +9 -9
- package/script/class/SimpleDB.d.ts +80 -76
- package/script/class/SimpleDB.d.ts.map +1 -1
- package/script/class/SimpleDB.js +80 -76
- package/script/class/SimpleTable.d.ts +2795 -1139
- package/script/class/SimpleTable.d.ts.map +1 -1
- package/script/class/SimpleTable.js +2781 -1149
- package/script/helpers/buildApproximateMutualReachabilityMst.d.ts +45 -0
- package/script/helpers/buildApproximateMutualReachabilityMst.d.ts.map +1 -0
- package/script/helpers/buildApproximateMutualReachabilityMst.js +219 -0
- package/script/helpers/buildChronologicalGraphComponentsSql.d.ts +14 -0
- package/script/helpers/buildChronologicalGraphComponentsSql.d.ts.map +1 -0
- package/script/helpers/buildChronologicalGraphComponentsSql.js +174 -0
- package/script/helpers/buildExactMutualReachabilityMst.d.ts +28 -0
- package/script/helpers/buildExactMutualReachabilityMst.d.ts.map +1 -0
- package/script/helpers/buildExactMutualReachabilityMst.js +103 -0
- package/script/helpers/buildGraphTemporalCostStateSql.d.ts +12 -0
- package/script/helpers/buildGraphTemporalCostStateSql.d.ts.map +1 -0
- package/script/helpers/buildGraphTemporalCostStateSql.js +92 -0
- package/script/helpers/buildGraphTemporalReachabilitySql.d.ts +13 -0
- package/script/helpers/buildGraphTemporalReachabilitySql.d.ts.map +1 -0
- package/script/helpers/buildGraphTemporalReachabilitySql.js +76 -0
- package/script/helpers/buildSparseMutualReachabilityMst.d.ts +10 -0
- package/script/helpers/buildSparseMutualReachabilityMst.d.ts.map +1 -0
- package/script/helpers/buildSparseMutualReachabilityMst.js +50 -0
- package/script/helpers/buildUmapGraph.d.ts +2 -5
- package/script/helpers/buildUmapGraph.d.ts.map +1 -1
- package/script/helpers/buildUmapGraph.js +6 -100
- package/script/helpers/buildVectorNeighbors.d.ts +45 -0
- package/script/helpers/buildVectorNeighbors.d.ts.map +1 -0
- package/script/helpers/buildVectorNeighbors.js +176 -0
- package/script/helpers/buildWeakGraphComponentsSql.d.ts +3 -0
- package/script/helpers/buildWeakGraphComponentsSql.d.ts.map +1 -0
- package/script/helpers/buildWeakGraphComponentsSql.js +38 -0
- package/script/helpers/camelCase.d.ts +7 -5
- package/script/helpers/camelCase.d.ts.map +1 -1
- package/script/helpers/camelCase.js +7 -5
- package/script/helpers/capitalize.d.ts +6 -4
- package/script/helpers/capitalize.d.ts.map +1 -1
- package/script/helpers/capitalize.js +6 -4
- package/script/helpers/clusterHdbscan.d.ts +18 -0
- package/script/helpers/clusterHdbscan.d.ts.map +1 -0
- package/script/helpers/clusterHdbscan.js +346 -0
- package/script/helpers/computeCovariance.d.ts +16 -0
- package/script/helpers/computeCovariance.d.ts.map +1 -0
- package/script/helpers/computeCovariance.js +105 -0
- package/script/helpers/computeMahalanobisDistances.d.ts +14 -0
- package/script/helpers/computeMahalanobisDistances.d.ts.map +1 -0
- package/script/helpers/computeMahalanobisDistances.js +93 -0
- package/script/helpers/createDirectory.d.ts +4 -3
- package/script/helpers/createDirectory.d.ts.map +1 -1
- package/script/helpers/createDirectory.js +4 -3
- package/script/helpers/dataToArrays.d.ts +6 -4
- package/script/helpers/dataToArrays.d.ts.map +1 -1
- package/script/helpers/dataToArrays.js +6 -4
- package/script/helpers/extractTypes.d.ts +1 -1
- package/script/helpers/extractTypes.js +4 -9
- package/script/helpers/factorCovariance.d.ts +17 -0
- package/script/helpers/factorCovariance.d.ts.map +1 -0
- package/script/helpers/factorCovariance.js +194 -0
- package/script/helpers/findGeoColumn.d.ts +6 -4
- package/script/helpers/findGeoColumn.d.ts.map +1 -1
- package/script/helpers/findGeoColumn.js +6 -4
- package/script/helpers/findGeoColumnFromSchema.d.ts +8 -5
- package/script/helpers/findGeoColumnFromSchema.d.ts.map +1 -1
- package/script/helpers/findGeoColumnFromSchema.js +8 -5
- package/script/helpers/formatDate.d.ts +12 -6
- package/script/helpers/formatDate.d.ts.map +1 -1
- package/script/helpers/formatDate.js +12 -6
- package/script/helpers/formatMissingTables.d.ts +8 -5
- package/script/helpers/formatMissingTables.d.ts.map +1 -1
- package/script/helpers/formatMissingTables.js +8 -5
- package/script/helpers/formatNumber.d.ts +19 -10
- package/script/helpers/formatNumber.d.ts.map +1 -1
- package/script/helpers/formatNumber.js +32 -17
- package/script/helpers/getGraphEdgeIdColumn.d.ts +9 -0
- package/script/helpers/getGraphEdgeIdColumn.d.ts.map +1 -0
- package/script/helpers/getGraphEdgeIdColumn.js +31 -0
- package/script/helpers/getGraphEndpointColumns.d.ts +11 -0
- package/script/helpers/getGraphEndpointColumns.d.ts.map +1 -0
- package/script/helpers/getGraphEndpointColumns.js +166 -0
- package/script/helpers/getGraphWeightColumn.d.ts +10 -0
- package/script/helpers/getGraphWeightColumn.d.ts.map +1 -0
- package/script/helpers/getGraphWeightColumn.js +46 -0
- package/script/helpers/graphRouteResultSchema.d.ts +4 -0
- package/script/helpers/graphRouteResultSchema.d.ts.map +1 -0
- package/script/helpers/graphRouteResultSchema.js +18 -0
- package/script/helpers/graphRouteResultSelect.d.ts +4 -0
- package/script/helpers/graphRouteResultSelect.d.ts.map +1 -0
- package/script/helpers/graphRouteResultSelect.js +28 -0
- package/script/helpers/hasGeometryColumn.d.ts +4 -3
- package/script/helpers/hasGeometryColumn.d.ts.map +1 -1
- package/script/helpers/hasGeometryColumn.js +4 -3
- package/script/helpers/inspectGraphConnectivity.d.ts +10 -0
- package/script/helpers/inspectGraphConnectivity.d.ts.map +1 -0
- package/script/helpers/inspectGraphConnectivity.js +58 -0
- package/script/helpers/mergeOptions.d.ts +24 -13
- package/script/helpers/mergeOptions.d.ts.map +1 -1
- package/script/helpers/mergeOptions.js +24 -13
- package/script/helpers/parseValue.d.ts +6 -4
- package/script/helpers/parseValue.d.ts.map +1 -1
- package/script/helpers/parseValue.js +6 -4
- package/script/helpers/prepareGraphRouteSql.d.ts +31 -0
- package/script/helpers/prepareGraphRouteSql.d.ts.map +1 -0
- package/script/helpers/prepareGraphRouteSql.js +127 -0
- package/script/helpers/prepareGraphStarts.d.ts +9 -0
- package/script/helpers/prepareGraphStarts.d.ts.map +1 -0
- package/script/helpers/prepareGraphStarts.js +71 -0
- package/script/helpers/prepareGraphTemporalSql.d.ts +28 -0
- package/script/helpers/prepareGraphTemporalSql.d.ts.map +1 -0
- package/script/helpers/prepareGraphTemporalSql.js +161 -0
- package/script/helpers/prepareGraphTraversal.d.ts +19 -0
- package/script/helpers/prepareGraphTraversal.d.ts.map +1 -0
- package/script/helpers/prepareGraphTraversal.js +87 -0
- package/script/helpers/prepareNumericFeatures.d.ts +41 -0
- package/script/helpers/prepareNumericFeatures.d.ts.map +1 -0
- package/script/helpers/prepareNumericFeatures.js +217 -0
- package/script/helpers/prettyDuration.d.ts +14 -8
- package/script/helpers/prettyDuration.d.ts.map +1 -1
- package/script/helpers/prettyDuration.js +14 -8
- package/script/helpers/printTable.d.ts +18 -13
- package/script/helpers/printTable.d.ts.map +1 -1
- package/script/helpers/printTable.js +18 -13
- package/script/helpers/publishPreparedColumns.d.ts +37 -0
- package/script/helpers/publishPreparedColumns.d.ts.map +1 -0
- package/script/helpers/publishPreparedColumns.js +119 -0
- package/script/helpers/queryDB.d.ts +24 -13
- package/script/helpers/queryDB.d.ts.map +1 -1
- package/script/helpers/queryDB.js +24 -13
- package/script/helpers/queueAsyncBarrier.d.ts +12 -7
- package/script/helpers/queueAsyncBarrier.d.ts.map +1 -1
- package/script/helpers/queueAsyncBarrier.js +12 -7
- package/script/helpers/queueGraphResult.d.ts +18 -0
- package/script/helpers/queueGraphResult.d.ts.map +1 -0
- package/script/helpers/queueGraphResult.js +45 -0
- package/script/helpers/quoteIdentifier.d.ts +4 -3
- package/script/helpers/quoteIdentifier.d.ts.map +1 -1
- package/script/helpers/quoteIdentifier.js +4 -3
- package/script/helpers/quoteQualifiedIdentifier.d.ts +6 -4
- package/script/helpers/quoteQualifiedIdentifier.d.ts.map +1 -1
- package/script/helpers/quoteQualifiedIdentifier.js +6 -4
- package/script/helpers/runQuery.d.ts.map +1 -1
- package/script/helpers/runQuery.js +17 -3
- package/script/helpers/selectFuzzyReplacements.d.ts +11 -0
- package/script/helpers/selectFuzzyReplacements.d.ts.map +1 -0
- package/script/helpers/selectFuzzyReplacements.js +127 -0
- package/script/helpers/stabilizeCosineVectors.d.ts +14 -0
- package/script/helpers/stabilizeCosineVectors.d.ts.map +1 -0
- package/script/helpers/stabilizeCosineVectors.js +40 -0
- package/script/helpers/stringToArray.d.ts +4 -3
- package/script/helpers/stringToArray.d.ts.map +1 -1
- package/script/helpers/stringToArray.js +4 -3
- package/script/helpers/updateColumnsWithJS.d.ts +12 -6
- package/script/helpers/updateColumnsWithJS.d.ts.map +1 -1
- package/script/helpers/updateColumnsWithJS.js +12 -6
- package/script/helpers/validateGraphRouteResultSchema.d.ts +4 -0
- package/script/helpers/validateGraphRouteResultSchema.d.ts.map +1 -0
- package/script/helpers/validateGraphRouteResultSchema.js +19 -0
- package/script/helpers/validateGraphTemporalEvents.d.ts +7 -0
- package/script/helpers/validateGraphTemporalEvents.d.ts.map +1 -0
- package/script/helpers/validateGraphTemporalEvents.js +53 -0
- package/script/helpers/validateNumericalAnalysis.d.ts +10 -6
- package/script/helpers/validateNumericalAnalysis.d.ts.map +1 -1
- package/script/helpers/validateNumericalAnalysis.js +10 -6
- package/script/helpers/validateVectorRowIds.d.ts +4 -0
- package/script/helpers/validateVectorRowIds.d.ts.map +1 -0
- package/script/helpers/validateVectorRowIds.js +19 -0
- package/script/helpers/vectorDistanceExpression.d.ts +6 -0
- package/script/helpers/vectorDistanceExpression.d.ts.map +1 -0
- package/script/helpers/vectorDistanceExpression.js +14 -0
- package/script/helpers/wrapString.d.ts +10 -7
- package/script/helpers/wrapString.d.ts.map +1 -1
- package/script/helpers/wrapString.js +10 -7
- package/script/methods/addId.d.ts +5 -0
- package/script/methods/addId.d.ts.map +1 -0
- package/script/methods/addId.js +44 -0
- package/script/methods/commonNeighbors.d.ts +10 -0
- package/script/methods/commonNeighbors.d.ts.map +1 -0
- package/script/methods/commonNeighbors.js +140 -0
- package/script/methods/connectedComponents.d.ts +9 -0
- package/script/methods/connectedComponents.d.ts.map +1 -0
- package/script/methods/connectedComponents.js +186 -0
- package/script/methods/degree.d.ts +9 -0
- package/script/methods/degree.d.ts.map +1 -0
- package/script/methods/degree.js +141 -0
- package/script/methods/distances.d.ts +12 -0
- package/script/methods/distances.d.ts.map +1 -0
- package/script/methods/distances.js +203 -0
- package/script/methods/findCycles.d.ts +12 -0
- package/script/methods/findCycles.d.ts.map +1 -0
- package/script/methods/findCycles.js +369 -0
- package/script/methods/fuzzyClean.d.ts.map +1 -1
- package/script/methods/fuzzyClean.js +17 -136
- package/script/methods/fuzzyJoin.js +70 -16
- package/script/methods/getTypes.d.ts +1 -1
- package/script/methods/hdbscan.d.ts +5 -0
- package/script/methods/hdbscan.d.ts.map +1 -0
- package/script/methods/hdbscan.js +214 -0
- package/script/methods/mahalanobis.d.ts +5 -0
- package/script/methods/mahalanobis.d.ts.map +1 -0
- package/script/methods/mahalanobis.js +98 -0
- package/script/methods/neighbors.d.ts +9 -0
- package/script/methods/neighbors.d.ts.map +1 -0
- package/script/methods/neighbors.js +120 -0
- package/script/methods/normalizeVector.d.ts +5 -0
- package/script/methods/normalizeVector.d.ts.map +1 -0
- package/script/methods/normalizeVector.js +138 -0
- package/script/methods/paths.d.ts +12 -0
- package/script/methods/paths.d.ts.map +1 -0
- package/script/methods/paths.js +326 -0
- package/script/methods/reachable.d.ts +11 -0
- package/script/methods/reachable.d.ts.map +1 -0
- package/script/methods/reachable.js +170 -0
- package/script/methods/rowToVector.d.ts +5 -0
- package/script/methods/rowToVector.d.ts.map +1 -0
- package/script/methods/rowToVector.js +83 -0
- package/script/methods/shortestPath.d.ts +12 -0
- package/script/methods/shortestPath.d.ts.map +1 -0
- package/script/methods/shortestPath.js +376 -0
- package/script/methods/topologicalSort.d.ts +7 -0
- package/script/methods/topologicalSort.d.ts.map +1 -0
- package/script/methods/topologicalSort.js +170 -0
package/llms.txt
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> Lightweight DuckDB-powered TypeScript library for tabular, SQL, CSV, Parquet, and geospatial data analysis on Deno, Node.js, and Bun.
|
|
4
4
|
|
|
5
5
|
- Package: `@nshiab/simple-data-analysis-core`
|
|
6
|
-
- Version: `2.0
|
|
6
|
+
- Version: `2.1.0`
|
|
7
7
|
|
|
8
8
|
Install with Deno: `deno add jsr:@nshiab/simple-data-analysis-core`
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nshiab/simple-data-analysis-core",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Lightweight DuckDB-powered TypeScript library for tabular, SQL, CSV, Parquet, and geospatial data analysis on Deno, Node.js, and Bun.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-analysis",
|
|
@@ -34,12 +34,6 @@ export default class SDAError extends Error {
|
|
|
34
34
|
/**
|
|
35
35
|
* Creates an error that preserves the failing query and its original cause.
|
|
36
36
|
*
|
|
37
|
-
* @param options - Details of the failed query.
|
|
38
|
-
* @param options.method - The SDA method that triggered the query, or `null`.
|
|
39
|
-
* @param options.parameters - The method's arguments, or `null`.
|
|
40
|
-
* @param options.query - The SQL statement that failed.
|
|
41
|
-
* @param options.cause - The original error thrown while executing the query.
|
|
42
|
-
*
|
|
43
37
|
* @example
|
|
44
38
|
* ```ts
|
|
45
39
|
* const error = new SDAError({
|
|
@@ -50,6 +44,12 @@ export default class SDAError extends Error {
|
|
|
50
44
|
* });
|
|
51
45
|
* console.log(error.method, error.cause);
|
|
52
46
|
* ```
|
|
47
|
+
*
|
|
48
|
+
* @param options - Details of the failed query.
|
|
49
|
+
* @param options.method - The SDA method that triggered the query, or `null`.
|
|
50
|
+
* @param options.parameters - The method's arguments, or `null`.
|
|
51
|
+
* @param options.query - The SQL statement that failed.
|
|
52
|
+
* @param options.cause - The original error thrown while executing the query.
|
|
53
53
|
*/
|
|
54
54
|
constructor(options: {
|
|
55
55
|
method: string | null;
|
package/script/class/SDAError.js
CHANGED
|
@@ -22,12 +22,6 @@ class SDAError extends Error {
|
|
|
22
22
|
/**
|
|
23
23
|
* Creates an error that preserves the failing query and its original cause.
|
|
24
24
|
*
|
|
25
|
-
* @param options - Details of the failed query.
|
|
26
|
-
* @param options.method - The SDA method that triggered the query, or `null`.
|
|
27
|
-
* @param options.parameters - The method's arguments, or `null`.
|
|
28
|
-
* @param options.query - The SQL statement that failed.
|
|
29
|
-
* @param options.cause - The original error thrown while executing the query.
|
|
30
|
-
*
|
|
31
25
|
* @example
|
|
32
26
|
* ```ts
|
|
33
27
|
* const error = new SDAError({
|
|
@@ -38,6 +32,12 @@ class SDAError extends Error {
|
|
|
38
32
|
* });
|
|
39
33
|
* console.log(error.method, error.cause);
|
|
40
34
|
* ```
|
|
35
|
+
*
|
|
36
|
+
* @param options - Details of the failed query.
|
|
37
|
+
* @param options.method - The SDA method that triggered the query, or `null`.
|
|
38
|
+
* @param options.parameters - The method's arguments, or `null`.
|
|
39
|
+
* @param options.query - The SQL statement that failed.
|
|
40
|
+
* @param options.cause - The original error thrown while executing the query.
|
|
41
41
|
*/
|
|
42
42
|
constructor(options) {
|
|
43
43
|
let causeMessage = options.cause instanceof Error
|
package/script/class/Simple.d.ts
CHANGED
|
@@ -48,6 +48,15 @@ export default class Simple {
|
|
|
48
48
|
* execution while forwarding every argument. To run custom SQL, use
|
|
49
49
|
* `SimpleDB.customQuery()` instead.
|
|
50
50
|
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const original = table.runQuery;
|
|
54
|
+
* table.runQuery = (query, connection, returnData, options) => {
|
|
55
|
+
* console.log(query);
|
|
56
|
+
* return original(query, connection, returnData, options);
|
|
57
|
+
* };
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
51
60
|
* @param query - The exact SQL statement to execute.
|
|
52
61
|
* @param connection - The DuckDB connection that executes the statement.
|
|
53
62
|
* @param returnData - Whether to convert and return result rows.
|
|
@@ -59,15 +68,6 @@ export default class Simple {
|
|
|
59
68
|
* @param options.logSQL - Whether to log the SQL immediately before execution.
|
|
60
69
|
* @param options.explainSQL - Whether to log a supported DuckDB query plan before execution.
|
|
61
70
|
* @returns The converted rows when requested, otherwise `null`.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```ts
|
|
65
|
-
* const original = table.runQuery;
|
|
66
|
-
* table.runQuery = (query, connection, returnData, options) => {
|
|
67
|
-
* console.log(query);
|
|
68
|
-
* return original(query, connection, returnData, options);
|
|
69
|
-
* };
|
|
70
|
-
* ```
|
|
71
71
|
*/
|
|
72
72
|
runQuery: (query: string, connection: DuckDBConnection, returnData: boolean, options: {
|
|
73
73
|
method: string | null;
|
package/script/class/Simple.js
CHANGED
|
@@ -80,6 +80,15 @@ class Simple {
|
|
|
80
80
|
* execution while forwarding every argument. To run custom SQL, use
|
|
81
81
|
* `SimpleDB.customQuery()` instead.
|
|
82
82
|
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const original = table.runQuery;
|
|
86
|
+
* table.runQuery = (query, connection, returnData, options) => {
|
|
87
|
+
* console.log(query);
|
|
88
|
+
* return original(query, connection, returnData, options);
|
|
89
|
+
* };
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
83
92
|
* @param query - The exact SQL statement to execute.
|
|
84
93
|
* @param connection - The DuckDB connection that executes the statement.
|
|
85
94
|
* @param returnData - Whether to convert and return result rows.
|
|
@@ -91,15 +100,6 @@ class Simple {
|
|
|
91
100
|
* @param options.logSQL - Whether to log the SQL immediately before execution.
|
|
92
101
|
* @param options.explainSQL - Whether to log a supported DuckDB query plan before execution.
|
|
93
102
|
* @returns The converted rows when requested, otherwise `null`.
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* ```ts
|
|
97
|
-
* const original = table.runQuery;
|
|
98
|
-
* table.runQuery = (query, connection, returnData, options) => {
|
|
99
|
-
* console.log(query);
|
|
100
|
-
* return original(query, connection, returnData, options);
|
|
101
|
-
* };
|
|
102
|
-
* ```
|
|
103
103
|
*/
|
|
104
104
|
Object.defineProperty(this, "runQuery", {
|
|
105
105
|
enumerable: true,
|
|
@@ -47,8 +47,6 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
47
47
|
* `"sql"` passes SQL through unchanged, including `||` and null comparisons.
|
|
48
48
|
* Choose the syntax when constructing the database; it applies to all tables.
|
|
49
49
|
*
|
|
50
|
-
* @defaultValue `"js"`
|
|
51
|
-
* @category Properties
|
|
52
50
|
* @example
|
|
53
51
|
* ```ts
|
|
54
52
|
* const sdb = new SimpleDB({ expressionSyntax: "js" }); // The default mode
|
|
@@ -101,28 +99,33 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
101
99
|
* await sdb.newTable().loadArray([{ active: true, age: 18, admin: false }])
|
|
102
100
|
* .filter("(active AND age >= 18) OR admin").log();
|
|
103
101
|
* ```
|
|
102
|
+
*
|
|
103
|
+
* @defaultValue `"js"`
|
|
104
|
+
* @category Properties
|
|
104
105
|
*/
|
|
105
106
|
readonly expressionSyntax: "js" | "sql";
|
|
106
107
|
/**
|
|
107
108
|
* Whether to log each SQL statement immediately before execution.
|
|
108
109
|
*
|
|
109
|
-
* @defaultValue `false`
|
|
110
|
-
* @category Properties
|
|
111
110
|
* @example
|
|
112
111
|
* ```ts
|
|
113
112
|
* const sdb = new SimpleDB({ logSQL: true });
|
|
114
113
|
* ```
|
|
114
|
+
*
|
|
115
|
+
* @defaultValue `false`
|
|
116
|
+
* @category Properties
|
|
115
117
|
*/
|
|
116
118
|
logSQL: boolean;
|
|
117
119
|
/**
|
|
118
120
|
* Whether to log DuckDB query plans before supported statements execute.
|
|
119
121
|
*
|
|
120
|
-
* @defaultValue `false`
|
|
121
|
-
* @category Properties
|
|
122
122
|
* @example
|
|
123
123
|
* ```ts
|
|
124
124
|
* const sdb = new SimpleDB({ explainSQL: true });
|
|
125
125
|
* ```
|
|
126
|
+
*
|
|
127
|
+
* @defaultValue `false`
|
|
128
|
+
* @category Properties
|
|
126
129
|
*/
|
|
127
130
|
explainSQL: boolean;
|
|
128
131
|
/**
|
|
@@ -263,8 +266,6 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
263
266
|
* Whether the persistent DuckDB file is opened read-only. Requires an existing
|
|
264
267
|
* file and cannot be combined with `overwrite`. DuckDB rejects writes to it.
|
|
265
268
|
*
|
|
266
|
-
* @defaultValue `false`
|
|
267
|
-
* @category Properties
|
|
268
269
|
* @example
|
|
269
270
|
* ```ts
|
|
270
271
|
* const sdb = new SimpleDB({ file: "./archive.duckdb", readOnly: true });
|
|
@@ -272,6 +273,9 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
272
273
|
* await table.log();
|
|
273
274
|
* await sdb.close();
|
|
274
275
|
* ```
|
|
276
|
+
*
|
|
277
|
+
* @defaultValue `false`
|
|
278
|
+
* @category Properties
|
|
275
279
|
*/
|
|
276
280
|
readOnly: boolean;
|
|
277
281
|
/**
|
|
@@ -280,9 +284,6 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
280
284
|
* methods (e.g., `newTable()`, `clone()`) return instances of your
|
|
281
285
|
* custom table class.
|
|
282
286
|
*
|
|
283
|
-
* @defaultValue `SimpleTable`
|
|
284
|
-
* @category Properties
|
|
285
|
-
*
|
|
286
287
|
* @example
|
|
287
288
|
* ```ts
|
|
288
289
|
* class MyTable extends SimpleTable {
|
|
@@ -300,6 +301,9 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
300
301
|
* const table = db.newTable("myTable");
|
|
301
302
|
* console.log(table.customMethod()); // "hello"
|
|
302
303
|
* ```
|
|
304
|
+
*
|
|
305
|
+
* @defaultValue `SimpleTable`
|
|
306
|
+
* @category Properties
|
|
303
307
|
*/
|
|
304
308
|
tableClass: new (name: string, sdb: SimpleDB, options?: {
|
|
305
309
|
rowsToLog?: number;
|
|
@@ -316,6 +320,14 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
316
320
|
* `__sda` schema is reserved for versioned SDA metadata. SQLite files can be
|
|
317
321
|
* imported with `loadDB()` but cannot be used as the persistent database.
|
|
318
322
|
*
|
|
323
|
+
* @example
|
|
324
|
+
* ```ts
|
|
325
|
+
* const sdb = new SimpleDB({
|
|
326
|
+
* logSQL: true,
|
|
327
|
+
* explainSQL: true,
|
|
328
|
+
* });
|
|
329
|
+
* ```
|
|
330
|
+
*
|
|
319
331
|
* @param options - Configuration options for the SimpleDB instance.
|
|
320
332
|
* @param options.file - A `.db` or `.duckdb` file to open or create. Defaults to an in-memory database.
|
|
321
333
|
* @param options.overwrite - If true, replaces an existing file on first use. Defaults to false, which opens the existing file.
|
|
@@ -333,14 +345,6 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
333
345
|
* @param options.memoryLimit - The maximum amount of memory DuckDB is allowed to use (e.g., `'4GB'`). Defaults to 80% of system RAM.
|
|
334
346
|
* @param options.tempDir - The path to the directory used for temporary files when data exceeds the memory limit (e.g., `'/tmp/duckdb_swap'`). Defaults to `.tmp` for in-memory databases or `<file>.tmp` for file-based databases. Automatically removed when calling `close()`.
|
|
335
347
|
* @category Constructor
|
|
336
|
-
*
|
|
337
|
-
* @example
|
|
338
|
-
* ```ts
|
|
339
|
-
* const sdb = new SimpleDB({
|
|
340
|
-
* logSQL: true,
|
|
341
|
-
* explainSQL: true,
|
|
342
|
-
* });
|
|
343
|
-
* ```
|
|
344
348
|
*/
|
|
345
349
|
constructor(options?: {
|
|
346
350
|
file?: string;
|
|
@@ -371,10 +375,6 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
371
375
|
* Creates a new SimpleTable instance within the database.
|
|
372
376
|
* The name must be unique among registered tables, ignoring ASCII letter case.
|
|
373
377
|
*
|
|
374
|
-
* @param name - The name of the new table. If not provided, a default name is generated (e.g., "table1").
|
|
375
|
-
* @returns A new table instance.
|
|
376
|
-
* @category Table Management
|
|
377
|
-
*
|
|
378
378
|
* @example
|
|
379
379
|
* ```ts
|
|
380
380
|
* // Create a table with a default name (e.g., "table1", "table2", etc.)
|
|
@@ -392,30 +392,30 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
392
392
|
* .loadData("employees.csv")
|
|
393
393
|
* .log();
|
|
394
394
|
* ```
|
|
395
|
+
*
|
|
396
|
+
* @param name - The name of the new table. If not provided, a default name is generated (e.g., "table1").
|
|
397
|
+
* @returns A new table instance.
|
|
398
|
+
* @category Table Management
|
|
395
399
|
*/
|
|
396
400
|
newTable(name?: string): Table;
|
|
397
401
|
/**
|
|
398
402
|
* Retrieves an existing SimpleTable instance from the database.
|
|
399
403
|
*
|
|
400
|
-
* @param name - The name of the table to retrieve.
|
|
401
|
-
* @returns A promise that resolves to the SimpleTable instance if found.
|
|
402
|
-
* @category Table Management
|
|
403
|
-
*
|
|
404
404
|
* @example
|
|
405
405
|
* ```ts
|
|
406
406
|
* // Retrieve the "employees" table
|
|
407
407
|
* const employees = await sdb.getTable("employees");
|
|
408
408
|
* await employees.log();
|
|
409
409
|
* ```
|
|
410
|
+
*
|
|
411
|
+
* @param name - The name of the table to retrieve.
|
|
412
|
+
* @returns A promise that resolves to the SimpleTable instance if found.
|
|
413
|
+
* @category Table Management
|
|
410
414
|
*/
|
|
411
415
|
getTable(name: string): Promise<Table>;
|
|
412
416
|
/**
|
|
413
417
|
* Removes one or more tables from the database.
|
|
414
418
|
*
|
|
415
|
-
* @param tables - A single table or an array of tables to remove, specified by name or as SimpleTable instances. Pass `"all"` to remove all tables.
|
|
416
|
-
* @returns A promise that resolves to the database, so methods can be chained.
|
|
417
|
-
* @category Table Management
|
|
418
|
-
*
|
|
419
419
|
* @example
|
|
420
420
|
* ```ts
|
|
421
421
|
* // Remove a single table by name
|
|
@@ -441,15 +441,15 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
441
441
|
* // Remove all tables
|
|
442
442
|
* await sdb.removeTables("all");
|
|
443
443
|
* ```
|
|
444
|
+
*
|
|
445
|
+
* @param tables - A single table or an array of tables to remove, specified by name or as SimpleTable instances. Pass `"all"` to remove all tables.
|
|
446
|
+
* @returns A promise that resolves to the database, so methods can be chained.
|
|
447
|
+
* @category Table Management
|
|
444
448
|
*/
|
|
445
449
|
removeTables(tables: Table | string | (Table | string)[]): Promise<this>;
|
|
446
450
|
/**
|
|
447
451
|
* Selects one or more tables to keep in the database, removing all others.
|
|
448
452
|
*
|
|
449
|
-
* @param tables - A single table or an array of tables to select, specified by name or as SimpleTable instances.
|
|
450
|
-
* @returns A promise that resolves to the database, so methods can be chained.
|
|
451
|
-
* @category Table Management
|
|
452
|
-
*
|
|
453
453
|
* @example
|
|
454
454
|
* ```ts
|
|
455
455
|
* // Select a single table by name, removing all other tables
|
|
@@ -469,34 +469,38 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
469
469
|
* // ... load data ...
|
|
470
470
|
* await sdb.selectTables(employeesTable);
|
|
471
471
|
* ```
|
|
472
|
+
*
|
|
473
|
+
* @param tables - A single table or an array of tables to select, specified by name or as SimpleTable instances.
|
|
474
|
+
* @returns A promise that resolves to the database, so methods can be chained.
|
|
475
|
+
* @category Table Management
|
|
472
476
|
*/
|
|
473
477
|
selectTables(tables: Table | string | (Table | string)[]): Promise<this>;
|
|
474
478
|
/**
|
|
475
479
|
* Returns an array of all table names in the database, sorted alphabetically.
|
|
476
480
|
*
|
|
477
|
-
* @returns A promise that resolves to an array of table names.
|
|
478
|
-
* @category Table Management
|
|
479
|
-
*
|
|
480
481
|
* @example
|
|
481
482
|
* ```ts
|
|
482
483
|
* // Get all table names
|
|
483
484
|
* const tableNames = await sdb.getTableNames();
|
|
484
485
|
* console.log(tableNames); // Output: ["employees", "customers"]
|
|
485
486
|
* ```
|
|
487
|
+
*
|
|
488
|
+
* @returns A promise that resolves to an array of table names.
|
|
489
|
+
* @category Table Management
|
|
486
490
|
*/
|
|
487
491
|
getTableNames(): Promise<string[]>;
|
|
488
492
|
/**
|
|
489
493
|
* Logs the names of all tables in the database to the console, sorted alphabetically.
|
|
490
494
|
*
|
|
491
|
-
* @returns A promise that resolves to the database, so methods can be chained.
|
|
492
|
-
* @category Table Management
|
|
493
|
-
*
|
|
494
495
|
* @example
|
|
495
496
|
* ```ts
|
|
496
497
|
* // Log all table names to the console
|
|
497
498
|
* await sdb.logTableNames();
|
|
498
499
|
* // Example output: SimpleDB - Tables: ["employees","customers"]
|
|
499
500
|
* ```
|
|
501
|
+
*
|
|
502
|
+
* @returns A promise that resolves to the database, so methods can be chained.
|
|
503
|
+
* @category Table Management
|
|
500
504
|
*/
|
|
501
505
|
logTableNames(): Promise<this>;
|
|
502
506
|
/**
|
|
@@ -505,23 +509,19 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
505
509
|
* The returned array is a snapshot and cannot mutate the database's internal
|
|
506
510
|
* table registry.
|
|
507
511
|
*
|
|
508
|
-
* @returns A read-only array of SimpleTable instances.
|
|
509
|
-
* @category Table Management
|
|
510
|
-
*
|
|
511
512
|
* @example
|
|
512
513
|
* ```ts
|
|
513
514
|
* // Get all SimpleTable instances
|
|
514
515
|
* const tables = sdb.getTables();
|
|
515
516
|
* ```
|
|
517
|
+
*
|
|
518
|
+
* @returns A read-only array of SimpleTable instances.
|
|
519
|
+
* @category Table Management
|
|
516
520
|
*/
|
|
517
521
|
getTables(): readonly Table[];
|
|
518
522
|
/**
|
|
519
523
|
* Checks if a table exists in the database.
|
|
520
524
|
*
|
|
521
|
-
* @param table - The name of the table or a SimpleTable instance.
|
|
522
|
-
* @returns A promise that resolves to `true` if the table exists, `false` otherwise.
|
|
523
|
-
* @category Table Management
|
|
524
|
-
*
|
|
525
525
|
* @example
|
|
526
526
|
* ```ts
|
|
527
527
|
* // Check if a table named "employees" exists
|
|
@@ -536,20 +536,24 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
536
536
|
* const existsInstance = await sdb.hasTable(myTable);
|
|
537
537
|
* console.log(existsInstance); // Output: true or false
|
|
538
538
|
* ```
|
|
539
|
+
*
|
|
540
|
+
* @param table - The name of the table or a SimpleTable instance.
|
|
541
|
+
* @returns A promise that resolves to `true` if the table exists, `false` otherwise.
|
|
542
|
+
* @category Table Management
|
|
539
543
|
*/
|
|
540
544
|
hasTable(table: Table | string): Promise<boolean>;
|
|
541
545
|
/**
|
|
542
546
|
* Returns a list of installed DuckDB extensions.
|
|
543
547
|
*
|
|
544
|
-
* @returns A promise that resolves to an array of objects, each representing an installed extension.
|
|
545
|
-
* @category DuckDB
|
|
546
|
-
*
|
|
547
548
|
* @example
|
|
548
549
|
* ```ts
|
|
549
550
|
* // Get a list of all installed extensions
|
|
550
551
|
* const extensions = await sdb.getExtensions();
|
|
551
552
|
* console.log(extensions); // Output: [{ extension_name: "spatial", loaded: true, ... }]
|
|
552
553
|
* ```
|
|
554
|
+
*
|
|
555
|
+
* @returns A promise that resolves to an array of objects, each representing an installed extension.
|
|
556
|
+
* @category DuckDB
|
|
553
557
|
*/
|
|
554
558
|
getExtensions(): Promise<{
|
|
555
559
|
[key: string]: unknown;
|
|
@@ -566,13 +570,6 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
566
570
|
* identifies the custom query's dependencies in the cache's `options.inputs`
|
|
567
571
|
* (such as a table content hash), or use tracked `SimpleTable` methods.
|
|
568
572
|
*
|
|
569
|
-
* @param query - The SQL query string to execute.
|
|
570
|
-
* @param options - Configuration options for the query.
|
|
571
|
-
* @param options.returnData - If `true`, the query result is returned. Defaults to `false`.
|
|
572
|
-
* @param options.table - The name of the table associated with the query, primarily used for debugging and logging.
|
|
573
|
-
* @returns A promise that resolves to the query result as an array of objects if `returnData` is `true`, otherwise `null`.
|
|
574
|
-
* @category DuckDB
|
|
575
|
-
*
|
|
576
573
|
* @example
|
|
577
574
|
* ```ts
|
|
578
575
|
* // Execute a query without returning data
|
|
@@ -588,6 +585,13 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
588
585
|
* );
|
|
589
586
|
* console.log(youngEmployees);
|
|
590
587
|
* ```
|
|
588
|
+
*
|
|
589
|
+
* @param query - The SQL query string to execute.
|
|
590
|
+
* @param options - Configuration options for the query.
|
|
591
|
+
* @param options.returnData - If `true`, the query result is returned. Defaults to `false`.
|
|
592
|
+
* @param options.table - The name of the table associated with the query, primarily used for debugging and logging.
|
|
593
|
+
* @returns A promise that resolves to the query result as an array of objects if `returnData` is `true`, otherwise `null`.
|
|
594
|
+
* @category DuckDB
|
|
591
595
|
*/
|
|
592
596
|
customQuery(query: string, options?: {
|
|
593
597
|
returnData?: boolean;
|
|
@@ -607,10 +611,6 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
607
611
|
* for SDA metadata.
|
|
608
612
|
* To edit an existing DuckDB file in place, use `new SimpleDB({ file })`.
|
|
609
613
|
*
|
|
610
|
-
* @param file - The relative or absolute path to the database file.
|
|
611
|
-
* @returns A promise that resolves to the database, so methods can be chained.
|
|
612
|
-
* @category File Operations
|
|
613
|
-
*
|
|
614
614
|
* @example
|
|
615
615
|
* ```ts
|
|
616
616
|
* // Load a DuckDB database file
|
|
@@ -630,6 +630,10 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
630
630
|
* await sdb.loadDB("./archive.db");
|
|
631
631
|
* await sdb.close();
|
|
632
632
|
* ```
|
|
633
|
+
*
|
|
634
|
+
* @param file - The relative or absolute path to the database file.
|
|
635
|
+
* @returns A promise that resolves to the database, so methods can be chained.
|
|
636
|
+
* @category File Operations
|
|
633
637
|
*/
|
|
634
638
|
loadDB(file: string): Promise<this>;
|
|
635
639
|
/**
|
|
@@ -647,13 +651,6 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
647
651
|
* is published only after its connection is detached. Database files attached
|
|
648
652
|
* to this instance, directories, and symbolic links cannot be replaced.
|
|
649
653
|
*
|
|
650
|
-
* @param file - The relative or absolute path to the output file.
|
|
651
|
-
* @param options - Configuration options for writing the database.
|
|
652
|
-
* @param options.overwrite - If true, permits atomic replacement of an existing output file. Defaults to false.
|
|
653
|
-
* @param options.metadata - If false, omits logical SDA index definitions from DuckDB exports. Defaults to true. Does not control physical indexes; SQLite exports never include SDA metadata.
|
|
654
|
-
* @returns A promise that resolves to the database, so methods can be chained.
|
|
655
|
-
* @category File Operations
|
|
656
|
-
*
|
|
657
654
|
* @example
|
|
658
655
|
* ```ts
|
|
659
656
|
* // Write the current database to a DuckDB file
|
|
@@ -671,6 +668,13 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
671
668
|
* // Export table data for use with SQLite
|
|
672
669
|
* await sdb.writeDB("./my_exported_database.sqlite");
|
|
673
670
|
* ```
|
|
671
|
+
*
|
|
672
|
+
* @param file - The relative or absolute path to the output file.
|
|
673
|
+
* @param options - Configuration options for writing the database.
|
|
674
|
+
* @param options.overwrite - If true, permits atomic replacement of an existing output file. Defaults to false.
|
|
675
|
+
* @param options.metadata - If false, omits logical SDA index definitions from DuckDB exports. Defaults to true. Does not control physical indexes; SQLite exports never include SDA metadata.
|
|
676
|
+
* @returns A promise that resolves to the database, so methods can be chained.
|
|
677
|
+
* @category File Operations
|
|
674
678
|
*/
|
|
675
679
|
writeDB(file: string, options?: {
|
|
676
680
|
overwrite?: boolean;
|
|
@@ -688,9 +692,6 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
688
692
|
* different tables execute exactly in the order they were queued. This is
|
|
689
693
|
* the database-level counterpart to `SimpleTable.run()`.
|
|
690
694
|
*
|
|
691
|
-
* @returns A promise that resolves to the SimpleDB instance once the queued methods have been executed.
|
|
692
|
-
* @category Lifecycle
|
|
693
|
-
*
|
|
694
695
|
* @example
|
|
695
696
|
* ```ts
|
|
696
697
|
* // Nothing is observed after the mutations, so run() executes them.
|
|
@@ -698,6 +699,9 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
698
699
|
* table2.loadData("data2.csv").filter(`price > 0`);
|
|
699
700
|
* await sdb.run();
|
|
700
701
|
* ```
|
|
702
|
+
*
|
|
703
|
+
* @returns A promise that resolves to the SimpleDB instance once the queued methods have been executed.
|
|
704
|
+
* @category Lifecycle
|
|
701
705
|
*/
|
|
702
706
|
run(): Promise<SimpleDB>;
|
|
703
707
|
/**
|
|
@@ -705,16 +709,16 @@ export default class SimpleDB<Table extends SimpleTable = SimpleTable> extends S
|
|
|
705
709
|
* databases, and closes the connection and instance. Also cleans up temporary
|
|
706
710
|
* files and the cache. Does not copy, compact, or replace the database file.
|
|
707
711
|
*
|
|
708
|
-
* @returns A promise that resolves to the SimpleDB instance after cleanup.
|
|
709
|
-
* @throws An error after cleanup when pending execution or cleanup fails.
|
|
710
|
-
* @category Lifecycle
|
|
711
|
-
*
|
|
712
712
|
* @example
|
|
713
713
|
* ```ts
|
|
714
714
|
* // close() executes queued transformations before cleaning up resources.
|
|
715
715
|
* table.loadData("data.csv").convert({ price: "number" });
|
|
716
716
|
* await sdb.close();
|
|
717
717
|
* ```
|
|
718
|
+
*
|
|
719
|
+
* @returns A promise that resolves to the SimpleDB instance after cleanup.
|
|
720
|
+
* @throws An error after cleanup when pending execution or cleanup fails.
|
|
721
|
+
* @category Lifecycle
|
|
718
722
|
*/
|
|
719
723
|
close(): Promise<SimpleDB>;
|
|
720
724
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleDB.d.ts","sourceRoot":"","sources":["../../src/class/SimpleDB.ts"],"names":[],"mappings":"AAGA,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAG3C,OAAO,MAAM,MAAM,aAAa,CAAC;AA6BjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,MAAM,CAAC,OAAO,OAAO,QAAQ,CAAC,KAAK,SAAS,WAAW,GAAG,WAAW,CACnE,SAAQ,MAAM;;IACd
|
|
1
|
+
{"version":3,"file":"SimpleDB.d.ts","sourceRoot":"","sources":["../../src/class/SimpleDB.ts"],"names":[],"mappings":"AAGA,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAG3C,OAAO,MAAM,MAAM,aAAa,CAAC;AA6BjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,MAAM,CAAC,OAAO,OAAO,QAAQ,CAAC,KAAK,SAAS,WAAW,GAAG,WAAW,CACnE,SAAQ,MAAM;;IACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkEG;IACH,QAAQ,CAAC,gBAAgB,EAAE,IAAI,GAAG,KAAK,CAAC;IACxC;;;;;;;;;;OAUG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;;;;;;;;OAUG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;;OAKG;IACH,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;;;;;OAKG;IACH,cAAc,EAAE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