@nshiab/simple-data-analysis-core 0.0.12

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.
Files changed (773) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +43 -0
  3. package/esm/class/Simple.d.ts +66 -0
  4. package/esm/class/Simple.d.ts.map +1 -0
  5. package/esm/class/Simple.js +94 -0
  6. package/esm/class/SimpleDB.d.ts +487 -0
  7. package/esm/class/SimpleDB.d.ts.map +1 -0
  8. package/esm/class/SimpleDB.js +807 -0
  9. package/esm/class/SimpleTable.d.ts +4408 -0
  10. package/esm/class/SimpleTable.d.ts.map +1 -0
  11. package/esm/class/SimpleTable.js +5401 -0
  12. package/esm/helpers/accumulateQuery.d.ts +4 -0
  13. package/esm/helpers/accumulateQuery.d.ts.map +1 -0
  14. package/esm/helpers/accumulateQuery.js +15 -0
  15. package/esm/helpers/camelCase.d.ts +30 -0
  16. package/esm/helpers/camelCase.d.ts.map +1 -0
  17. package/esm/helpers/camelCase.js +45 -0
  18. package/esm/helpers/capitalize.d.ts +28 -0
  19. package/esm/helpers/capitalize.d.ts.map +1 -0
  20. package/esm/helpers/capitalize.js +33 -0
  21. package/esm/helpers/checkVssIndexes.d.ts +2 -0
  22. package/esm/helpers/checkVssIndexes.d.ts.map +1 -0
  23. package/esm/helpers/checkVssIndexes.js +16 -0
  24. package/esm/helpers/cleanCache.d.ts +3 -0
  25. package/esm/helpers/cleanCache.d.ts.map +1 -0
  26. package/esm/helpers/cleanCache.js +17 -0
  27. package/esm/helpers/cleanPath.d.ts +2 -0
  28. package/esm/helpers/cleanPath.d.ts.map +1 -0
  29. package/esm/helpers/cleanPath.js +3 -0
  30. package/esm/helpers/cleanSQL.d.ts +2 -0
  31. package/esm/helpers/cleanSQL.d.ts.map +1 -0
  32. package/esm/helpers/cleanSQL.js +24 -0
  33. package/esm/helpers/concatenateRowQuery.d.ts +2 -0
  34. package/esm/helpers/concatenateRowQuery.d.ts.map +1 -0
  35. package/esm/helpers/concatenateRowQuery.js +9 -0
  36. package/esm/helpers/convertForJS.d.ts +6 -0
  37. package/esm/helpers/convertForJS.d.ts.map +1 -0
  38. package/esm/helpers/convertForJS.js +39 -0
  39. package/esm/helpers/createDirectory.d.ts +2 -0
  40. package/esm/helpers/createDirectory.d.ts.map +1 -0
  41. package/esm/helpers/createDirectory.js +10 -0
  42. package/esm/helpers/csvFormat.d.ts +3 -0
  43. package/esm/helpers/csvFormat.d.ts.map +1 -0
  44. package/esm/helpers/csvFormat.js +165 -0
  45. package/esm/helpers/dataToArrays.d.ts +51 -0
  46. package/esm/helpers/dataToArrays.d.ts.map +1 -0
  47. package/esm/helpers/dataToArrays.js +55 -0
  48. package/esm/helpers/extractTypes.d.ts +6 -0
  49. package/esm/helpers/extractTypes.d.ts.map +1 -0
  50. package/esm/helpers/extractTypes.js +11 -0
  51. package/esm/helpers/findGeoColumn.d.ts +3 -0
  52. package/esm/helpers/findGeoColumn.d.ts.map +1 -0
  53. package/esm/helpers/findGeoColumn.js +18 -0
  54. package/esm/helpers/formatDate.d.ts +34 -0
  55. package/esm/helpers/formatDate.d.ts.map +1 -0
  56. package/esm/helpers/formatDate.js +69 -0
  57. package/esm/helpers/formatNumber.d.ts +46 -0
  58. package/esm/helpers/formatNumber.d.ts.map +1 -0
  59. package/esm/helpers/formatNumber.js +122 -0
  60. package/esm/helpers/getCombinations.d.ts +3 -0
  61. package/esm/helpers/getCombinations.d.ts.map +1 -0
  62. package/esm/helpers/getCombinations.js +24 -0
  63. package/esm/helpers/getExtension.d.ts +2 -0
  64. package/esm/helpers/getExtension.d.ts.map +1 -0
  65. package/esm/helpers/getExtension.js +9 -0
  66. package/esm/helpers/getIdenticalColumns.d.ts +2 -0
  67. package/esm/helpers/getIdenticalColumns.d.ts.map +1 -0
  68. package/esm/helpers/getIdenticalColumns.js +3 -0
  69. package/esm/helpers/getName.d.ts +2 -0
  70. package/esm/helpers/getName.d.ts.map +1 -0
  71. package/esm/helpers/getName.js +14 -0
  72. package/esm/helpers/getProjection.d.ts +3 -0
  73. package/esm/helpers/getProjection.d.ts.map +1 -0
  74. package/esm/helpers/getProjection.js +22 -0
  75. package/esm/helpers/getProjectionParquet.d.ts +3 -0
  76. package/esm/helpers/getProjectionParquet.d.ts.map +1 -0
  77. package/esm/helpers/getProjectionParquet.js +24 -0
  78. package/esm/helpers/index.d.ts +20 -0
  79. package/esm/helpers/index.d.ts.map +1 -0
  80. package/esm/helpers/index.js +19 -0
  81. package/esm/helpers/keepNumericalColumns.d.ts +4 -0
  82. package/esm/helpers/keepNumericalColumns.d.ts.map +1 -0
  83. package/esm/helpers/keepNumericalColumns.js +13 -0
  84. package/esm/helpers/logData.d.ts +6 -0
  85. package/esm/helpers/logData.d.ts.map +1 -0
  86. package/esm/helpers/logData.js +48 -0
  87. package/esm/helpers/mergeOptions.d.ts +28 -0
  88. package/esm/helpers/mergeOptions.d.ts.map +1 -0
  89. package/esm/helpers/mergeOptions.js +12 -0
  90. package/esm/helpers/nestQuery.d.ts +2 -0
  91. package/esm/helpers/nestQuery.d.ts.map +1 -0
  92. package/esm/helpers/nestQuery.js +13 -0
  93. package/esm/helpers/parseDuckDBType.d.ts +2 -0
  94. package/esm/helpers/parseDuckDBType.d.ts.map +1 -0
  95. package/esm/helpers/parseDuckDBType.js +38 -0
  96. package/esm/helpers/parseTypes.d.ts +2 -0
  97. package/esm/helpers/parseTypes.d.ts.map +1 -0
  98. package/esm/helpers/parseTypes.js +35 -0
  99. package/esm/helpers/parseValue.d.ts +2 -0
  100. package/esm/helpers/parseValue.d.ts.map +1 -0
  101. package/esm/helpers/parseValue.js +20 -0
  102. package/esm/helpers/prettyDuration.d.ts +55 -0
  103. package/esm/helpers/prettyDuration.d.ts.map +1 -0
  104. package/esm/helpers/prettyDuration.js +145 -0
  105. package/esm/helpers/printTable.d.ts +47 -0
  106. package/esm/helpers/printTable.d.ts.map +1 -0
  107. package/esm/helpers/printTable.js +217 -0
  108. package/esm/helpers/queryDB.d.ts +19 -0
  109. package/esm/helpers/queryDB.d.ts.map +1 -0
  110. package/esm/helpers/queryDB.js +62 -0
  111. package/esm/helpers/rewind.d.ts +3 -0
  112. package/esm/helpers/rewind.d.ts.map +1 -0
  113. package/esm/helpers/rewind.js +1293 -0
  114. package/esm/helpers/runQuery.d.ts +14 -0
  115. package/esm/helpers/runQuery.d.ts.map +1 -0
  116. package/esm/helpers/runQuery.js +26 -0
  117. package/esm/helpers/setDbProps.d.ts +3 -0
  118. package/esm/helpers/setDbProps.d.ts.map +1 -0
  119. package/esm/helpers/setDbProps.js +25 -0
  120. package/esm/helpers/shouldFlipBeforeExport.d.ts +2 -0
  121. package/esm/helpers/shouldFlipBeforeExport.d.ts.map +1 -0
  122. package/esm/helpers/shouldFlipBeforeExport.js +3 -0
  123. package/esm/helpers/stringToArray.d.ts +2 -0
  124. package/esm/helpers/stringToArray.d.ts.map +1 -0
  125. package/esm/helpers/stringToArray.js +11 -0
  126. package/esm/helpers/stringifyDates.d.ts +5 -0
  127. package/esm/helpers/stringifyDates.d.ts.map +1 -0
  128. package/esm/helpers/stringifyDates.js +14 -0
  129. package/esm/helpers/stringifyDatesInvert.d.ts +5 -0
  130. package/esm/helpers/stringifyDatesInvert.d.ts.map +1 -0
  131. package/esm/helpers/stringifyDatesInvert.js +14 -0
  132. package/esm/helpers/unifyColumns.d.ts +9 -0
  133. package/esm/helpers/unifyColumns.d.ts.map +1 -0
  134. package/esm/helpers/unifyColumns.js +21 -0
  135. package/esm/helpers/unnestQuery.d.ts +2 -0
  136. package/esm/helpers/unnestQuery.d.ts.map +1 -0
  137. package/esm/helpers/unnestQuery.js +8 -0
  138. package/esm/helpers/wrapString.d.ts +35 -0
  139. package/esm/helpers/wrapString.d.ts.map +1 -0
  140. package/esm/helpers/wrapString.js +83 -0
  141. package/esm/helpers/writeDataAsArrays.d.ts +3 -0
  142. package/esm/helpers/writeDataAsArrays.d.ts.map +1 -0
  143. package/esm/helpers/writeDataAsArrays.js +13 -0
  144. package/esm/helpers/writeProjectionsAndIndexes.d.ts +3 -0
  145. package/esm/helpers/writeProjectionsAndIndexes.d.ts.map +1 -0
  146. package/esm/helpers/writeProjectionsAndIndexes.js +29 -0
  147. package/esm/index.d.ts +31 -0
  148. package/esm/index.d.ts.map +1 -0
  149. package/esm/index.js +30 -0
  150. package/esm/methods/aggregateGeoQuery.d.ts +5 -0
  151. package/esm/methods/aggregateGeoQuery.d.ts.map +1 -0
  152. package/esm/methods/aggregateGeoQuery.js +24 -0
  153. package/esm/methods/binsQuery.d.ts +5 -0
  154. package/esm/methods/binsQuery.d.ts.map +1 -0
  155. package/esm/methods/binsQuery.js +40 -0
  156. package/esm/methods/bm25.d.ts +17 -0
  157. package/esm/methods/bm25.d.ts.map +1 -0
  158. package/esm/methods/bm25.js +48 -0
  159. package/esm/methods/cache.d.ts +6 -0
  160. package/esm/methods/cache.d.ts.map +1 -0
  161. package/esm/methods/cache.js +133 -0
  162. package/esm/methods/capitalizeQuery.d.ts +2 -0
  163. package/esm/methods/capitalizeQuery.d.ts.map +1 -0
  164. package/esm/methods/capitalizeQuery.js +8 -0
  165. package/esm/methods/cloneColumn.d.ts +4 -0
  166. package/esm/methods/cloneColumn.d.ts.map +1 -0
  167. package/esm/methods/cloneColumn.js +13 -0
  168. package/esm/methods/cloneQuery.d.ts +4 -0
  169. package/esm/methods/cloneQuery.d.ts.map +1 -0
  170. package/esm/methods/cloneQuery.js +6 -0
  171. package/esm/methods/concatenateQuery.d.ts +4 -0
  172. package/esm/methods/concatenateQuery.d.ts.map +1 -0
  173. package/esm/methods/concatenateQuery.js +13 -0
  174. package/esm/methods/convertQuery.d.ts +7 -0
  175. package/esm/methods/convertQuery.d.ts.map +1 -0
  176. package/esm/methods/convertQuery.js +78 -0
  177. package/esm/methods/correlations.d.ts +9 -0
  178. package/esm/methods/correlations.d.ts.map +1 -0
  179. package/esm/methods/correlations.js +40 -0
  180. package/esm/methods/correlationsQuery.d.ts +5 -0
  181. package/esm/methods/correlationsQuery.d.ts.map +1 -0
  182. package/esm/methods/correlationsQuery.js +26 -0
  183. package/esm/methods/createFtsIndex.d.ts +11 -0
  184. package/esm/methods/createFtsIndex.d.ts.map +1 -0
  185. package/esm/methods/createFtsIndex.js +28 -0
  186. package/esm/methods/createVssIndex.d.ts +9 -0
  187. package/esm/methods/createVssIndex.d.ts.map +1 -0
  188. package/esm/methods/createVssIndex.js +38 -0
  189. package/esm/methods/crossJoinQuery.d.ts +4 -0
  190. package/esm/methods/crossJoinQuery.d.ts.map +1 -0
  191. package/esm/methods/crossJoinQuery.js +3 -0
  192. package/esm/methods/distanceQuery.d.ts +6 -0
  193. package/esm/methods/distanceQuery.d.ts.map +1 -0
  194. package/esm/methods/distanceQuery.js +42 -0
  195. package/esm/methods/fill.d.ts +7 -0
  196. package/esm/methods/fill.d.ts.map +1 -0
  197. package/esm/methods/fill.js +60 -0
  198. package/esm/methods/fuzzyClean.d.ts +7 -0
  199. package/esm/methods/fuzzyClean.d.ts.map +1 -0
  200. package/esm/methods/fuzzyClean.js +194 -0
  201. package/esm/methods/fuzzyJoin.d.ts +8 -0
  202. package/esm/methods/fuzzyJoin.d.ts.map +1 -0
  203. package/esm/methods/fuzzyJoin.js +57 -0
  204. package/esm/methods/fuzzyJoinQuery.d.ts +2 -0
  205. package/esm/methods/fuzzyJoinQuery.d.ts.map +1 -0
  206. package/esm/methods/fuzzyJoinQuery.js +19 -0
  207. package/esm/methods/getBottom.d.ts +8 -0
  208. package/esm/methods/getBottom.d.ts.map +1 -0
  209. package/esm/methods/getBottom.js +22 -0
  210. package/esm/methods/getColumns.d.ts +3 -0
  211. package/esm/methods/getColumns.d.ts.map +1 -0
  212. package/esm/methods/getColumns.js +15 -0
  213. package/esm/methods/getDescription.d.ts +9 -0
  214. package/esm/methods/getDescription.d.ts.map +1 -0
  215. package/esm/methods/getDescription.js +20 -0
  216. package/esm/methods/getFirstRow.d.ts +7 -0
  217. package/esm/methods/getFirstRow.d.ts.map +1 -0
  218. package/esm/methods/getFirstRow.js +15 -0
  219. package/esm/methods/getGeoData.d.ts +17 -0
  220. package/esm/methods/getGeoData.d.ts.map +1 -0
  221. package/esm/methods/getGeoData.js +41 -0
  222. package/esm/methods/getLastRow.d.ts +7 -0
  223. package/esm/methods/getLastRow.d.ts.map +1 -0
  224. package/esm/methods/getLastRow.js +19 -0
  225. package/esm/methods/getMax.d.ts +3 -0
  226. package/esm/methods/getMax.d.ts.map +1 -0
  227. package/esm/methods/getMax.js +18 -0
  228. package/esm/methods/getMean.d.ts +5 -0
  229. package/esm/methods/getMean.d.ts.map +1 -0
  230. package/esm/methods/getMean.js +17 -0
  231. package/esm/methods/getMedian.d.ts +5 -0
  232. package/esm/methods/getMedian.d.ts.map +1 -0
  233. package/esm/methods/getMedian.js +17 -0
  234. package/esm/methods/getMin.d.ts +3 -0
  235. package/esm/methods/getMin.d.ts.map +1 -0
  236. package/esm/methods/getMin.js +18 -0
  237. package/esm/methods/getNbCharacters.d.ts +3 -0
  238. package/esm/methods/getNbCharacters.d.ts.map +1 -0
  239. package/esm/methods/getNbCharacters.js +15 -0
  240. package/esm/methods/getNbRows.d.ts +3 -0
  241. package/esm/methods/getNbRows.d.ts.map +1 -0
  242. package/esm/methods/getNbRows.js +15 -0
  243. package/esm/methods/getQuantile.d.ts +5 -0
  244. package/esm/methods/getQuantile.d.ts.map +1 -0
  245. package/esm/methods/getQuantile.js +17 -0
  246. package/esm/methods/getSkew.d.ts +5 -0
  247. package/esm/methods/getSkew.d.ts.map +1 -0
  248. package/esm/methods/getSkew.js +17 -0
  249. package/esm/methods/getStdDev.d.ts +5 -0
  250. package/esm/methods/getStdDev.d.ts.map +1 -0
  251. package/esm/methods/getStdDev.js +17 -0
  252. package/esm/methods/getSum.d.ts +3 -0
  253. package/esm/methods/getSum.d.ts.map +1 -0
  254. package/esm/methods/getSum.js +15 -0
  255. package/esm/methods/getTableNames.d.ts +3 -0
  256. package/esm/methods/getTableNames.d.ts.map +1 -0
  257. package/esm/methods/getTableNames.js +15 -0
  258. package/esm/methods/getTop.d.ts +7 -0
  259. package/esm/methods/getTop.d.ts.map +1 -0
  260. package/esm/methods/getTop.js +14 -0
  261. package/esm/methods/getTypes.d.ts +5 -0
  262. package/esm/methods/getTypes.d.ts.map +1 -0
  263. package/esm/methods/getTypes.js +13 -0
  264. package/esm/methods/getUniques.d.ts +3 -0
  265. package/esm/methods/getUniques.d.ts.map +1 -0
  266. package/esm/methods/getUniques.js +15 -0
  267. package/esm/methods/getValues.d.ts +3 -0
  268. package/esm/methods/getValues.d.ts.map +1 -0
  269. package/esm/methods/getValues.js +15 -0
  270. package/esm/methods/getVar.d.ts +5 -0
  271. package/esm/methods/getVar.d.ts.map +1 -0
  272. package/esm/methods/getVar.js +17 -0
  273. package/esm/methods/insertRowsQuery.d.ts +4 -0
  274. package/esm/methods/insertRowsQuery.d.ts.map +1 -0
  275. package/esm/methods/insertRowsQuery.js +11 -0
  276. package/esm/methods/join.d.ts +7 -0
  277. package/esm/methods/join.d.ts.map +1 -0
  278. package/esm/methods/join.js +63 -0
  279. package/esm/methods/joinGeo.d.ts +10 -0
  280. package/esm/methods/joinGeo.d.ts.map +1 -0
  281. package/esm/methods/joinGeo.js +76 -0
  282. package/esm/methods/joinGeoQuery.d.ts +2 -0
  283. package/esm/methods/joinGeoQuery.d.ts.map +1 -0
  284. package/esm/methods/joinGeoQuery.js +55 -0
  285. package/esm/methods/joinQuery.d.ts +2 -0
  286. package/esm/methods/joinQuery.d.ts.map +1 -0
  287. package/esm/methods/joinQuery.js +21 -0
  288. package/esm/methods/keepQuery.d.ts +4 -0
  289. package/esm/methods/keepQuery.d.ts.map +1 -0
  290. package/esm/methods/keepQuery.js +15 -0
  291. package/esm/methods/linearRegressionQuery.d.ts +5 -0
  292. package/esm/methods/linearRegressionQuery.d.ts.map +1 -0
  293. package/esm/methods/linearRegressionQuery.js +37 -0
  294. package/esm/methods/linearRegressions.d.ts +9 -0
  295. package/esm/methods/linearRegressions.d.ts.map +1 -0
  296. package/esm/methods/linearRegressions.js +43 -0
  297. package/esm/methods/loadArray.d.ts +5 -0
  298. package/esm/methods/loadArray.d.ts.map +1 -0
  299. package/esm/methods/loadArray.js +78 -0
  300. package/esm/methods/loadDataQuery.d.ts +23 -0
  301. package/esm/methods/loadDataQuery.d.ts.map +1 -0
  302. package/esm/methods/loadDataQuery.js +77 -0
  303. package/esm/methods/lowerQuery.d.ts +2 -0
  304. package/esm/methods/lowerQuery.d.ts.map +1 -0
  305. package/esm/methods/lowerQuery.js +7 -0
  306. package/esm/methods/normalizeQuery.d.ts +5 -0
  307. package/esm/methods/normalizeQuery.d.ts.map +1 -0
  308. package/esm/methods/normalizeQuery.js +22 -0
  309. package/esm/methods/normalizeString.d.ts +5 -0
  310. package/esm/methods/normalizeString.d.ts.map +1 -0
  311. package/esm/methods/normalizeString.js +26 -0
  312. package/esm/methods/outliersIQRQuery.d.ts +4 -0
  313. package/esm/methods/outliersIQRQuery.d.ts.map +1 -0
  314. package/esm/methods/outliersIQRQuery.js +31 -0
  315. package/esm/methods/proportionsHorizontalQuery.d.ts +5 -0
  316. package/esm/methods/proportionsHorizontalQuery.d.ts.map +1 -0
  317. package/esm/methods/proportionsHorizontalQuery.js +15 -0
  318. package/esm/methods/proportionsVerticalQuery.d.ts +5 -0
  319. package/esm/methods/proportionsVerticalQuery.d.ts.map +1 -0
  320. package/esm/methods/proportionsVerticalQuery.js +19 -0
  321. package/esm/methods/quantilesQuery.d.ts +4 -0
  322. package/esm/methods/quantilesQuery.d.ts.map +1 -0
  323. package/esm/methods/quantilesQuery.js +12 -0
  324. package/esm/methods/ranksQuery.d.ts +6 -0
  325. package/esm/methods/ranksQuery.d.ts.map +1 -0
  326. package/esm/methods/ranksQuery.js +12 -0
  327. package/esm/methods/removeDuplicatesQuery.d.ts +4 -0
  328. package/esm/methods/removeDuplicatesQuery.d.ts.map +1 -0
  329. package/esm/methods/removeDuplicatesQuery.js +12 -0
  330. package/esm/methods/removeMissing.d.ts +7 -0
  331. package/esm/methods/removeMissing.d.ts.map +1 -0
  332. package/esm/methods/removeMissing.js +21 -0
  333. package/esm/methods/removeMissingQuery.d.ts +7 -0
  334. package/esm/methods/removeMissingQuery.d.ts.map +1 -0
  335. package/esm/methods/removeMissingQuery.js +43 -0
  336. package/esm/methods/removeQuery.d.ts +4 -0
  337. package/esm/methods/removeQuery.d.ts.map +1 -0
  338. package/esm/methods/removeQuery.js +15 -0
  339. package/esm/methods/renameColumnQuery.d.ts +2 -0
  340. package/esm/methods/renameColumnQuery.d.ts.map +1 -0
  341. package/esm/methods/renameColumnQuery.js +7 -0
  342. package/esm/methods/replaceNullsQuery.d.ts +2 -0
  343. package/esm/methods/replaceNullsQuery.d.ts.map +1 -0
  344. package/esm/methods/replaceNullsQuery.js +10 -0
  345. package/esm/methods/replaceQuery.d.ts +5 -0
  346. package/esm/methods/replaceQuery.d.ts.map +1 -0
  347. package/esm/methods/replaceQuery.js +24 -0
  348. package/esm/methods/rollingQuery.d.ts +5 -0
  349. package/esm/methods/rollingQuery.d.ts.map +1 -0
  350. package/esm/methods/rollingQuery.js +33 -0
  351. package/esm/methods/roundQuery.d.ts +5 -0
  352. package/esm/methods/roundQuery.d.ts.map +1 -0
  353. package/esm/methods/roundQuery.js +16 -0
  354. package/esm/methods/selectRowsQuery.d.ts +5 -0
  355. package/esm/methods/selectRowsQuery.d.ts.map +1 -0
  356. package/esm/methods/selectRowsQuery.js +3 -0
  357. package/esm/methods/sortQuery.d.ts +8 -0
  358. package/esm/methods/sortQuery.d.ts.map +1 -0
  359. package/esm/methods/sortQuery.js +18 -0
  360. package/esm/methods/splitSpread.d.ts +5 -0
  361. package/esm/methods/splitSpread.d.ts.map +1 -0
  362. package/esm/methods/splitSpread.js +61 -0
  363. package/esm/methods/summarize.d.ts +13 -0
  364. package/esm/methods/summarize.d.ts.map +1 -0
  365. package/esm/methods/summarize.js +60 -0
  366. package/esm/methods/summarizeQuery.d.ts +7 -0
  367. package/esm/methods/summarizeQuery.d.ts.map +1 -0
  368. package/esm/methods/summarizeQuery.js +112 -0
  369. package/esm/methods/trimQuery.d.ts +5 -0
  370. package/esm/methods/trimQuery.d.ts.map +1 -0
  371. package/esm/methods/trimQuery.js +29 -0
  372. package/esm/methods/truncateQuery.d.ts +2 -0
  373. package/esm/methods/truncateQuery.d.ts.map +1 -0
  374. package/esm/methods/truncateQuery.js +3 -0
  375. package/esm/methods/upperQuery.d.ts +2 -0
  376. package/esm/methods/upperQuery.d.ts.map +1 -0
  377. package/esm/methods/upperQuery.js +7 -0
  378. package/esm/methods/writeDataQuery.d.ts +5 -0
  379. package/esm/methods/writeDataQuery.d.ts.map +1 -0
  380. package/esm/methods/writeDataQuery.js +44 -0
  381. package/esm/methods/writeGeoDataQuery.d.ts +4 -0
  382. package/esm/methods/writeGeoDataQuery.d.ts.map +1 -0
  383. package/esm/methods/writeGeoDataQuery.js +16 -0
  384. package/esm/methods/zScoreQuery.d.ts +5 -0
  385. package/esm/methods/zScoreQuery.d.ts.map +1 -0
  386. package/esm/methods/zScoreQuery.js +23 -0
  387. package/esm/package.json +3 -0
  388. package/package.json +27 -0
  389. package/script/class/Simple.d.ts +66 -0
  390. package/script/class/Simple.d.ts.map +1 -0
  391. package/script/class/Simple.js +97 -0
  392. package/script/class/SimpleDB.d.ts +487 -0
  393. package/script/class/SimpleDB.d.ts.map +1 -0
  394. package/script/class/SimpleDB.js +813 -0
  395. package/script/class/SimpleTable.d.ts +4408 -0
  396. package/script/class/SimpleTable.d.ts.map +1 -0
  397. package/script/class/SimpleTable.js +5407 -0
  398. package/script/helpers/accumulateQuery.d.ts +4 -0
  399. package/script/helpers/accumulateQuery.d.ts.map +1 -0
  400. package/script/helpers/accumulateQuery.js +21 -0
  401. package/script/helpers/camelCase.d.ts +30 -0
  402. package/script/helpers/camelCase.d.ts.map +1 -0
  403. package/script/helpers/camelCase.js +51 -0
  404. package/script/helpers/capitalize.d.ts +28 -0
  405. package/script/helpers/capitalize.d.ts.map +1 -0
  406. package/script/helpers/capitalize.js +36 -0
  407. package/script/helpers/checkVssIndexes.d.ts +2 -0
  408. package/script/helpers/checkVssIndexes.d.ts.map +1 -0
  409. package/script/helpers/checkVssIndexes.js +19 -0
  410. package/script/helpers/cleanCache.d.ts +3 -0
  411. package/script/helpers/cleanCache.d.ts.map +1 -0
  412. package/script/helpers/cleanCache.js +20 -0
  413. package/script/helpers/cleanPath.d.ts +2 -0
  414. package/script/helpers/cleanPath.d.ts.map +1 -0
  415. package/script/helpers/cleanPath.js +6 -0
  416. package/script/helpers/cleanSQL.d.ts +2 -0
  417. package/script/helpers/cleanSQL.d.ts.map +1 -0
  418. package/script/helpers/cleanSQL.js +27 -0
  419. package/script/helpers/concatenateRowQuery.d.ts +2 -0
  420. package/script/helpers/concatenateRowQuery.d.ts.map +1 -0
  421. package/script/helpers/concatenateRowQuery.js +12 -0
  422. package/script/helpers/convertForJS.d.ts +6 -0
  423. package/script/helpers/convertForJS.d.ts.map +1 -0
  424. package/script/helpers/convertForJS.js +42 -0
  425. package/script/helpers/createDirectory.d.ts +2 -0
  426. package/script/helpers/createDirectory.d.ts.map +1 -0
  427. package/script/helpers/createDirectory.js +13 -0
  428. package/script/helpers/csvFormat.d.ts +3 -0
  429. package/script/helpers/csvFormat.d.ts.map +1 -0
  430. package/script/helpers/csvFormat.js +168 -0
  431. package/script/helpers/dataToArrays.d.ts +51 -0
  432. package/script/helpers/dataToArrays.d.ts.map +1 -0
  433. package/script/helpers/dataToArrays.js +58 -0
  434. package/script/helpers/extractTypes.d.ts +6 -0
  435. package/script/helpers/extractTypes.d.ts.map +1 -0
  436. package/script/helpers/extractTypes.js +14 -0
  437. package/script/helpers/findGeoColumn.d.ts +3 -0
  438. package/script/helpers/findGeoColumn.d.ts.map +1 -0
  439. package/script/helpers/findGeoColumn.js +21 -0
  440. package/script/helpers/formatDate.d.ts +34 -0
  441. package/script/helpers/formatDate.d.ts.map +1 -0
  442. package/script/helpers/formatDate.js +72 -0
  443. package/script/helpers/formatNumber.d.ts +46 -0
  444. package/script/helpers/formatNumber.d.ts.map +1 -0
  445. package/script/helpers/formatNumber.js +125 -0
  446. package/script/helpers/getCombinations.d.ts +3 -0
  447. package/script/helpers/getCombinations.d.ts.map +1 -0
  448. package/script/helpers/getCombinations.js +26 -0
  449. package/script/helpers/getExtension.d.ts +2 -0
  450. package/script/helpers/getExtension.d.ts.map +1 -0
  451. package/script/helpers/getExtension.js +12 -0
  452. package/script/helpers/getIdenticalColumns.d.ts +2 -0
  453. package/script/helpers/getIdenticalColumns.d.ts.map +1 -0
  454. package/script/helpers/getIdenticalColumns.js +6 -0
  455. package/script/helpers/getName.d.ts +2 -0
  456. package/script/helpers/getName.d.ts.map +1 -0
  457. package/script/helpers/getName.js +17 -0
  458. package/script/helpers/getProjection.d.ts +3 -0
  459. package/script/helpers/getProjection.d.ts.map +1 -0
  460. package/script/helpers/getProjection.js +28 -0
  461. package/script/helpers/getProjectionParquet.d.ts +3 -0
  462. package/script/helpers/getProjectionParquet.d.ts.map +1 -0
  463. package/script/helpers/getProjectionParquet.js +30 -0
  464. package/script/helpers/index.d.ts +20 -0
  465. package/script/helpers/index.d.ts.map +1 -0
  466. package/script/helpers/index.js +30 -0
  467. package/script/helpers/keepNumericalColumns.d.ts +4 -0
  468. package/script/helpers/keepNumericalColumns.d.ts.map +1 -0
  469. package/script/helpers/keepNumericalColumns.js +16 -0
  470. package/script/helpers/logData.d.ts +6 -0
  471. package/script/helpers/logData.d.ts.map +1 -0
  472. package/script/helpers/logData.js +54 -0
  473. package/script/helpers/mergeOptions.d.ts +28 -0
  474. package/script/helpers/mergeOptions.d.ts.map +1 -0
  475. package/script/helpers/mergeOptions.js +15 -0
  476. package/script/helpers/nestQuery.d.ts +2 -0
  477. package/script/helpers/nestQuery.d.ts.map +1 -0
  478. package/script/helpers/nestQuery.js +19 -0
  479. package/script/helpers/parseDuckDBType.d.ts +2 -0
  480. package/script/helpers/parseDuckDBType.d.ts.map +1 -0
  481. package/script/helpers/parseDuckDBType.js +41 -0
  482. package/script/helpers/parseTypes.d.ts +2 -0
  483. package/script/helpers/parseTypes.d.ts.map +1 -0
  484. package/script/helpers/parseTypes.js +38 -0
  485. package/script/helpers/parseValue.d.ts +2 -0
  486. package/script/helpers/parseValue.d.ts.map +1 -0
  487. package/script/helpers/parseValue.js +23 -0
  488. package/script/helpers/prettyDuration.d.ts +55 -0
  489. package/script/helpers/prettyDuration.d.ts.map +1 -0
  490. package/script/helpers/prettyDuration.js +148 -0
  491. package/script/helpers/printTable.d.ts +47 -0
  492. package/script/helpers/printTable.d.ts.map +1 -0
  493. package/script/helpers/printTable.js +223 -0
  494. package/script/helpers/queryDB.d.ts +19 -0
  495. package/script/helpers/queryDB.d.ts.map +1 -0
  496. package/script/helpers/queryDB.js +68 -0
  497. package/script/helpers/rewind.d.ts +3 -0
  498. package/script/helpers/rewind.d.ts.map +1 -0
  499. package/script/helpers/rewind.js +1295 -0
  500. package/script/helpers/runQuery.d.ts +14 -0
  501. package/script/helpers/runQuery.d.ts.map +1 -0
  502. package/script/helpers/runQuery.js +32 -0
  503. package/script/helpers/setDbProps.d.ts +3 -0
  504. package/script/helpers/setDbProps.d.ts.map +1 -0
  505. package/script/helpers/setDbProps.js +28 -0
  506. package/script/helpers/shouldFlipBeforeExport.d.ts +2 -0
  507. package/script/helpers/shouldFlipBeforeExport.d.ts.map +1 -0
  508. package/script/helpers/shouldFlipBeforeExport.js +6 -0
  509. package/script/helpers/stringToArray.d.ts +2 -0
  510. package/script/helpers/stringToArray.d.ts.map +1 -0
  511. package/script/helpers/stringToArray.js +14 -0
  512. package/script/helpers/stringifyDates.d.ts +5 -0
  513. package/script/helpers/stringifyDates.d.ts.map +1 -0
  514. package/script/helpers/stringifyDates.js +17 -0
  515. package/script/helpers/stringifyDatesInvert.d.ts +5 -0
  516. package/script/helpers/stringifyDatesInvert.d.ts.map +1 -0
  517. package/script/helpers/stringifyDatesInvert.js +17 -0
  518. package/script/helpers/unifyColumns.d.ts +9 -0
  519. package/script/helpers/unifyColumns.d.ts.map +1 -0
  520. package/script/helpers/unifyColumns.js +24 -0
  521. package/script/helpers/unnestQuery.d.ts +2 -0
  522. package/script/helpers/unnestQuery.d.ts.map +1 -0
  523. package/script/helpers/unnestQuery.js +11 -0
  524. package/script/helpers/wrapString.d.ts +35 -0
  525. package/script/helpers/wrapString.d.ts.map +1 -0
  526. package/script/helpers/wrapString.js +86 -0
  527. package/script/helpers/writeDataAsArrays.d.ts +3 -0
  528. package/script/helpers/writeDataAsArrays.d.ts.map +1 -0
  529. package/script/helpers/writeDataAsArrays.js +19 -0
  530. package/script/helpers/writeProjectionsAndIndexes.d.ts +3 -0
  531. package/script/helpers/writeProjectionsAndIndexes.d.ts.map +1 -0
  532. package/script/helpers/writeProjectionsAndIndexes.js +32 -0
  533. package/script/index.d.ts +31 -0
  534. package/script/index.d.ts.map +1 -0
  535. package/script/index.js +38 -0
  536. package/script/methods/aggregateGeoQuery.d.ts +5 -0
  537. package/script/methods/aggregateGeoQuery.d.ts.map +1 -0
  538. package/script/methods/aggregateGeoQuery.js +30 -0
  539. package/script/methods/binsQuery.d.ts +5 -0
  540. package/script/methods/binsQuery.d.ts.map +1 -0
  541. package/script/methods/binsQuery.js +43 -0
  542. package/script/methods/bm25.d.ts +17 -0
  543. package/script/methods/bm25.d.ts.map +1 -0
  544. package/script/methods/bm25.js +54 -0
  545. package/script/methods/cache.d.ts +6 -0
  546. package/script/methods/cache.d.ts.map +1 -0
  547. package/script/methods/cache.js +139 -0
  548. package/script/methods/capitalizeQuery.d.ts +2 -0
  549. package/script/methods/capitalizeQuery.d.ts.map +1 -0
  550. package/script/methods/capitalizeQuery.js +11 -0
  551. package/script/methods/cloneColumn.d.ts +4 -0
  552. package/script/methods/cloneColumn.d.ts.map +1 -0
  553. package/script/methods/cloneColumn.js +16 -0
  554. package/script/methods/cloneQuery.d.ts +4 -0
  555. package/script/methods/cloneQuery.d.ts.map +1 -0
  556. package/script/methods/cloneQuery.js +9 -0
  557. package/script/methods/concatenateQuery.d.ts +4 -0
  558. package/script/methods/concatenateQuery.d.ts.map +1 -0
  559. package/script/methods/concatenateQuery.js +16 -0
  560. package/script/methods/convertQuery.d.ts +7 -0
  561. package/script/methods/convertQuery.d.ts.map +1 -0
  562. package/script/methods/convertQuery.js +84 -0
  563. package/script/methods/correlations.d.ts +9 -0
  564. package/script/methods/correlations.d.ts.map +1 -0
  565. package/script/methods/correlations.js +46 -0
  566. package/script/methods/correlationsQuery.d.ts +5 -0
  567. package/script/methods/correlationsQuery.d.ts.map +1 -0
  568. package/script/methods/correlationsQuery.js +32 -0
  569. package/script/methods/createFtsIndex.d.ts +11 -0
  570. package/script/methods/createFtsIndex.d.ts.map +1 -0
  571. package/script/methods/createFtsIndex.js +34 -0
  572. package/script/methods/createVssIndex.d.ts +9 -0
  573. package/script/methods/createVssIndex.d.ts.map +1 -0
  574. package/script/methods/createVssIndex.js +44 -0
  575. package/script/methods/crossJoinQuery.d.ts +4 -0
  576. package/script/methods/crossJoinQuery.d.ts.map +1 -0
  577. package/script/methods/crossJoinQuery.js +6 -0
  578. package/script/methods/distanceQuery.d.ts +6 -0
  579. package/script/methods/distanceQuery.d.ts.map +1 -0
  580. package/script/methods/distanceQuery.js +45 -0
  581. package/script/methods/fill.d.ts +7 -0
  582. package/script/methods/fill.d.ts.map +1 -0
  583. package/script/methods/fill.js +66 -0
  584. package/script/methods/fuzzyClean.d.ts +7 -0
  585. package/script/methods/fuzzyClean.d.ts.map +1 -0
  586. package/script/methods/fuzzyClean.js +200 -0
  587. package/script/methods/fuzzyJoin.d.ts +8 -0
  588. package/script/methods/fuzzyJoin.d.ts.map +1 -0
  589. package/script/methods/fuzzyJoin.js +63 -0
  590. package/script/methods/fuzzyJoinQuery.d.ts +2 -0
  591. package/script/methods/fuzzyJoinQuery.d.ts.map +1 -0
  592. package/script/methods/fuzzyJoinQuery.js +22 -0
  593. package/script/methods/getBottom.d.ts +8 -0
  594. package/script/methods/getBottom.d.ts.map +1 -0
  595. package/script/methods/getBottom.js +28 -0
  596. package/script/methods/getColumns.d.ts +3 -0
  597. package/script/methods/getColumns.d.ts.map +1 -0
  598. package/script/methods/getColumns.js +21 -0
  599. package/script/methods/getDescription.d.ts +9 -0
  600. package/script/methods/getDescription.d.ts.map +1 -0
  601. package/script/methods/getDescription.js +23 -0
  602. package/script/methods/getFirstRow.d.ts +7 -0
  603. package/script/methods/getFirstRow.d.ts.map +1 -0
  604. package/script/methods/getFirstRow.js +21 -0
  605. package/script/methods/getGeoData.d.ts +17 -0
  606. package/script/methods/getGeoData.d.ts.map +1 -0
  607. package/script/methods/getGeoData.js +47 -0
  608. package/script/methods/getLastRow.d.ts +7 -0
  609. package/script/methods/getLastRow.d.ts.map +1 -0
  610. package/script/methods/getLastRow.js +25 -0
  611. package/script/methods/getMax.d.ts +3 -0
  612. package/script/methods/getMax.d.ts.map +1 -0
  613. package/script/methods/getMax.js +24 -0
  614. package/script/methods/getMean.d.ts +5 -0
  615. package/script/methods/getMean.d.ts.map +1 -0
  616. package/script/methods/getMean.js +23 -0
  617. package/script/methods/getMedian.d.ts +5 -0
  618. package/script/methods/getMedian.d.ts.map +1 -0
  619. package/script/methods/getMedian.js +23 -0
  620. package/script/methods/getMin.d.ts +3 -0
  621. package/script/methods/getMin.d.ts.map +1 -0
  622. package/script/methods/getMin.js +24 -0
  623. package/script/methods/getNbCharacters.d.ts +3 -0
  624. package/script/methods/getNbCharacters.d.ts.map +1 -0
  625. package/script/methods/getNbCharacters.js +21 -0
  626. package/script/methods/getNbRows.d.ts +3 -0
  627. package/script/methods/getNbRows.d.ts.map +1 -0
  628. package/script/methods/getNbRows.js +21 -0
  629. package/script/methods/getQuantile.d.ts +5 -0
  630. package/script/methods/getQuantile.d.ts.map +1 -0
  631. package/script/methods/getQuantile.js +23 -0
  632. package/script/methods/getSkew.d.ts +5 -0
  633. package/script/methods/getSkew.d.ts.map +1 -0
  634. package/script/methods/getSkew.js +23 -0
  635. package/script/methods/getStdDev.d.ts +5 -0
  636. package/script/methods/getStdDev.d.ts.map +1 -0
  637. package/script/methods/getStdDev.js +23 -0
  638. package/script/methods/getSum.d.ts +3 -0
  639. package/script/methods/getSum.d.ts.map +1 -0
  640. package/script/methods/getSum.js +21 -0
  641. package/script/methods/getTableNames.d.ts +3 -0
  642. package/script/methods/getTableNames.d.ts.map +1 -0
  643. package/script/methods/getTableNames.js +21 -0
  644. package/script/methods/getTop.d.ts +7 -0
  645. package/script/methods/getTop.d.ts.map +1 -0
  646. package/script/methods/getTop.js +20 -0
  647. package/script/methods/getTypes.d.ts +5 -0
  648. package/script/methods/getTypes.d.ts.map +1 -0
  649. package/script/methods/getTypes.js +19 -0
  650. package/script/methods/getUniques.d.ts +3 -0
  651. package/script/methods/getUniques.d.ts.map +1 -0
  652. package/script/methods/getUniques.js +21 -0
  653. package/script/methods/getValues.d.ts +3 -0
  654. package/script/methods/getValues.d.ts.map +1 -0
  655. package/script/methods/getValues.js +21 -0
  656. package/script/methods/getVar.d.ts +5 -0
  657. package/script/methods/getVar.d.ts.map +1 -0
  658. package/script/methods/getVar.js +23 -0
  659. package/script/methods/insertRowsQuery.d.ts +4 -0
  660. package/script/methods/insertRowsQuery.d.ts.map +1 -0
  661. package/script/methods/insertRowsQuery.js +17 -0
  662. package/script/methods/join.d.ts +7 -0
  663. package/script/methods/join.d.ts.map +1 -0
  664. package/script/methods/join.js +69 -0
  665. package/script/methods/joinGeo.d.ts +10 -0
  666. package/script/methods/joinGeo.d.ts.map +1 -0
  667. package/script/methods/joinGeo.js +82 -0
  668. package/script/methods/joinGeoQuery.d.ts +2 -0
  669. package/script/methods/joinGeoQuery.d.ts.map +1 -0
  670. package/script/methods/joinGeoQuery.js +58 -0
  671. package/script/methods/joinQuery.d.ts +2 -0
  672. package/script/methods/joinQuery.d.ts.map +1 -0
  673. package/script/methods/joinQuery.js +24 -0
  674. package/script/methods/keepQuery.d.ts +4 -0
  675. package/script/methods/keepQuery.d.ts.map +1 -0
  676. package/script/methods/keepQuery.js +21 -0
  677. package/script/methods/linearRegressionQuery.d.ts +5 -0
  678. package/script/methods/linearRegressionQuery.d.ts.map +1 -0
  679. package/script/methods/linearRegressionQuery.js +43 -0
  680. package/script/methods/linearRegressions.d.ts +9 -0
  681. package/script/methods/linearRegressions.d.ts.map +1 -0
  682. package/script/methods/linearRegressions.js +49 -0
  683. package/script/methods/loadArray.d.ts +5 -0
  684. package/script/methods/loadArray.d.ts.map +1 -0
  685. package/script/methods/loadArray.js +84 -0
  686. package/script/methods/loadDataQuery.d.ts +23 -0
  687. package/script/methods/loadDataQuery.d.ts.map +1 -0
  688. package/script/methods/loadDataQuery.js +83 -0
  689. package/script/methods/lowerQuery.d.ts +2 -0
  690. package/script/methods/lowerQuery.d.ts.map +1 -0
  691. package/script/methods/lowerQuery.js +10 -0
  692. package/script/methods/normalizeQuery.d.ts +5 -0
  693. package/script/methods/normalizeQuery.d.ts.map +1 -0
  694. package/script/methods/normalizeQuery.js +28 -0
  695. package/script/methods/normalizeString.d.ts +5 -0
  696. package/script/methods/normalizeString.d.ts.map +1 -0
  697. package/script/methods/normalizeString.js +32 -0
  698. package/script/methods/outliersIQRQuery.d.ts +4 -0
  699. package/script/methods/outliersIQRQuery.d.ts.map +1 -0
  700. package/script/methods/outliersIQRQuery.js +37 -0
  701. package/script/methods/proportionsHorizontalQuery.d.ts +5 -0
  702. package/script/methods/proportionsHorizontalQuery.d.ts.map +1 -0
  703. package/script/methods/proportionsHorizontalQuery.js +18 -0
  704. package/script/methods/proportionsVerticalQuery.d.ts +5 -0
  705. package/script/methods/proportionsVerticalQuery.d.ts.map +1 -0
  706. package/script/methods/proportionsVerticalQuery.js +25 -0
  707. package/script/methods/quantilesQuery.d.ts +4 -0
  708. package/script/methods/quantilesQuery.d.ts.map +1 -0
  709. package/script/methods/quantilesQuery.js +18 -0
  710. package/script/methods/ranksQuery.d.ts +6 -0
  711. package/script/methods/ranksQuery.d.ts.map +1 -0
  712. package/script/methods/ranksQuery.js +18 -0
  713. package/script/methods/removeDuplicatesQuery.d.ts +4 -0
  714. package/script/methods/removeDuplicatesQuery.d.ts.map +1 -0
  715. package/script/methods/removeDuplicatesQuery.js +18 -0
  716. package/script/methods/removeMissing.d.ts +7 -0
  717. package/script/methods/removeMissing.d.ts.map +1 -0
  718. package/script/methods/removeMissing.js +27 -0
  719. package/script/methods/removeMissingQuery.d.ts +7 -0
  720. package/script/methods/removeMissingQuery.d.ts.map +1 -0
  721. package/script/methods/removeMissingQuery.js +46 -0
  722. package/script/methods/removeQuery.d.ts +4 -0
  723. package/script/methods/removeQuery.d.ts.map +1 -0
  724. package/script/methods/removeQuery.js +21 -0
  725. package/script/methods/renameColumnQuery.d.ts +2 -0
  726. package/script/methods/renameColumnQuery.d.ts.map +1 -0
  727. package/script/methods/renameColumnQuery.js +10 -0
  728. package/script/methods/replaceNullsQuery.d.ts +2 -0
  729. package/script/methods/replaceNullsQuery.d.ts.map +1 -0
  730. package/script/methods/replaceNullsQuery.js +16 -0
  731. package/script/methods/replaceQuery.d.ts +5 -0
  732. package/script/methods/replaceQuery.d.ts.map +1 -0
  733. package/script/methods/replaceQuery.js +27 -0
  734. package/script/methods/rollingQuery.d.ts +5 -0
  735. package/script/methods/rollingQuery.d.ts.map +1 -0
  736. package/script/methods/rollingQuery.js +39 -0
  737. package/script/methods/roundQuery.d.ts +5 -0
  738. package/script/methods/roundQuery.d.ts.map +1 -0
  739. package/script/methods/roundQuery.js +19 -0
  740. package/script/methods/selectRowsQuery.d.ts +5 -0
  741. package/script/methods/selectRowsQuery.d.ts.map +1 -0
  742. package/script/methods/selectRowsQuery.js +6 -0
  743. package/script/methods/sortQuery.d.ts +8 -0
  744. package/script/methods/sortQuery.d.ts.map +1 -0
  745. package/script/methods/sortQuery.js +21 -0
  746. package/script/methods/splitSpread.d.ts +5 -0
  747. package/script/methods/splitSpread.d.ts.map +1 -0
  748. package/script/methods/splitSpread.js +67 -0
  749. package/script/methods/summarize.d.ts +13 -0
  750. package/script/methods/summarize.d.ts.map +1 -0
  751. package/script/methods/summarize.js +66 -0
  752. package/script/methods/summarizeQuery.d.ts +7 -0
  753. package/script/methods/summarizeQuery.d.ts.map +1 -0
  754. package/script/methods/summarizeQuery.js +115 -0
  755. package/script/methods/trimQuery.d.ts +5 -0
  756. package/script/methods/trimQuery.d.ts.map +1 -0
  757. package/script/methods/trimQuery.js +32 -0
  758. package/script/methods/truncateQuery.d.ts +2 -0
  759. package/script/methods/truncateQuery.d.ts.map +1 -0
  760. package/script/methods/truncateQuery.js +6 -0
  761. package/script/methods/upperQuery.d.ts +2 -0
  762. package/script/methods/upperQuery.d.ts.map +1 -0
  763. package/script/methods/upperQuery.js +10 -0
  764. package/script/methods/writeDataQuery.d.ts +5 -0
  765. package/script/methods/writeDataQuery.d.ts.map +1 -0
  766. package/script/methods/writeDataQuery.js +50 -0
  767. package/script/methods/writeGeoDataQuery.d.ts +4 -0
  768. package/script/methods/writeGeoDataQuery.d.ts.map +1 -0
  769. package/script/methods/writeGeoDataQuery.js +22 -0
  770. package/script/methods/zScoreQuery.d.ts +5 -0
  771. package/script/methods/zScoreQuery.d.ts.map +1 -0
  772. package/script/methods/zScoreQuery.js +29 -0
  773. package/script/package.json +3 -0
@@ -0,0 +1,12 @@
1
+ export default function mergeOptions(simple, options) {
2
+ return {
3
+ table: options.table,
4
+ method: options.method,
5
+ parameters: options.parameters,
6
+ nbRowsToLog: options.nbRowsToLog ?? simple.nbRowsToLog,
7
+ nbCharactersToLog: simple.nbCharactersToLog,
8
+ returnDataFrom: options.returnDataFrom ?? "none",
9
+ debug: options.debug ?? simple.debug,
10
+ types: options.types,
11
+ };
12
+ }
@@ -0,0 +1,2 @@
1
+ export default function nestQuery(table: string, column: string, separator: string, categories: string | string[]): string;
2
+ //# sourceMappingURL=nestQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestQuery.d.ts","sourceRoot":"","sources":["../../src/helpers/nestQuery.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,UAc9B"}
@@ -0,0 +1,13 @@
1
+ import stringToArray from "./stringToArray.js";
2
+ export default function nestQuery(table, column, separator, categories) {
3
+ const cats = stringToArray(categories);
4
+ const groupBy = cats.map((d) => `"${d}"`).join(", ");
5
+ const selectColumns = `${groupBy}, `;
6
+ const orderBy = `\nORDER BY ${cats.map((d) => `"${d}" ASC`).join(", ")}`;
7
+ const query = `CREATE OR REPLACE TABLE "${table}" AS
8
+ SELECT
9
+ ${selectColumns}STRING_AGG("${column}", '${separator}') AS "${column}"
10
+ FROM "${table}"
11
+ GROUP BY ${groupBy}${orderBy};`;
12
+ return query;
13
+ }
@@ -0,0 +1,2 @@
1
+ export default function parseDuckDBType(type: string): import("@duckdb/node-api").DuckDBIntegerType | import("@duckdb/node-api").DuckDBBigIntType | import("@duckdb/node-api").DuckDBDoubleType | import("@duckdb/node-api").DuckDBVarCharType | import("@duckdb/node-api").DuckDBTimestampType | import("@duckdb/node-api").DuckDBTimestampTZType | import("@duckdb/node-api").DuckDBDateType | import("@duckdb/node-api").DuckDBTimeType | import("@duckdb/node-api").DuckDBBooleanType | import("@duckdb/node-api").DuckDBArrayType;
2
+ //# sourceMappingURL=parseDuckDBType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseDuckDBType.d.ts","sourceRoot":"","sources":["../../src/helpers/parseDuckDBType.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,IAAI,EAAE,MAAM,mdA0BnD"}
@@ -0,0 +1,38 @@
1
+ import { ARRAY, BIGINT, BOOLEAN, DATE, DOUBLE, FLOAT, INTEGER, TIME, TIMESTAMP, TIMESTAMPTZ, VARCHAR, } from "@duckdb/node-api";
2
+ export default function parseDuckDBType(type) {
3
+ if (type === "INTEGER") {
4
+ return INTEGER;
5
+ }
6
+ else if (type === "BIGINT") {
7
+ return BIGINT;
8
+ }
9
+ else if (type === "DOUBLE") {
10
+ return DOUBLE;
11
+ }
12
+ else if (type === "VARCHAR") {
13
+ return VARCHAR;
14
+ }
15
+ else if (type === "TIMESTAMP") {
16
+ return TIMESTAMP;
17
+ }
18
+ else if (type === "TIMESTAMP WITH TIME ZONE") {
19
+ return TIMESTAMPTZ;
20
+ }
21
+ else if (type === "DATE") {
22
+ return DATE;
23
+ }
24
+ else if (type === "TIME") {
25
+ return TIME;
26
+ }
27
+ else if (type === "BOOLEAN") {
28
+ return BOOLEAN;
29
+ }
30
+ else if (type.includes("FLOAT[")) {
31
+ // For embeddings
32
+ const size = type.replace("FLOAT[", "").replace("]", "");
33
+ return ARRAY(FLOAT, parseInt(size));
34
+ }
35
+ else {
36
+ throw new Error(`Type ${type} not supported.`);
37
+ }
38
+ }
@@ -0,0 +1,2 @@
1
+ export default function parseType(type: "integer" | "float" | "number" | "string" | "date" | "time" | "datetime" | "datetimeTz" | "bigint" | "double" | "varchar" | "timestamp" | "timestamp with time zone" | "boolean" | "geometry"): string;
2
+ //# sourceMappingURL=parseTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseTypes.d.ts","sourceRoot":"","sources":["../../src/helpers/parseTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,IAAI,EACA,SAAS,GACT,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,WAAW,GACX,0BAA0B,GAC1B,SAAS,GACT,UAAU,UA+Bf"}
@@ -0,0 +1,35 @@
1
+ export default function parseType(type) {
2
+ const typeLowerCase = type.toLowerCase();
3
+ if (typeLowerCase === "integer") {
4
+ return "INTEGER";
5
+ }
6
+ else if (typeLowerCase === "float" || typeLowerCase === "number") {
7
+ return "DOUBLE";
8
+ }
9
+ else if (typeLowerCase === "string") {
10
+ return "VARCHAR";
11
+ }
12
+ else if (typeLowerCase === "datetime") {
13
+ return "TIMESTAMP";
14
+ }
15
+ else if (typeLowerCase === "datetimetz") {
16
+ return "TIMESTAMP WITH TIME ZONE";
17
+ }
18
+ else if ([
19
+ "date",
20
+ "time",
21
+ "bigint",
22
+ "hugeint",
23
+ "double",
24
+ "varchar",
25
+ "timestamp",
26
+ "timestamp with time zone",
27
+ "boolean",
28
+ "geometry",
29
+ ].includes(typeLowerCase)) {
30
+ return type.toUpperCase();
31
+ }
32
+ else {
33
+ throw new Error(`Unknown type ${type}`);
34
+ }
35
+ }
@@ -0,0 +1,2 @@
1
+ export default function parseValue(value: unknown): string | boolean | number;
2
+ //# sourceMappingURL=parseValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseValue.d.ts","sourceRoot":"","sources":["../../src/helpers/parseValue.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAc5E"}
@@ -0,0 +1,20 @@
1
+ export default function parseValue(value) {
2
+ if (Number.isNaN(value) || value === undefined || value === null) {
3
+ return "NULL";
4
+ }
5
+ else if (value instanceof Date) {
6
+ return `'${value.toISOString()}'`;
7
+ }
8
+ else if (typeof value === "string") {
9
+ return `'${value.replaceAll("'", "''")}'`;
10
+ }
11
+ else if (typeof value === "boolean") {
12
+ return value;
13
+ }
14
+ else if (typeof value === "number") {
15
+ return value;
16
+ }
17
+ else {
18
+ throw new Error(`Unkown type ${typeof value} of ${value}`);
19
+ }
20
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Formats a duration into a human-readable string, breaking it down into years, months, days, hours, minutes, seconds, and milliseconds. This function is useful for displaying elapsed time in a user-friendly format, such as for performance logging, task completion times, or general time tracking.
3
+ *
4
+ * The function can calculate the duration from a given start time to the current time, or between a specified start and end time. It provides options for logging the output directly to the console and adding custom prefixes or suffixes to the formatted string. Note that for simplicity, months are approximated as 30 days and years as 365 days.
5
+ *
6
+ * @param start - The starting point of the duration. This can be a `Date` object or a Unix timestamp (number of milliseconds since epoch).
7
+ * @param options - Optional settings to customize the duration formatting and output.
8
+ * @param options.log - If `true`, the formatted duration string will be logged to the console. Defaults to `false`.
9
+ * @param options.end - The ending point of the duration. This can be a `Date` object or a Unix timestamp. If omitted, the current time (`Date.now()`) will be used as the end point.
10
+ * @param options.prefix - A string to prepend to the formatted duration string (e.g., "Elapsed time: ").
11
+ * @param options.suffix - A string to append to the formatted duration string (e.g., " (Task completed)").
12
+ * @returns A human-readable string representing the duration.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * // A starting Date somewhere in your code.
17
+ * const startDate = new Date(); // or Date.now()
18
+ *
19
+ * // When you want to know the elapsed duration, pass the start date.
20
+ * const duration = prettyDuration(startDate);
21
+ * console.log(duration); // Returns something like "22 days, 6 h, 3 min, 15 sec, 3 ms"
22
+ * ```
23
+ * @example
24
+ * ```ts
25
+ * // If you want to console.log it directly, set the `log` option to `true`.
26
+ * // This will print the duration to the console and also return the string.
27
+ * const startDateForLog = new Date();
28
+ * // ... some operations ...
29
+ * prettyDuration(startDateForLog, { log: true });
30
+ * ```
31
+ * @example
32
+ * ```ts
33
+ * // You can also use a prefix and/or suffix for the output string.
34
+ * const startDateWithPrefixSuffix = new Date();
35
+ * // ... some operations ...
36
+ * prettyDuration(startDateWithPrefixSuffix, { log: true, prefix: "Elapsed time: ", suffix: " (Main function)" });
37
+ * // Returns and logs something like "Total duration: 3 min, 15 sec, 3 ms (Main function)"
38
+ * ```
39
+ * @example
40
+ * ```ts
41
+ * // If you want to format the duration between two specific dates, use the `end` option.
42
+ * const start = new Date("2024-01-01T17:00:00Z");
43
+ * const end = new Date("2024-01-23T23:03:15Z");
44
+ * const specificDuration = prettyDuration(start, { end });
45
+ * console.log(specificDuration); // Returns "22 days, 6 h, 3 min, 15 sec, 0 ms"
46
+ * ```
47
+ * @category Formatting
48
+ */
49
+ export default function prettyDuration(start: Date | number, options?: {
50
+ log?: boolean;
51
+ end?: Date | number;
52
+ prefix?: string;
53
+ suffix?: string;
54
+ }): string;
55
+ //# sourceMappingURL=prettyDuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prettyDuration.d.ts","sourceRoot":"","sources":["../../src/helpers/prettyDuration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,KAAK,EAAE,IAAI,GAAG,MAAM,EACpB,OAAO,GAAE;IACP,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACZ,GACL,MAAM,CAuGR"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Formats a duration into a human-readable string, breaking it down into years, months, days, hours, minutes, seconds, and milliseconds. This function is useful for displaying elapsed time in a user-friendly format, such as for performance logging, task completion times, or general time tracking.
3
+ *
4
+ * The function can calculate the duration from a given start time to the current time, or between a specified start and end time. It provides options for logging the output directly to the console and adding custom prefixes or suffixes to the formatted string. Note that for simplicity, months are approximated as 30 days and years as 365 days.
5
+ *
6
+ * @param start - The starting point of the duration. This can be a `Date` object or a Unix timestamp (number of milliseconds since epoch).
7
+ * @param options - Optional settings to customize the duration formatting and output.
8
+ * @param options.log - If `true`, the formatted duration string will be logged to the console. Defaults to `false`.
9
+ * @param options.end - The ending point of the duration. This can be a `Date` object or a Unix timestamp. If omitted, the current time (`Date.now()`) will be used as the end point.
10
+ * @param options.prefix - A string to prepend to the formatted duration string (e.g., "Elapsed time: ").
11
+ * @param options.suffix - A string to append to the formatted duration string (e.g., " (Task completed)").
12
+ * @returns A human-readable string representing the duration.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * // A starting Date somewhere in your code.
17
+ * const startDate = new Date(); // or Date.now()
18
+ *
19
+ * // When you want to know the elapsed duration, pass the start date.
20
+ * const duration = prettyDuration(startDate);
21
+ * console.log(duration); // Returns something like "22 days, 6 h, 3 min, 15 sec, 3 ms"
22
+ * ```
23
+ * @example
24
+ * ```ts
25
+ * // If you want to console.log it directly, set the `log` option to `true`.
26
+ * // This will print the duration to the console and also return the string.
27
+ * const startDateForLog = new Date();
28
+ * // ... some operations ...
29
+ * prettyDuration(startDateForLog, { log: true });
30
+ * ```
31
+ * @example
32
+ * ```ts
33
+ * // You can also use a prefix and/or suffix for the output string.
34
+ * const startDateWithPrefixSuffix = new Date();
35
+ * // ... some operations ...
36
+ * prettyDuration(startDateWithPrefixSuffix, { log: true, prefix: "Elapsed time: ", suffix: " (Main function)" });
37
+ * // Returns and logs something like "Total duration: 3 min, 15 sec, 3 ms (Main function)"
38
+ * ```
39
+ * @example
40
+ * ```ts
41
+ * // If you want to format the duration between two specific dates, use the `end` option.
42
+ * const start = new Date("2024-01-01T17:00:00Z");
43
+ * const end = new Date("2024-01-23T23:03:15Z");
44
+ * const specificDuration = prettyDuration(start, { end });
45
+ * console.log(specificDuration); // Returns "22 days, 6 h, 3 min, 15 sec, 0 ms"
46
+ * ```
47
+ * @category Formatting
48
+ */
49
+ export default function prettyDuration(start, options = {}) {
50
+ if (start instanceof Date) {
51
+ start = start.getTime();
52
+ }
53
+ let end;
54
+ if (options.end instanceof Date) {
55
+ end = options.end.getTime();
56
+ }
57
+ else if (typeof options.end === "number") {
58
+ end = options.end;
59
+ }
60
+ else {
61
+ end = Date.now();
62
+ }
63
+ const differenceInMs = end - start;
64
+ let prettyDuration = "";
65
+ if (differenceInMs < 1000) {
66
+ // Less than a second
67
+ prettyDuration = `${differenceInMs} ms`;
68
+ }
69
+ else if (differenceInMs < 60_000) {
70
+ // Less than a minute
71
+ const sec = Math.floor(differenceInMs / 1000);
72
+ const ms = differenceInMs % 1000;
73
+ prettyDuration = `${sec} sec, ${ms} ms`;
74
+ }
75
+ else if (differenceInMs < 3_600_000) {
76
+ // Less than an hour
77
+ const min = Math.floor(differenceInMs / 60_000);
78
+ const remainingMs = differenceInMs % 60_000;
79
+ const sec = Math.floor(remainingMs / 1000);
80
+ const ms = remainingMs % 1000;
81
+ prettyDuration = `${min} min, ${sec} sec, ${ms} ms`;
82
+ }
83
+ else if (differenceInMs < 86_400_000) {
84
+ // Less than a day
85
+ const hours = Math.floor(differenceInMs / 3_600_000);
86
+ const remainingMsAfterHours = differenceInMs % 3_600_000;
87
+ const min = Math.floor(remainingMsAfterHours / 60_000);
88
+ const remainingMsAfterMinutes = remainingMsAfterHours % 60_000;
89
+ const sec = Math.floor(remainingMsAfterMinutes / 1000);
90
+ const ms = remainingMsAfterMinutes % 1000;
91
+ prettyDuration = `${hours} h, ${min} min, ${sec} sec, ${ms} ms`;
92
+ }
93
+ else if (differenceInMs < 2_592_000_000) {
94
+ // Less than a month
95
+ const days = Math.floor(differenceInMs / 86_400_000);
96
+ const remainingMsAfterDays = differenceInMs % 86_400_000;
97
+ const hours = Math.floor(remainingMsAfterDays / 3_600_000);
98
+ const remainingMsAfterHours = remainingMsAfterDays % 3_600_000;
99
+ const min = Math.floor(remainingMsAfterHours / 60_000);
100
+ const remainingMsAfterMin = remainingMsAfterHours % 60_000;
101
+ const sec = Math.floor(remainingMsAfterMin / 1000);
102
+ const ms = remainingMsAfterMin % 1000;
103
+ prettyDuration = `${days} ${days <= 1 ? "day" : "days"}, ${hours} h, ${min} min, ${sec} sec, ${ms} ms`;
104
+ }
105
+ else if (differenceInMs < 31_536_000_000) {
106
+ // Less than a year
107
+ const months = Math.floor(differenceInMs / 2_592_000_000);
108
+ const remainingMsAfterMonths = differenceInMs % 2_592_000_000;
109
+ const days = Math.floor(remainingMsAfterMonths / 86_400_000);
110
+ const remainingMsAfterDays = differenceInMs % 86_400_000;
111
+ const hours = Math.floor(remainingMsAfterDays / 3_600_000);
112
+ const remainingMsAfterHours = remainingMsAfterDays % 3_600_000;
113
+ const min = Math.floor(remainingMsAfterHours / 60_000);
114
+ const remainingMsAfterMin = remainingMsAfterHours % 60_000;
115
+ const sec = Math.floor(remainingMsAfterMin / 1000);
116
+ const ms = remainingMsAfterMin % 1000;
117
+ prettyDuration = `${months} ${months <= 1 ? "month" : "months"}, ${days} ${days <= 1 ? "day" : "days"}, ${hours} h, ${min} min, ${sec} sec, ${ms} ms`;
118
+ }
119
+ else {
120
+ // More than a year
121
+ const years = Math.floor(differenceInMs / 31_536_000_000);
122
+ const remainingMsAfterYears = differenceInMs % 31_536_000_000;
123
+ const months = Math.floor(remainingMsAfterYears / 2_592_000_000);
124
+ const remainingMsAfterMonths = differenceInMs % 2_592_000_000;
125
+ const days = Math.floor(remainingMsAfterMonths / 86_400_000);
126
+ const remainingMsAfterDays = differenceInMs % 86_400_000;
127
+ const hours = Math.floor(remainingMsAfterDays / 3_600_000);
128
+ const remainingMsAfterHours = remainingMsAfterDays % 3_600_000;
129
+ const min = Math.floor(remainingMsAfterHours / 60_000);
130
+ const remainingMsAfterMin = remainingMsAfterHours % 60_000;
131
+ const sec = Math.floor(remainingMsAfterMin / 1000);
132
+ const ms = remainingMsAfterMin % 1000;
133
+ prettyDuration = `${years} ${years <= 1 ? "year" : "years"}, ${months} ${months <= 1 ? "month" : "months"}, ${days} ${days <= 1 ? "day" : "days"}, ${hours} h, ${min} min, ${sec} sec, ${ms} ms`;
134
+ }
135
+ if (typeof options.prefix === "string") {
136
+ prettyDuration = `${options.prefix}${prettyDuration}`;
137
+ }
138
+ if (typeof options.suffix === "string") {
139
+ prettyDuration = `${prettyDuration}${options.suffix}`;
140
+ }
141
+ if (options.log === true) {
142
+ console.log(prettyDuration);
143
+ }
144
+ return prettyDuration;
145
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Prints a formatted table to the console with support for word wrapping
3
+ * within cells. Unlike `console.table()`, this function properly handles
4
+ * multi-line content within cells, making it ideal for displaying data with
5
+ * long text values.
6
+ *
7
+ * @param data - An array of objects representing the rows of the table. Each
8
+ * object should have string keys.
9
+ * @param options - Optional configuration for table rendering.
10
+ * @param options.maxColumnWidth - The maximum width for any column (default:
11
+ * `75`). Values exceeding this width will be wrapped at word boundaries.
12
+ * @param options.minColumnWidth - The minimum width for any column (default:
13
+ * `3`).
14
+ * @param options.typesRowIndex - The index of a row that contains type
15
+ * annotations (e.g. `"VARCHAR/string"`). This row will be rendered in grey.
16
+ * If omitted, no row is treated as a types row.
17
+ * @returns void - The table is printed directly to the console.
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const data = [
22
+ * { name: "Alice", description: "A software engineer with expertise in TypeScript" },
23
+ * { name: "Bob", description: "A product manager" }
24
+ * ];
25
+ * printTable(data, { maxColumnWidth: 30 });
26
+ * // Outputs a nicely formatted table with word-wrapped description column
27
+ * ```
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * // With types row
32
+ * const types = { name: "VARCHAR/string", age: "INTEGER/number" };
33
+ * const data = [
34
+ * { name: "Alice", age: 30 },
35
+ * { name: "Bob", age: 25 }
36
+ * ];
37
+ * printTable([types, ...data], { typesRowIndex: 0 });
38
+ * ```
39
+ */
40
+ export default function printTable(data: {
41
+ [key: string]: unknown;
42
+ }[], options?: {
43
+ maxColumnWidth?: number;
44
+ minColumnWidth?: number;
45
+ typesRowIndex?: number;
46
+ }): void;
47
+ //# sourceMappingURL=printTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"printTable.d.ts","sourceRoot":"","sources":["../../src/helpers/printTable.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,IAAI,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAAE,EAClC,OAAO,CAAC,EAAE;IACR,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GACA,IAAI,CAuNN"}
@@ -0,0 +1,217 @@
1
+ import wrapString from "./wrapString.js";
2
+ /**
3
+ * Prints a formatted table to the console with support for word wrapping
4
+ * within cells. Unlike `console.table()`, this function properly handles
5
+ * multi-line content within cells, making it ideal for displaying data with
6
+ * long text values.
7
+ *
8
+ * @param data - An array of objects representing the rows of the table. Each
9
+ * object should have string keys.
10
+ * @param options - Optional configuration for table rendering.
11
+ * @param options.maxColumnWidth - The maximum width for any column (default:
12
+ * `75`). Values exceeding this width will be wrapped at word boundaries.
13
+ * @param options.minColumnWidth - The minimum width for any column (default:
14
+ * `3`).
15
+ * @param options.typesRowIndex - The index of a row that contains type
16
+ * annotations (e.g. `"VARCHAR/string"`). This row will be rendered in grey.
17
+ * If omitted, no row is treated as a types row.
18
+ * @returns void - The table is printed directly to the console.
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * const data = [
23
+ * { name: "Alice", description: "A software engineer with expertise in TypeScript" },
24
+ * { name: "Bob", description: "A product manager" }
25
+ * ];
26
+ * printTable(data, { maxColumnWidth: 30 });
27
+ * // Outputs a nicely formatted table with word-wrapped description column
28
+ * ```
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * // With types row
33
+ * const types = { name: "VARCHAR/string", age: "INTEGER/number" };
34
+ * const data = [
35
+ * { name: "Alice", age: 30 },
36
+ * { name: "Bob", age: 25 }
37
+ * ];
38
+ * printTable([types, ...data], { typesRowIndex: 0 });
39
+ * ```
40
+ */
41
+ export default function printTable(data, options) {
42
+ if (!data || data.length === 0) {
43
+ console.log("(empty table)");
44
+ return;
45
+ }
46
+ const maxColumnWidth = options?.maxColumnWidth ?? 75;
47
+ const minColumnWidth = options?.minColumnWidth ?? 3;
48
+ // Helper function to format values for display
49
+ const formatValue = (value) => {
50
+ if (value instanceof Date) {
51
+ return value.toISOString();
52
+ }
53
+ return String(value);
54
+ };
55
+ // Get all column names
56
+ const columns = Object.keys(data[0]);
57
+ if (columns.length === 0) {
58
+ console.log("(empty table)");
59
+ return;
60
+ }
61
+ // Single pass: calculate column widths and prepare wrapped data.
62
+ // First, seed widths from header names.
63
+ const columnWidths = {};
64
+ for (const col of columns) {
65
+ columnWidths[col] = col.length;
66
+ }
67
+ // Format every cell, track the longest raw line per column, and
68
+ // store the formatted strings for the wrapping step that follows.
69
+ const formattedData = [];
70
+ for (const row of data) {
71
+ const formattedRow = [];
72
+ for (let c = 0; c < columns.length; c++) {
73
+ const col = columns[c];
74
+ const value = formatValue(row[col]);
75
+ formattedRow.push(value);
76
+ // Track longest line (handles embedded newlines)
77
+ const lines = value.split("\n");
78
+ let longestLine = 0;
79
+ for (const line of lines) {
80
+ if (line.length > longestLine)
81
+ longestLine = line.length;
82
+ }
83
+ if (longestLine > columnWidths[col]) {
84
+ columnWidths[col] = longestLine;
85
+ }
86
+ }
87
+ formattedData.push(formattedRow);
88
+ }
89
+ // Apply min/max constraints
90
+ for (const col of columns) {
91
+ columnWidths[col] = Math.min(Math.max(columnWidths[col], minColumnWidth), maxColumnWidth);
92
+ }
93
+ // Wrap pre-formatted strings into multi-line cells
94
+ const wrappedData = [];
95
+ for (let r = 0; r < formattedData.length; r++) {
96
+ const wrappedRow = {};
97
+ for (let c = 0; c < columns.length; c++) {
98
+ const col = columns[c];
99
+ const value = formattedData[r][c];
100
+ const width = columnWidths[col];
101
+ // Split by existing newlines, then wrap each part
102
+ const lines = value.split("\n");
103
+ const allWrappedLines = [];
104
+ for (const line of lines) {
105
+ if (line.length <= width) {
106
+ allWrappedLines.push(line);
107
+ }
108
+ else {
109
+ // Wrap long lines at word boundaries
110
+ const wrapped = wrapString(line, width);
111
+ allWrappedLines.push(...wrapped.split("\n"));
112
+ }
113
+ }
114
+ wrappedRow[col] = allWrappedLines.length > 0 ? allWrappedLines : [""];
115
+ }
116
+ wrappedData.push(wrappedRow);
117
+ }
118
+ // ANSI color codes (matching Deno's console colors)
119
+ const colors = {
120
+ reset: "\x1b[0m",
121
+ bold: "\x1b[1m",
122
+ grey: "\x1b[90m",
123
+ string: "\x1b[32m", // green
124
+ number: "\x1b[33m", // yellow
125
+ boolean: "\x1b[95m", // bright magenta/pink
126
+ date: "\x1b[36m", // cyan
127
+ null: "\x1b[90m", // grey
128
+ };
129
+ // Helper function to get color for a value based on its actual JavaScript type
130
+ const getColorForValue = (value, isTypeRow) => {
131
+ if (isTypeRow)
132
+ return colors.grey;
133
+ if (value === null || value === undefined)
134
+ return colors.null;
135
+ if (value instanceof Date)
136
+ return colors.date;
137
+ if (typeof value === "boolean")
138
+ return colors.boolean;
139
+ if (typeof value === "number")
140
+ return colors.number;
141
+ return colors.string;
142
+ };
143
+ // Helper function to create a horizontal border line with column junctions
144
+ const createBorderLine = (left, middle, right) => {
145
+ const segments = columns.map((col) => "─".repeat(columnWidths[col] + 2));
146
+ return colors.grey + left + segments.join(middle) + right + colors.reset;
147
+ };
148
+ // Helper function to create a separator line
149
+ const createSeparator = () => createBorderLine("├", "┼", "┤");
150
+ // Helper function to create the top border
151
+ const createTopBorder = () => createBorderLine("┌", "┬", "┐");
152
+ // Helper function to create the bottom border
153
+ const createBottomBorder = () => createBorderLine("└", "┴", "┘");
154
+ // Helper function to pad a string to a specific width
155
+ const pad = (str, width) => {
156
+ return str + " ".repeat(Math.max(0, width - str.length));
157
+ };
158
+ // Print top border
159
+ console.log(createTopBorder());
160
+ // Print header row (bold)
161
+ const headerParts = columns.map((col) => ` ${colors.bold}${pad(col, columnWidths[col])}${colors.reset} `);
162
+ console.log(colors.grey + "│" + colors.reset +
163
+ headerParts.join(colors.grey + "│" + colors.reset) + colors.grey + "│" +
164
+ colors.reset);
165
+ // Detect if any row has word wrapping (spans multiple lines)
166
+ let hasWordWrapping = false;
167
+ for (const wrappedRow of wrappedData) {
168
+ for (const col of columns) {
169
+ if (wrappedRow[col].length > 1) {
170
+ hasWordWrapping = true;
171
+ break;
172
+ }
173
+ }
174
+ if (hasWordWrapping)
175
+ break;
176
+ }
177
+ // Print separator after header (unless the first row is the types row,
178
+ // in which case the separator is printed after the types row instead)
179
+ if (options?.typesRowIndex !== 0) {
180
+ console.log(createSeparator());
181
+ }
182
+ // Print data rows
183
+ for (let i = 0; i < wrappedData.length; i++) {
184
+ const wrappedRow = wrappedData[i];
185
+ const originalRow = data[i];
186
+ const isTypeRow = i === options?.typesRowIndex;
187
+ // Find the maximum number of lines in this row
188
+ let maxLines = 1;
189
+ for (const col of columns) {
190
+ if (wrappedRow[col].length > maxLines) {
191
+ maxLines = wrappedRow[col].length;
192
+ }
193
+ }
194
+ // Print each line of this row
195
+ for (let lineIdx = 0; lineIdx < maxLines; lineIdx++) {
196
+ const lineParts = columns.map((col) => {
197
+ const lines = wrappedRow[col];
198
+ const lineValue = lineIdx < lines.length ? lines[lineIdx] : "";
199
+ const color = getColorForValue(originalRow[col], isTypeRow);
200
+ return ` ${color}${pad(lineValue, columnWidths[col])}${colors.reset} `;
201
+ });
202
+ console.log(colors.grey + "│" + colors.reset +
203
+ lineParts.join(colors.grey + "│" + colors.reset) + colors.grey +
204
+ "│" +
205
+ colors.reset);
206
+ }
207
+ // Print separator after types row
208
+ if (isTypeRow) {
209
+ console.log(createSeparator());
210
+ } // Print separator between rows when word wrapping is present (except after last row)
211
+ else if (hasWordWrapping && i < wrappedData.length - 1) {
212
+ console.log(createSeparator());
213
+ }
214
+ }
215
+ // Print bottom border
216
+ console.log(createBottomBorder());
217
+ }
@@ -0,0 +1,19 @@
1
+ import SimpleTable from "../class/SimpleTable.js";
2
+ import SimpleDB from "../class/SimpleDB.js";
3
+ export default function queryDB(simple: SimpleTable | SimpleDB, query: string, options: {
4
+ table: string | null;
5
+ method: string | null;
6
+ parameters: {
7
+ [key: string]: unknown;
8
+ } | null;
9
+ nbRowsToLog: number;
10
+ nbCharactersToLog: number | undefined;
11
+ returnDataFrom: "query" | "none";
12
+ debug: boolean;
13
+ types?: {
14
+ [key: string]: string;
15
+ };
16
+ }): Promise<{
17
+ [key: string]: string | number | boolean | Date | null;
18
+ }[] | null>;
19
+ //# sourceMappingURL=queryDB.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryDB.d.ts","sourceRoot":"","sources":["../../src/helpers/queryDB.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAG5C,wBAA8B,OAAO,CACnC,MAAM,EAAE,WAAW,GAAG,QAAQ,EAC9B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;IACP,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,cAAc,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACnC,GACA,OAAO,CACN;IACA,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;CACxD,EAAE,GACD,IAAI,CACP,CA+DA"}