@nshiab/simple-data-analysis-core 2.0.9 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +2806 -1139
- package/esm/class/SimpleTable.d.ts.map +1 -1
- package/esm/class/SimpleTable.js +2792 -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/esm/methods/trim.d.ts +1 -1
- package/esm/methods/trim.d.ts.map +1 -1
- package/esm/methods/trim.js +17 -8
- package/llm.md +2146 -173
- 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 +2806 -1139
- package/script/class/SimpleTable.d.ts.map +1 -1
- package/script/class/SimpleTable.js +2792 -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/script/methods/trim.d.ts +1 -1
- package/script/methods/trim.d.ts.map +1 -1
- package/script/methods/trim.js +17 -8
package/script/class/SimpleDB.js
CHANGED
|
@@ -121,6 +121,14 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
121
121
|
* `__sda` schema is reserved for versioned SDA metadata. SQLite files can be
|
|
122
122
|
* imported with `loadDB()` but cannot be used as the persistent database.
|
|
123
123
|
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* const sdb = new SimpleDB({
|
|
127
|
+
* logSQL: true,
|
|
128
|
+
* explainSQL: true,
|
|
129
|
+
* });
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
124
132
|
* @param options - Configuration options for the SimpleDB instance.
|
|
125
133
|
* @param options.file - A `.db` or `.duckdb` file to open or create. Defaults to an in-memory database.
|
|
126
134
|
* @param options.overwrite - If true, replaces an existing file on first use. Defaults to false, which opens the existing file.
|
|
@@ -138,14 +146,6 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
138
146
|
* @param options.memoryLimit - The maximum amount of memory DuckDB is allowed to use (e.g., `'4GB'`). Defaults to 80% of system RAM.
|
|
139
147
|
* @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()`.
|
|
140
148
|
* @category Constructor
|
|
141
|
-
*
|
|
142
|
-
* @example
|
|
143
|
-
* ```ts
|
|
144
|
-
* const sdb = new SimpleDB({
|
|
145
|
-
* logSQL: true,
|
|
146
|
-
* explainSQL: true,
|
|
147
|
-
* });
|
|
148
|
-
* ```
|
|
149
149
|
*/
|
|
150
150
|
constructor(options = {}) {
|
|
151
151
|
super(options);
|
|
@@ -161,8 +161,6 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
161
161
|
* `"sql"` passes SQL through unchanged, including `||` and null comparisons.
|
|
162
162
|
* Choose the syntax when constructing the database; it applies to all tables.
|
|
163
163
|
*
|
|
164
|
-
* @defaultValue `"js"`
|
|
165
|
-
* @category Properties
|
|
166
164
|
* @example
|
|
167
165
|
* ```ts
|
|
168
166
|
* const sdb = new SimpleDB({ expressionSyntax: "js" }); // The default mode
|
|
@@ -215,6 +213,9 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
215
213
|
* await sdb.newTable().loadArray([{ active: true, age: 18, admin: false }])
|
|
216
214
|
* .filter("(active AND age >= 18) OR admin").log();
|
|
217
215
|
* ```
|
|
216
|
+
*
|
|
217
|
+
* @defaultValue `"js"`
|
|
218
|
+
* @category Properties
|
|
218
219
|
*/
|
|
219
220
|
Object.defineProperty(this, "expressionSyntax", {
|
|
220
221
|
enumerable: true,
|
|
@@ -225,12 +226,13 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
225
226
|
/**
|
|
226
227
|
* Whether to log each SQL statement immediately before execution.
|
|
227
228
|
*
|
|
228
|
-
* @defaultValue `false`
|
|
229
|
-
* @category Properties
|
|
230
229
|
* @example
|
|
231
230
|
* ```ts
|
|
232
231
|
* const sdb = new SimpleDB({ logSQL: true });
|
|
233
232
|
* ```
|
|
233
|
+
*
|
|
234
|
+
* @defaultValue `false`
|
|
235
|
+
* @category Properties
|
|
234
236
|
*/
|
|
235
237
|
Object.defineProperty(this, "logSQL", {
|
|
236
238
|
enumerable: true,
|
|
@@ -241,12 +243,13 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
241
243
|
/**
|
|
242
244
|
* Whether to log DuckDB query plans before supported statements execute.
|
|
243
245
|
*
|
|
244
|
-
* @defaultValue `false`
|
|
245
|
-
* @category Properties
|
|
246
246
|
* @example
|
|
247
247
|
* ```ts
|
|
248
248
|
* const sdb = new SimpleDB({ explainSQL: true });
|
|
249
249
|
* ```
|
|
250
|
+
*
|
|
251
|
+
* @defaultValue `false`
|
|
252
|
+
* @category Properties
|
|
250
253
|
*/
|
|
251
254
|
Object.defineProperty(this, "explainSQL", {
|
|
252
255
|
enumerable: true,
|
|
@@ -485,8 +488,6 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
485
488
|
* Whether the persistent DuckDB file is opened read-only. Requires an existing
|
|
486
489
|
* file and cannot be combined with `overwrite`. DuckDB rejects writes to it.
|
|
487
490
|
*
|
|
488
|
-
* @defaultValue `false`
|
|
489
|
-
* @category Properties
|
|
490
491
|
* @example
|
|
491
492
|
* ```ts
|
|
492
493
|
* const sdb = new SimpleDB({ file: "./archive.duckdb", readOnly: true });
|
|
@@ -494,6 +495,9 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
494
495
|
* await table.log();
|
|
495
496
|
* await sdb.close();
|
|
496
497
|
* ```
|
|
498
|
+
*
|
|
499
|
+
* @defaultValue `false`
|
|
500
|
+
* @category Properties
|
|
497
501
|
*/
|
|
498
502
|
Object.defineProperty(this, "readOnly", {
|
|
499
503
|
enumerable: true,
|
|
@@ -507,9 +511,6 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
507
511
|
* methods (e.g., `newTable()`, `clone()`) return instances of your
|
|
508
512
|
* custom table class.
|
|
509
513
|
*
|
|
510
|
-
* @defaultValue `SimpleTable`
|
|
511
|
-
* @category Properties
|
|
512
|
-
*
|
|
513
514
|
* @example
|
|
514
515
|
* ```ts
|
|
515
516
|
* class MyTable extends SimpleTable {
|
|
@@ -527,6 +528,9 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
527
528
|
* const table = db.newTable("myTable");
|
|
528
529
|
* console.log(table.customMethod()); // "hello"
|
|
529
530
|
* ```
|
|
531
|
+
*
|
|
532
|
+
* @defaultValue `SimpleTable`
|
|
533
|
+
* @category Properties
|
|
530
534
|
*/
|
|
531
535
|
Object.defineProperty(this, "tableClass", {
|
|
532
536
|
enumerable: true,
|
|
@@ -593,10 +597,6 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
593
597
|
* Creates a new SimpleTable instance within the database.
|
|
594
598
|
* The name must be unique among registered tables, ignoring ASCII letter case.
|
|
595
599
|
*
|
|
596
|
-
* @param name - The name of the new table. If not provided, a default name is generated (e.g., "table1").
|
|
597
|
-
* @returns A new table instance.
|
|
598
|
-
* @category Table Management
|
|
599
|
-
*
|
|
600
600
|
* @example
|
|
601
601
|
* ```ts
|
|
602
602
|
* // Create a table with a default name (e.g., "table1", "table2", etc.)
|
|
@@ -614,6 +614,10 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
614
614
|
* .loadData("employees.csv")
|
|
615
615
|
* .log();
|
|
616
616
|
* ```
|
|
617
|
+
*
|
|
618
|
+
* @param name - The name of the new table. If not provided, a default name is generated (e.g., "table1").
|
|
619
|
+
* @returns A new table instance.
|
|
620
|
+
* @category Table Management
|
|
617
621
|
*/
|
|
618
622
|
newTable(name) {
|
|
619
623
|
if (this.lifecycleState !== "open") {
|
|
@@ -648,16 +652,16 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
648
652
|
/**
|
|
649
653
|
* Retrieves an existing SimpleTable instance from the database.
|
|
650
654
|
*
|
|
651
|
-
* @param name - The name of the table to retrieve.
|
|
652
|
-
* @returns A promise that resolves to the SimpleTable instance if found.
|
|
653
|
-
* @category Table Management
|
|
654
|
-
*
|
|
655
655
|
* @example
|
|
656
656
|
* ```ts
|
|
657
657
|
* // Retrieve the "employees" table
|
|
658
658
|
* const employees = await sdb.getTable("employees");
|
|
659
659
|
* await employees.log();
|
|
660
660
|
* ```
|
|
661
|
+
*
|
|
662
|
+
* @param name - The name of the table to retrieve.
|
|
663
|
+
* @returns A promise that resolves to the SimpleTable instance if found.
|
|
664
|
+
* @category Table Management
|
|
661
665
|
*/
|
|
662
666
|
async getTable(name) {
|
|
663
667
|
await this.start();
|
|
@@ -673,10 +677,6 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
673
677
|
/**
|
|
674
678
|
* Removes one or more tables from the database.
|
|
675
679
|
*
|
|
676
|
-
* @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.
|
|
677
|
-
* @returns A promise that resolves to the database, so methods can be chained.
|
|
678
|
-
* @category Table Management
|
|
679
|
-
*
|
|
680
680
|
* @example
|
|
681
681
|
* ```ts
|
|
682
682
|
* // Remove a single table by name
|
|
@@ -702,6 +702,10 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
702
702
|
* // Remove all tables
|
|
703
703
|
* await sdb.removeTables("all");
|
|
704
704
|
* ```
|
|
705
|
+
*
|
|
706
|
+
* @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.
|
|
707
|
+
* @returns A promise that resolves to the database, so methods can be chained.
|
|
708
|
+
* @category Table Management
|
|
705
709
|
*/
|
|
706
710
|
async removeTables(tables) {
|
|
707
711
|
await (0, removeTables_js_1.default)(this, tables);
|
|
@@ -710,10 +714,6 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
710
714
|
/**
|
|
711
715
|
* Selects one or more tables to keep in the database, removing all others.
|
|
712
716
|
*
|
|
713
|
-
* @param tables - A single table or an array of tables to select, specified by name or as SimpleTable instances.
|
|
714
|
-
* @returns A promise that resolves to the database, so methods can be chained.
|
|
715
|
-
* @category Table Management
|
|
716
|
-
*
|
|
717
717
|
* @example
|
|
718
718
|
* ```ts
|
|
719
719
|
* // Select a single table by name, removing all other tables
|
|
@@ -733,6 +733,10 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
733
733
|
* // ... load data ...
|
|
734
734
|
* await sdb.selectTables(employeesTable);
|
|
735
735
|
* ```
|
|
736
|
+
*
|
|
737
|
+
* @param tables - A single table or an array of tables to select, specified by name or as SimpleTable instances.
|
|
738
|
+
* @returns A promise that resolves to the database, so methods can be chained.
|
|
739
|
+
* @category Table Management
|
|
736
740
|
*/
|
|
737
741
|
async selectTables(tables) {
|
|
738
742
|
await (0, selectTables_js_1.default)(this, tables);
|
|
@@ -741,15 +745,15 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
741
745
|
/**
|
|
742
746
|
* Returns an array of all table names in the database, sorted alphabetically.
|
|
743
747
|
*
|
|
744
|
-
* @returns A promise that resolves to an array of table names.
|
|
745
|
-
* @category Table Management
|
|
746
|
-
*
|
|
747
748
|
* @example
|
|
748
749
|
* ```ts
|
|
749
750
|
* // Get all table names
|
|
750
751
|
* const tableNames = await sdb.getTableNames();
|
|
751
752
|
* console.log(tableNames); // Output: ["employees", "customers"]
|
|
752
753
|
* ```
|
|
754
|
+
*
|
|
755
|
+
* @returns A promise that resolves to an array of table names.
|
|
756
|
+
* @category Table Management
|
|
753
757
|
*/
|
|
754
758
|
async getTableNames() {
|
|
755
759
|
return await (0, getTableNames_js_1.default)(this);
|
|
@@ -757,15 +761,15 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
757
761
|
/**
|
|
758
762
|
* Logs the names of all tables in the database to the console, sorted alphabetically.
|
|
759
763
|
*
|
|
760
|
-
* @returns A promise that resolves to the database, so methods can be chained.
|
|
761
|
-
* @category Table Management
|
|
762
|
-
*
|
|
763
764
|
* @example
|
|
764
765
|
* ```ts
|
|
765
766
|
* // Log all table names to the console
|
|
766
767
|
* await sdb.logTableNames();
|
|
767
768
|
* // Example output: SimpleDB - Tables: ["employees","customers"]
|
|
768
769
|
* ```
|
|
770
|
+
*
|
|
771
|
+
* @returns A promise that resolves to the database, so methods can be chained.
|
|
772
|
+
* @category Table Management
|
|
769
773
|
*/
|
|
770
774
|
async logTableNames() {
|
|
771
775
|
const tables = await this.getTableNames();
|
|
@@ -783,14 +787,14 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
783
787
|
* The returned array is a snapshot and cannot mutate the database's internal
|
|
784
788
|
* table registry.
|
|
785
789
|
*
|
|
786
|
-
* @returns A read-only array of SimpleTable instances.
|
|
787
|
-
* @category Table Management
|
|
788
|
-
*
|
|
789
790
|
* @example
|
|
790
791
|
* ```ts
|
|
791
792
|
* // Get all SimpleTable instances
|
|
792
793
|
* const tables = sdb.getTables();
|
|
793
794
|
* ```
|
|
795
|
+
*
|
|
796
|
+
* @returns A read-only array of SimpleTable instances.
|
|
797
|
+
* @category Table Management
|
|
794
798
|
*/
|
|
795
799
|
getTables() {
|
|
796
800
|
return (0, tableRegistry_js_1.listRegisteredTables)(this);
|
|
@@ -798,10 +802,6 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
798
802
|
/**
|
|
799
803
|
* Checks if a table exists in the database.
|
|
800
804
|
*
|
|
801
|
-
* @param table - The name of the table or a SimpleTable instance.
|
|
802
|
-
* @returns A promise that resolves to `true` if the table exists, `false` otherwise.
|
|
803
|
-
* @category Table Management
|
|
804
|
-
*
|
|
805
805
|
* @example
|
|
806
806
|
* ```ts
|
|
807
807
|
* // Check if a table named "employees" exists
|
|
@@ -816,6 +816,10 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
816
816
|
* const existsInstance = await sdb.hasTable(myTable);
|
|
817
817
|
* console.log(existsInstance); // Output: true or false
|
|
818
818
|
* ```
|
|
819
|
+
*
|
|
820
|
+
* @param table - The name of the table or a SimpleTable instance.
|
|
821
|
+
* @returns A promise that resolves to `true` if the table exists, `false` otherwise.
|
|
822
|
+
* @category Table Management
|
|
819
823
|
*/
|
|
820
824
|
async hasTable(table) {
|
|
821
825
|
const tableName = typeof table === "string" ? table : table.name;
|
|
@@ -825,15 +829,15 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
825
829
|
/**
|
|
826
830
|
* Returns a list of installed DuckDB extensions.
|
|
827
831
|
*
|
|
828
|
-
* @returns A promise that resolves to an array of objects, each representing an installed extension.
|
|
829
|
-
* @category DuckDB
|
|
830
|
-
*
|
|
831
832
|
* @example
|
|
832
833
|
* ```ts
|
|
833
834
|
* // Get a list of all installed extensions
|
|
834
835
|
* const extensions = await sdb.getExtensions();
|
|
835
836
|
* console.log(extensions); // Output: [{ extension_name: "spatial", loaded: true, ... }]
|
|
836
837
|
* ```
|
|
838
|
+
*
|
|
839
|
+
* @returns A promise that resolves to an array of objects, each representing an installed extension.
|
|
840
|
+
* @category DuckDB
|
|
837
841
|
*/
|
|
838
842
|
async getExtensions() {
|
|
839
843
|
return (await (0, queryDB_js_1.default)(this, `FROM duckdb_extensions();`, (0, mergeOptions_js_1.default)(this, {
|
|
@@ -855,13 +859,6 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
855
859
|
* identifies the custom query's dependencies in the cache's `options.inputs`
|
|
856
860
|
* (such as a table content hash), or use tracked `SimpleTable` methods.
|
|
857
861
|
*
|
|
858
|
-
* @param query - The SQL query string to execute.
|
|
859
|
-
* @param options - Configuration options for the query.
|
|
860
|
-
* @param options.returnData - If `true`, the query result is returned. Defaults to `false`.
|
|
861
|
-
* @param options.table - The name of the table associated with the query, primarily used for debugging and logging.
|
|
862
|
-
* @returns A promise that resolves to the query result as an array of objects if `returnData` is `true`, otherwise `null`.
|
|
863
|
-
* @category DuckDB
|
|
864
|
-
*
|
|
865
862
|
* @example
|
|
866
863
|
* ```ts
|
|
867
864
|
* // Execute a query without returning data
|
|
@@ -877,6 +874,13 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
877
874
|
* );
|
|
878
875
|
* console.log(youngEmployees);
|
|
879
876
|
* ```
|
|
877
|
+
*
|
|
878
|
+
* @param query - The SQL query string to execute.
|
|
879
|
+
* @param options - Configuration options for the query.
|
|
880
|
+
* @param options.returnData - If `true`, the query result is returned. Defaults to `false`.
|
|
881
|
+
* @param options.table - The name of the table associated with the query, primarily used for debugging and logging.
|
|
882
|
+
* @returns A promise that resolves to the query result as an array of objects if `returnData` is `true`, otherwise `null`.
|
|
883
|
+
* @category DuckDB
|
|
880
884
|
*/
|
|
881
885
|
async customQuery(query, options = {}) {
|
|
882
886
|
return await (0, queryDB_js_1.default)(this, query, (0, mergeOptions_js_1.default)(this, {
|
|
@@ -898,10 +902,6 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
898
902
|
* for SDA metadata.
|
|
899
903
|
* To edit an existing DuckDB file in place, use `new SimpleDB({ file })`.
|
|
900
904
|
*
|
|
901
|
-
* @param file - The relative or absolute path to the database file.
|
|
902
|
-
* @returns A promise that resolves to the database, so methods can be chained.
|
|
903
|
-
* @category File Operations
|
|
904
|
-
*
|
|
905
905
|
* @example
|
|
906
906
|
* ```ts
|
|
907
907
|
* // Load a DuckDB database file
|
|
@@ -921,6 +921,10 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
921
921
|
* await sdb.loadDB("./archive.db");
|
|
922
922
|
* await sdb.close();
|
|
923
923
|
* ```
|
|
924
|
+
*
|
|
925
|
+
* @param file - The relative or absolute path to the database file.
|
|
926
|
+
* @returns A promise that resolves to the database, so methods can be chained.
|
|
927
|
+
* @category File Operations
|
|
924
928
|
*/
|
|
925
929
|
async loadDB(file) {
|
|
926
930
|
await (0, loadDB_js_1.default)(this, file);
|
|
@@ -941,13 +945,6 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
941
945
|
* is published only after its connection is detached. Database files attached
|
|
942
946
|
* to this instance, directories, and symbolic links cannot be replaced.
|
|
943
947
|
*
|
|
944
|
-
* @param file - The relative or absolute path to the output file.
|
|
945
|
-
* @param options - Configuration options for writing the database.
|
|
946
|
-
* @param options.overwrite - If true, permits atomic replacement of an existing output file. Defaults to false.
|
|
947
|
-
* @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.
|
|
948
|
-
* @returns A promise that resolves to the database, so methods can be chained.
|
|
949
|
-
* @category File Operations
|
|
950
|
-
*
|
|
951
948
|
* @example
|
|
952
949
|
* ```ts
|
|
953
950
|
* // Write the current database to a DuckDB file
|
|
@@ -965,6 +962,13 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
965
962
|
* // Export table data for use with SQLite
|
|
966
963
|
* await sdb.writeDB("./my_exported_database.sqlite");
|
|
967
964
|
* ```
|
|
965
|
+
*
|
|
966
|
+
* @param file - The relative or absolute path to the output file.
|
|
967
|
+
* @param options - Configuration options for writing the database.
|
|
968
|
+
* @param options.overwrite - If true, permits atomic replacement of an existing output file. Defaults to false.
|
|
969
|
+
* @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.
|
|
970
|
+
* @returns A promise that resolves to the database, so methods can be chained.
|
|
971
|
+
* @category File Operations
|
|
968
972
|
*/
|
|
969
973
|
async writeDB(file, options = {}) {
|
|
970
974
|
await (0, writeDB_js_1.default)(this, file, options);
|
|
@@ -982,9 +986,6 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
982
986
|
* different tables execute exactly in the order they were queued. This is
|
|
983
987
|
* the database-level counterpart to `SimpleTable.run()`.
|
|
984
988
|
*
|
|
985
|
-
* @returns A promise that resolves to the SimpleDB instance once the queued methods have been executed.
|
|
986
|
-
* @category Lifecycle
|
|
987
|
-
*
|
|
988
989
|
* @example
|
|
989
990
|
* ```ts
|
|
990
991
|
* // Nothing is observed after the mutations, so run() executes them.
|
|
@@ -992,6 +993,9 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
992
993
|
* table2.loadData("data2.csv").filter(`price > 0`);
|
|
993
994
|
* await sdb.run();
|
|
994
995
|
* ```
|
|
996
|
+
*
|
|
997
|
+
* @returns A promise that resolves to the SimpleDB instance once the queued methods have been executed.
|
|
998
|
+
* @category Lifecycle
|
|
995
999
|
*/
|
|
996
1000
|
async run() {
|
|
997
1001
|
if (this.lifecycleState !== "open") {
|
|
@@ -1005,16 +1009,16 @@ class SimpleDB extends Simple_js_1.default {
|
|
|
1005
1009
|
* databases, and closes the connection and instance. Also cleans up temporary
|
|
1006
1010
|
* files and the cache. Does not copy, compact, or replace the database file.
|
|
1007
1011
|
*
|
|
1008
|
-
* @returns A promise that resolves to the SimpleDB instance after cleanup.
|
|
1009
|
-
* @throws An error after cleanup when pending execution or cleanup fails.
|
|
1010
|
-
* @category Lifecycle
|
|
1011
|
-
*
|
|
1012
1012
|
* @example
|
|
1013
1013
|
* ```ts
|
|
1014
1014
|
* // close() executes queued transformations before cleaning up resources.
|
|
1015
1015
|
* table.loadData("data.csv").convert({ price: "number" });
|
|
1016
1016
|
* await sdb.close();
|
|
1017
1017
|
* ```
|
|
1018
|
+
*
|
|
1019
|
+
* @returns A promise that resolves to the SimpleDB instance after cleanup.
|
|
1020
|
+
* @throws An error after cleanup when pending execution or cleanup fails.
|
|
1021
|
+
* @category Lifecycle
|
|
1018
1022
|
*/
|
|
1019
1023
|
async close() {
|
|
1020
1024
|
if (__classPrivateFieldGet(this, _SimpleDB_closePromise, "f") !== null) {
|