@gscdump/engine 3.5.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/README.md +28 -18
  2. package/dist/THIRD-PARTY-LICENSES.md +2 -2
  3. package/dist/adapters/duckdb-node.d.mts +4 -4
  4. package/dist/adapters/duckdb-node.mjs +103 -77
  5. package/dist/adapters/filesystem.d.mts +6 -7
  6. package/dist/adapters/filesystem.mjs +11 -6
  7. package/dist/adapters/hyparquet.d.mts +9 -10
  8. package/dist/adapters/hyparquet.mjs +84 -44
  9. package/dist/adapters/node-harness.d.mts +3 -4
  10. package/dist/adapters/parquet-attach.d.mts +4 -5
  11. package/dist/adapters/parquet-attach.mjs +7 -2
  12. package/dist/adapters/r2-manifest.d.mts +4 -5
  13. package/dist/adapters/r2.d.mts +2 -3
  14. package/dist/adapters/snapshot-attach.d.mts +7 -8
  15. package/dist/adapters/snapshot-attach.mjs +7 -2
  16. package/dist/analysis-range.d.mts +2 -3
  17. package/dist/analysis-types.d.mts +4 -5
  18. package/dist/analyzer/define.d.mts +6 -7
  19. package/dist/analyzer/dispatch.d.mts +2 -3
  20. package/dist/analyzer/registry.d.mts +4 -5
  21. package/dist/analyzer/types.d.mts +11 -12
  22. package/dist/arrow-utils.d.mts +4 -5
  23. package/dist/arrow-utils.mjs +10 -0
  24. package/dist/coerce.d.mts +1 -2
  25. package/dist/compaction.d.mts +2 -3
  26. package/dist/drizzle-schema.d.mts +14 -15
  27. package/dist/duckdb.d.mts +5 -6
  28. package/dist/duckdb.mjs +9 -5
  29. package/dist/engine.d.mts +1 -2
  30. package/dist/entities/empty-types.d.mts +4 -5
  31. package/dist/entities/indexing-metadata.d.mts +5 -6
  32. package/dist/entities/inspection.d.mts +9 -10
  33. package/dist/entities/query-dim.d.mts +7 -7
  34. package/dist/entities/sitemap-shared.d.mts +26 -27
  35. package/dist/entities/sitemap-write.d.mts +1 -2
  36. package/dist/entities/sitemap.d.mts +1 -2
  37. package/dist/entity-keys.d.mts +28 -29
  38. package/dist/errors.d.mts +5 -6
  39. package/dist/iceberg/append-sink.d.mts +2 -3
  40. package/dist/iceberg/catalog.d.mts +10 -10
  41. package/dist/iceberg/catalog.mjs +2 -2
  42. package/dist/iceberg/overwrite-writer.d.mts +17 -18
  43. package/dist/iceberg/schema.d.mts +16 -16
  44. package/dist/ingest-accumulator.d.mts +8 -9
  45. package/dist/ingest.d.mts +15 -12
  46. package/dist/ingest.mjs +22 -6
  47. package/dist/layout.d.mts +4 -5
  48. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/src/datapage.mjs +1 -1
  49. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/src/indexes.mjs +1 -1
  50. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/src/metadata.mjs +1 -1
  51. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/src/types.d.mts +2 -3
  52. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/types/index.d.mts +2 -3
  53. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/assemble.mjs +3 -144
  54. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/bloom.mjs +3 -58
  55. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/column.mjs +8 -129
  56. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/convert.mjs +3 -118
  57. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/datapage.mjs +6 -144
  58. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/delta.mjs +2 -65
  59. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/encoding.mjs +2 -76
  60. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/filter.mjs +4 -212
  61. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/geoparquet.mjs +1 -24
  62. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/index.mjs +3 -3
  63. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/indexes.mjs +5 -32
  64. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/metadata.mjs +7 -241
  65. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/node.mjs +1 -5
  66. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/plain.mjs +1 -79
  67. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/plan.mjs +6 -375
  68. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/read.mjs +6 -77
  69. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/rowgroup.mjs +7 -175
  70. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/scan.mjs +5 -73
  71. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/schema.mjs +1 -22
  72. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/snappy.mjs +1 -68
  73. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/thrift.mjs +1 -86
  74. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/types.d.mts +2 -28
  75. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/utils.mjs +1 -31
  76. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/variant.mjs +3 -228
  77. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/wkb.mjs +1 -94
  78. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/types/index.d.mts +2 -52
  79. package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/types/node.d.mts +2 -2
  80. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/assemble.mjs +144 -0
  81. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/bloom.mjs +124 -0
  82. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/column.mjs +129 -0
  83. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/constants.mjs +80 -0
  84. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/convert.mjs +118 -0
  85. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/datapage.mjs +144 -0
  86. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/delta.mjs +65 -0
  87. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/encoding.mjs +76 -0
  88. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/filter.mjs +212 -0
  89. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/geoparquet.mjs +24 -0
  90. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/index.mjs +8 -0
  91. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/indexes.mjs +32 -0
  92. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/metadata.mjs +241 -0
  93. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/node.mjs +7 -0
  94. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/plain.mjs +79 -0
  95. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/plan.mjs +375 -0
  96. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/query.mjs +3 -0
  97. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/read.mjs +81 -0
  98. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/rowgroup.mjs +175 -0
  99. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/scan.mjs +74 -0
  100. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/schema.mjs +75 -0
  101. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/snappy.mjs +68 -0
  102. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/thrift.mjs +86 -0
  103. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/types.d.mts +25 -0
  104. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/utils.mjs +32 -0
  105. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/variant.mjs +228 -0
  106. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/wkb.mjs +94 -0
  107. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/xxhash.mjs +68 -0
  108. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/types/index.d.mts +58 -0
  109. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/types/node.d.mts +3 -0
  110. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/types/scan.d.mts +1 -0
  111. package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/types/utils.d.mts +1 -0
  112. package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/index.mjs +1 -1
  113. package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/read.mjs +1 -1
  114. package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/sql/icebergDataSource.mjs +1 -1
  115. package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/sql/icebergQuery.mjs +1 -1
  116. package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/types.d.mts +17 -18
  117. package/dist/node_modules/.pnpm/icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/create.d.mts +1 -0
  118. package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/types/index.d.mts +1 -1
  119. package/dist/node_modules/.pnpm/icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/manifest.d.mts +1 -0
  120. package/dist/node_modules/.pnpm/icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/metadata.d.mts +1 -0
  121. package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/types/read.d.mts +1 -1
  122. package/dist/node_modules/.pnpm/icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/s3.d.mts +1 -0
  123. package/dist/node_modules/.pnpm/icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/sql/icebergDataSource.d.mts +2 -0
  124. package/dist/node_modules/.pnpm/icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/sql/icebergQuery.d.mts +2 -0
  125. package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/types/write/write.d.mts +2 -3
  126. package/dist/node_modules/.pnpm/squirreling@0.16.4/node_modules/squirreling/src/ast.d.mts +1 -0
  127. package/dist/parquet-plan.d.mts +5 -6
  128. package/dist/period/index.d.mts +8 -8
  129. package/dist/profile.d.mts +3 -3
  130. package/dist/report/define.d.mts +1 -2
  131. package/dist/report/hash.d.mts +3 -4
  132. package/dist/report/registry.d.mts +3 -4
  133. package/dist/report/types.d.mts +22 -23
  134. package/dist/resolver/adapter.d.mts +2 -3
  135. package/dist/resolver/canonical-source.d.mts +1 -2
  136. package/dist/resolver/compile.d.mts +12 -8
  137. package/dist/resolver/compile.mjs +7 -3
  138. package/dist/resolver/datasets.d.mts +9 -9
  139. package/dist/resolver/extras-overlay.d.mts +2 -3
  140. package/dist/resolver/filter-utils.d.mts +7 -7
  141. package/dist/resolver/fragments.d.mts +3 -4
  142. package/dist/resolver/pg-adapter.d.mts +7 -8
  143. package/dist/resolver/run-query.d.mts +16 -17
  144. package/dist/resolver/run-query.mjs +16 -15
  145. package/dist/resolver/schema-drift.d.mts +2 -3
  146. package/dist/resolver/types.d.mts +8 -9
  147. package/dist/rollups/canonical.d.mts +4 -5
  148. package/dist/rollups/core.d.mts +12 -13
  149. package/dist/rollups/defaults.d.mts +2 -3
  150. package/dist/rollups/hourly.d.mts +3 -4
  151. package/dist/rollups/indexing.d.mts +5 -6
  152. package/dist/rollups/traffic.d.mts +5 -6
  153. package/dist/rollups/windows.d.mts +7 -8
  154. package/dist/schedule.d.mts +6 -7
  155. package/dist/schema.d.mts +9 -9
  156. package/dist/scope.d.mts +6 -7
  157. package/dist/sink.d.mts +9 -10
  158. package/dist/sinks/in-memory-sink.d.mts +3 -4
  159. package/dist/snapshot.d.mts +2 -3
  160. package/dist/source/attached-table.d.mts +4 -5
  161. package/dist/source/create-sql-query-source.d.mts +2 -3
  162. package/dist/source/index.d.mts +6 -6
  163. package/dist/source/source-types.d.mts +7 -8
  164. package/dist/sql-bind.d.mts +3 -4
  165. package/dist/sql-fragments.d.mts +5 -6
  166. package/dist/storage.d.mts +37 -37
  167. package/dist/sync-config.d.mts +20 -21
  168. package/dist/vendor/hysnappy-purejs.d.mts +2 -3
  169. package/dist/vendor/hysnappy-purejs.mjs +1 -1
  170. package/package.json +12 -10
  171. package/dist/node_modules/.pnpm/icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/sql/icebergDataSource.d.mts +0 -2
  172. package/dist/node_modules/.pnpm/icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/sql/icebergQuery.d.mts +0 -2
  173. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/create.d.mts → hyparquet@1.30.0/node_modules/hyparquet/types/indexes.d.mts} +0 -0
  174. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird → hyparquet@1.30.0/node_modules/hyparquet}/types/metadata.d.mts +0 -0
  175. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/manifest.d.mts → hyparquet@1.30.0/node_modules/hyparquet/types/query.d.mts} +0 -0
  176. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/s3.d.mts → hyparquet@1.30.0/node_modules/hyparquet/types/read.d.mts} +0 -0
  177. /package/dist/node_modules/.pnpm/{squirreling@0.16.3/node_modules/squirreling/src/ast.d.mts → hyparquet@1.30.0/node_modules/hyparquet/types/snappy.d.mts} +0 -0
  178. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/avro/avro.metadata.mjs +0 -0
  179. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/avro/avro.read.mjs +0 -0
  180. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/avro/avro.write.mjs +0 -0
  181. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/catalog/file.mjs +0 -0
  182. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/catalog/loadTable.mjs +0 -0
  183. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/catalog/rest.mjs +0 -0
  184. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/create.mjs +0 -0
  185. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/delete.mjs +0 -0
  186. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/fetch.mjs +0 -0
  187. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/json.mjs +0 -0
  188. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/manifest.mjs +0 -0
  189. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/metadata.mjs +0 -0
  190. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/prune.mjs +0 -0
  191. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/puffin/deletion-vector.mjs +0 -0
  192. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/puffin/puffin.mjs +0 -0
  193. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/puffin/roaring.mjs +0 -0
  194. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/s3.mjs +0 -0
  195. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/schema.mjs +0 -0
  196. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/sigv4.mjs +0 -0
  197. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/sql/whereFilter.mjs +0 -0
  198. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/utils.mjs +0 -0
  199. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/commit.mjs +0 -0
  200. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/conversions.mjs +0 -0
  201. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/delete-file.mjs +0 -0
  202. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/geospatial.mjs +0 -0
  203. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/manifest-list.mjs +0 -0
  204. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/manifest.mjs +0 -0
  205. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/parquet.mjs +0 -0
  206. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/partition.mjs +0 -0
  207. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/rewrite.mjs +0 -0
  208. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/serde.mjs +0 -0
  209. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/snapshot.mjs +0 -0
  210. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/sort.mjs +0 -0
  211. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/stage-deletion-vector.mjs +0 -0
  212. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/stage-position-delete.mjs +0 -0
  213. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/stage.mjs +0 -0
  214. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/stats.mjs +0 -0
  215. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/transform.mjs +0 -0
  216. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/write.mjs +0 -0
  217. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/types/catalog/file.d.mts +0 -0
  218. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/types/catalog/rest.d.mts +0 -0
  219. /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/types/fetch.d.mts +0 -0
  220. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/backend/batch.mjs +0 -0
  221. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/backend/batchAdapters.mjs +0 -0
  222. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/backend/dataSource.mjs +0 -0
  223. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/accumulator.mjs +0 -0
  224. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/aggregates.mjs +0 -0
  225. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/batchResults.mjs +0 -0
  226. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/batches.mjs +0 -0
  227. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/execute.mjs +0 -0
  228. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/fold.mjs +0 -0
  229. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/join.mjs +0 -0
  230. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/rowScope.mjs +0 -0
  231. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/scanColumn.mjs +0 -0
  232. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/sort.mjs +0 -0
  233. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/streamingAggregate.mjs +0 -0
  234. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/utils.mjs +0 -0
  235. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/window.mjs +0 -0
  236. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/yield.mjs +0 -0
  237. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/alias.mjs +0 -0
  238. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/batch.mjs +0 -0
  239. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/binary.mjs +0 -0
  240. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/date.mjs +0 -0
  241. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/evaluate.mjs +0 -0
  242. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/math.mjs +0 -0
  243. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/regexp.mjs +0 -0
  244. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/scalar.mjs +0 -0
  245. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/strings.mjs +0 -0
  246. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/index.d.mts +0 -0
  247. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/index.mjs +0 -0
  248. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/expression.mjs +0 -0
  249. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/extractTables.mjs +0 -0
  250. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/functions.mjs +0 -0
  251. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/joins.mjs +0 -0
  252. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/parse.mjs +0 -0
  253. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/primary.mjs +0 -0
  254. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/state.mjs +0 -0
  255. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/tokenize.mjs +0 -0
  256. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/types.d.mts +0 -0
  257. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/plan/columns.mjs +0 -0
  258. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/plan/plan.mjs +0 -0
  259. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/plan/types.d.mts +0 -0
  260. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/bbox.mjs +0 -0
  261. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/equality.mjs +0 -0
  262. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/operations.mjs +0 -0
  263. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/pointRelations.mjs +0 -0
  264. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/primitives.mjs +0 -0
  265. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/segments.mjs +0 -0
  266. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/spatial.mjs +0 -0
  267. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/wkt.mjs +0 -0
  268. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/types.d.mts +0 -0
  269. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/validation/aggregates.mjs +0 -0
  270. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/validation/executionErrors.mjs +0 -0
  271. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/validation/functions.mjs +0 -0
  272. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/validation/keywords.mjs +0 -0
  273. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/validation/parseErrors.mjs +0 -0
  274. /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/validation/tables.mjs +0 -0
package/README.md CHANGED
@@ -4,9 +4,11 @@
4
4
  [![npm downloads](https://img.shields.io/npm/dm/@gscdump/engine?color=yellow)](https://npm.chart.dev/@gscdump/engine)
5
5
  [![license](https://img.shields.io/github/license/harlan-zw/gscdump?color=yellow)](https://github.com/harlan-zw/gscdump/blob/main/LICENSE)
6
6
 
7
- > Append-only Parquet/DuckDB storage engine + planner + adapters for the gscdump pipeline. Node + edge runtimes; opt-in heavy peers.
7
+ Store Search Console data in Parquet files and query it with DuckDB.
8
+ This package also provides Source contracts, SQL resolution, and runtime adapters.
8
9
 
9
- Owns the storage runtime, planner, schema, and adapters that were previously bundled into `gscdump`. Edge consumers stay on [`gscdump`](../gscdump); anything that needs to read/write Parquet, run the DuckDB executor, or attach a snapshot lives here.
10
+ Choose an export for your runtime.
11
+ Node filesystem and DuckDB helpers live on dedicated subpaths.
10
12
 
11
13
  ## Install
12
14
 
@@ -14,10 +16,9 @@ Owns the storage runtime, planner, schema, and adapters that were previously bun
14
16
  npm install @gscdump/engine
15
17
  ```
16
18
 
17
- Optional peers (install only what your runtime needs):
18
-
19
- - `@duckdb/duckdb-wasm` — DuckDB-WASM executor (browser + node-blocking shim).
20
- - `hyparquet`, `hyparquet-writer` — pure-JS Parquet codec for environments without a native build.
19
+ `@duckdb/node-api` is an optional peer for the Node runtime.
20
+ The CLI installs this peer. Browser consumers use `@gscdump/engine-duckdb-wasm`.
21
+ The package includes `hyparquet` and `hyparquet-writer` for JavaScript Parquet encoding and decoding.
21
22
 
22
23
  ## Subpath exports
23
24
 
@@ -31,39 +32,48 @@ Optional peers (install only what your runtime needs):
31
32
  | `@gscdump/engine/ingest-accumulator` | Stateful ingest flushing behind injected storage and recovery hooks. |
32
33
  | `@gscdump/engine/sql` | SQL literal binding helpers (`bindLiterals`, `formatLiteral`). |
33
34
  | `@gscdump/engine/sql-fragments` | Reusable SQL fragments shared across analyzers. |
34
- | `@gscdump/engine/rollups` | Pre-aggregated rollup contracts + helpers. |
35
+ | `@gscdump/engine/rollups` | Pre-aggregated rollup contracts and helpers. |
35
36
  | `@gscdump/engine/entities` | Parquet-backed entity stores and their record contracts. |
36
37
  | `@gscdump/engine/entity-keys` | Pure entity object-key and URL-hash helpers, with no Parquet runtime. |
37
38
  | `@gscdump/engine/resolver` | Dialect-neutral SQL composition: `ResolverAdapter`, `pgResolverAdapter`, `resolveToSQL`. |
38
39
  | `@gscdump/engine/scope` | Multi-tenant scope predicates. |
39
40
  | `@gscdump/engine/arrow` | Apache Arrow utilities for engine result conversion. |
40
41
  | `@gscdump/engine/node` | Node-only DuckDB handle. |
41
- | `@gscdump/engine/filesystem` | Node-only `DataSource` + `ManifestStore` adapters. |
42
+ | `@gscdump/engine/filesystem` | Node-only `DataSource` and `ManifestStore` adapters. |
42
43
  | `@gscdump/engine/hyparquet` | Pure-JS `ParquetCodec`. |
43
- | `@gscdump/engine/r2` | Cloudflare R2 `DataSource` (structurally typed against `R2Bucket`). |
44
+ | `@gscdump/engine/r2` | Cloudflare R2 `DataSource` and `createR2ManifestStore` (structurally typed against `R2Bucket`). |
44
45
  | `@gscdump/engine/iceberg` | Edge-safe GSC dataset schemas, catalog wrappers, and append sink. Generic Iceberg APIs live in `@gscdump/lakehouse`. |
45
46
  | `@gscdump/engine/sink-node` | Node-only Iceberg overwrite/delete recovery writer. |
46
- | `@gscdump/engine/source` | Query-source contracts and factories. |
47
+ | `@gscdump/engine/source` | Source contracts and factories. |
48
+ | `@gscdump/engine/analyzer` | Analyzer contracts, registry construction, and dispatch. |
49
+ | `@gscdump/engine/report` | Report definitions and contracts. |
50
+ | `@gscdump/engine/period` | Date windows and comparison ranges. |
51
+ | `@gscdump/engine/analysis-types` | Analysis parameters and results. |
52
+ | `@gscdump/engine/analysis-range` | Analysis date-range resolution. |
53
+ | `@gscdump/engine/errors` | Tagged Engine failures. |
54
+ | `@gscdump/engine/profile` | Query timing and profiling helpers. |
55
+ | `@gscdump/engine/sync-config` | Sync limits and table/search-type configuration. |
56
+ | `@gscdump/engine/vendor/hysnappy` | Worker-compatible compression alias. |
47
57
 
48
58
  ## Stability
49
59
 
50
60
  | Surface | Stability |
51
61
  |---|---|
52
62
  | `createStorageEngine` and storage contracts (`StorageEngine`, `Row`, `WriteCtx`, ...) | Public |
53
- | Adapters (`/node`, `/filesystem`, `/hyparquet`, `/r2`, `/r2-manifest`) | Public |
63
+ | Adapters (`/node`, `/filesystem`, `/hyparquet`, `/r2`) | Public |
54
64
  | Planner (`resolveToSQL`, `enumeratePartitions`) | Public |
55
65
  | Schema (`SCHEMAS`, `allTables`, ...) | Public |
56
- | Internals reached through `@gscdump/engine/<file>` paths not listed above | Private — may break between minors |
66
+ | Files outside the declared package exports | Private |
57
67
 
58
68
  ## Related
59
69
 
60
- - [`gscdump`](../gscdump) — REST client + query builder (edge-safe peer dep).
61
- - [`@gscdump/analysis`](../analysis) — analyzers; consumes storage through `AnalysisQuerySource` adapters.
62
- - [`@gscdump/engine-duckdb-wasm`](../engine-duckdb-wasm) — DuckDB-WASM browser adapter.
63
- - [`@gscdump/engine-sqlite`](../engine-sqlite) — SQLite / D1 adapter.
64
- - [`@gscdump/lakehouse`](../lakehouse) — dataset-agnostic Iceberg catalog and
70
+ - [`gscdump`](../gscdump) : REST client and query builder (edge-safe peer dep).
71
+ - [`@gscdump/analysis`](../analysis) : analyzers; consumes storage through `AnalysisQuerySource` adapters.
72
+ - [`@gscdump/engine-duckdb-wasm`](../engine-duckdb-wasm) : DuckDB-WASM browser adapter.
73
+ - [`@gscdump/engine-sqlite`](../engine-sqlite) : SQLite / D1 adapter.
74
+ - [`@gscdump/lakehouse`](../lakehouse) : dataset-agnostic Iceberg catalog and
65
75
  dataset registry APIs.
66
- - [`@gscdump/cli`](../cli) — CLI wrapping engine + analysis.
76
+ - [`@gscdump/cli`](../cli) : CLI wrapping engine and analysis.
67
77
 
68
78
  ## License
69
79
 
@@ -35,11 +35,11 @@ Repository: https://github.com/101arrowz/fzstd
35
35
 
36
36
  ---------------------------------------
37
37
 
38
- ## hyparquet, hyparquet-compressors, hyparquet-writer, icebird, squirreling
38
+ ## hyparquet, hyparquet, hyparquet-compressors, hyparquet-writer, icebird, squirreling
39
39
 
40
40
  License: MIT
41
41
  By: Hyperparam
42
- Repositories: https://github.com/hyparam/hyparquet, https://github.com/hyparam/hyparquet-compressors, https://github.com/hyparam/hyparquet-writer, https://github.com/hyparam/icebird, https://github.com/hyparam/squirreling
42
+ Repositories: https://github.com/hyparam/hyparquet, https://github.com/hyparam/hyparquet, https://github.com/hyparam/hyparquet-compressors, https://github.com/hyparam/hyparquet-writer, https://github.com/hyparam/icebird, https://github.com/hyparam/squirreling
43
43
 
44
44
  > The MIT License (MIT)
45
45
  >
@@ -1,7 +1,7 @@
1
1
  import { DuckDBHandle } from "../duckdb.mjs";
2
- interface NodeDuckDBOptions {
2
+ export interface NodeDuckDBOptions {
3
3
  verbose?: boolean;
4
4
  }
5
- declare function createNodeDuckDBHandle(opts?: NodeDuckDBOptions): DuckDBHandle;
6
- declare function resetNodeDuckDB(): void;
7
- export { NodeDuckDBOptions, createNodeDuckDBHandle, resetNodeDuckDB };
5
+ /** Node uses one native connection. Browser and Worker adapters own their WASM runtimes. */
6
+ export declare function createNodeDuckDBHandle(opts?: NodeDuckDBOptions): DuckDBHandle;
7
+ export declare function resetNodeDuckDB(): void;
@@ -1,98 +1,124 @@
1
- import { arrowToRows } from "../arrow-utils.mjs";
2
- import { createRequire } from "node:module";
3
1
  import process from "node:process";
4
- import { unlinkSync } from "node:fs";
2
+ import { randomUUID } from "node:crypto";
3
+ import { mkdtempSync, rmSync } from "node:fs";
4
+ import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
5
5
  import { tmpdir } from "node:os";
6
- import { join } from "node:path";
7
- import { fileURLToPath } from "node:url";
8
- import { ConsoleLogger, NODE_RUNTIME, VoidLogger, createDuckDB } from "@duckdb/duckdb-wasm/dist/duckdb-node-blocking.cjs";
9
- const require_ = createRequire(typeof __filename !== "undefined" ? __filename : typeof import.meta !== "undefined" ? fileURLToPath(import.meta.url) : process.cwd());
10
- let singleton = null;
11
- let singletonOpts = null;
12
- function bundles() {
13
- return {
14
- mvp: {
15
- mainModule: require_.resolve("@duckdb/duckdb-wasm/dist/duckdb-mvp.wasm"),
16
- mainWorker: null
17
- },
18
- eh: {
19
- mainModule: require_.resolve("@duckdb/duckdb-wasm/dist/duckdb-eh.wasm"),
20
- mainWorker: null
21
- }
6
+ import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
7
+ import { DuckDBInstance, blobValue, timestampValue } from "@duckdb/node-api";
8
+ let singleton;
9
+ function getRuntime() {
10
+ if (singleton) return singleton;
11
+ const directory = mkdtempSync(join(tmpdir(), "gscdump-duckdb-"));
12
+ const onExit = () => rmSync(directory, {
13
+ recursive: true,
14
+ force: true
15
+ });
16
+ process.once("exit", onExit);
17
+ singleton = {
18
+ directory,
19
+ onExit,
20
+ tail: Promise.resolve(),
21
+ state: { _tag: "Unopened" }
22
22
  };
23
+ return singleton;
23
24
  }
24
- async function initialize(opts) {
25
- const logger = opts.verbose ? new ConsoleLogger() : new VoidLogger();
26
- const db = await createDuckDB(bundles(), logger, NODE_RUNTIME);
27
- await db.instantiate();
28
- return {
29
- db,
30
- conn: db.connect()
31
- };
25
+ function enqueue(runtime, operation) {
26
+ const result = runtime.tail.then(operation);
27
+ runtime.tail = result.then(() => void 0, () => void 0);
28
+ return result;
32
29
  }
33
- function getSingleton(opts) {
34
- if (!singleton) {
35
- singleton = initialize(opts);
36
- singletonOpts = opts;
30
+ async function connect(runtime, opts) {
31
+ if (runtime.state._tag === "Opened") return runtime.state.connection;
32
+ const instance = await DuckDBInstance.create(":memory:", { temp_directory: join(runtime.directory, "spill") });
33
+ try {
34
+ const connection = await instance.connect();
35
+ runtime.state = {
36
+ _tag: "Opened",
37
+ instance,
38
+ connection
39
+ };
40
+ await connection.run("SET file_search_path = $1", [runtime.directory]);
41
+ if (opts.verbose) console.warn("[gscdump] Native DuckDB initialized");
42
+ return connection;
43
+ } catch (error) {
44
+ if (runtime.state._tag === "Opened") runtime.state.connection.closeSync();
45
+ runtime.state = { _tag: "Unopened" };
46
+ instance.closeSync();
47
+ throw error;
37
48
  }
38
- return singleton;
49
+ }
50
+ function temporaryPath(runtime, name) {
51
+ const path = resolve(runtime.directory, name);
52
+ const child = relative(runtime.directory, path);
53
+ if (!child || child === ".." || child.startsWith(`..${sep}`) || isAbsolute(child)) throw new TypeError("DuckDB temporary files must stay inside the temporary directory.");
54
+ return path;
55
+ }
56
+ function parameter(value) {
57
+ if (value === null || typeof value === "string" || typeof value === "boolean" || typeof value === "bigint") return value;
58
+ if (typeof value === "number" && Number.isFinite(value)) return value;
59
+ if (value instanceof Date && Number.isFinite(value.getTime())) return timestampValue(BigInt(value.getTime()) * 1000n);
60
+ if (value instanceof Uint8Array) return blobValue(value);
61
+ throw new TypeError("DuckDB parameters must be finite scalars, dates, byte arrays, or null.");
62
+ }
63
+ function rowValue(value) {
64
+ if (value instanceof Date) return value.getTime();
65
+ if (Array.isArray(value)) return value.map(rowValue);
66
+ if (value instanceof Uint8Array) return new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
67
+ if (value !== null && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, rowValue(item)]));
68
+ return value;
39
69
  }
40
70
  function createNodeDuckDBHandle(opts = {}) {
41
- if (singleton && opts.verbose !== void 0 && opts.verbose !== (singletonOpts?.verbose ?? false)) console.warn(`[gscdump] createNodeDuckDBHandle: ignoring verbose=${opts.verbose} — a shared DuckDB instance was already initialized with verbose=${singletonOpts?.verbose ?? false}. Call resetNodeDuckDB() before re-initializing to change it.`);
42
- getSingleton(opts);
43
71
  return {
44
- async query(sql, params) {
45
- const { conn } = await getSingleton(opts);
46
- if (!params || params.length === 0) {
47
- const result = conn.query(sql);
48
- return arrowToRows(result);
49
- }
50
- const stmt = conn.prepare(sql);
51
- try {
52
- const result = stmt.query(...params);
53
- return arrowToRows(result);
54
- } finally {
55
- stmt.close();
56
- }
72
+ query(sql, params) {
73
+ const runtime = getRuntime();
74
+ return enqueue(runtime, async () => {
75
+ const result = await (await connect(runtime, opts)).runAndReadAll(sql, params?.length ? params.map(parameter) : void 0);
76
+ const names = result.columnNames();
77
+ return result.getRowsJS().map((values) => Object.fromEntries(names.map((name, index) => [name, rowValue(values[index])])));
78
+ });
57
79
  },
58
- async registerFileBuffer(name, bytes) {
59
- const { db } = await getSingleton(opts);
60
- db.registerFileBuffer(name, bytes);
80
+ registerFileBuffer(name, bytes) {
81
+ const runtime = getRuntime();
82
+ return enqueue(runtime, async () => {
83
+ const path = temporaryPath(runtime, name);
84
+ await mkdir(dirname(path), { recursive: true });
85
+ await writeFile(path, bytes);
86
+ });
61
87
  },
62
- async copyFileToBuffer(name) {
63
- const { db } = await getSingleton(opts);
64
- return db.copyFileToBuffer(name);
88
+ copyFileToBuffer(name) {
89
+ const runtime = getRuntime();
90
+ return enqueue(runtime, () => readFile(temporaryPath(runtime, name)));
65
91
  },
66
- async dropFiles(names) {
67
- const { db } = await getSingleton(opts);
68
- for (const name of names) {
69
- try {
70
- db.dropFile(name);
71
- } catch (error) {
72
- const message = error instanceof Error ? error.message : String(error);
73
- if (!/not found|does not exist|unknown file/i.test(message)) throw error;
74
- }
75
- try {
76
- unlinkSync(name);
77
- } catch (error) {
78
- if (error.code !== "ENOENT") throw error;
79
- }
80
- }
92
+ dropFiles(names) {
93
+ const runtime = getRuntime();
94
+ return enqueue(runtime, async () => {
95
+ for (const name of names) await rm(temporaryPath(runtime, name), { force: true });
96
+ });
81
97
  },
82
98
  makeTempPath(ext) {
83
- return join(tmpdir(), `gscdump-${Math.random().toString(36).slice(2, 10)}.${ext}`);
99
+ return temporaryPath(getRuntime(), `${randomUUID()}.${ext}`);
84
100
  }
85
101
  };
86
102
  }
87
103
  function resetNodeDuckDB() {
88
- const pending = singleton;
89
- singleton = null;
90
- singletonOpts = null;
91
- pending?.then(({ db, conn }) => {
92
- conn.close();
93
- db.reset();
94
- }).catch((err) => {
95
- console.warn("[gscdump] resetNodeDuckDB: failed to release DuckDB instance", err);
104
+ const runtime = singleton;
105
+ singleton = void 0;
106
+ if (!runtime) return;
107
+ enqueue(runtime, async () => {
108
+ try {
109
+ if (runtime.state._tag === "Opened") {
110
+ runtime.state.connection.closeSync();
111
+ runtime.state.instance.closeSync();
112
+ }
113
+ } finally {
114
+ await rm(runtime.directory, {
115
+ recursive: true,
116
+ force: true
117
+ });
118
+ process.removeListener("exit", runtime.onExit);
119
+ }
120
+ }).catch((error) => {
121
+ console.warn("[gscdump] Failed to release DuckDB resources", error);
96
122
  });
97
123
  }
98
124
  export { createNodeDuckDBHandle, resetNodeDuckDB };
@@ -1,14 +1,13 @@
1
1
  import { DataSource, ManifestStore } from "../storage.mjs";
2
- interface FilesystemDataSourceOptions {
2
+ export interface FilesystemDataSourceOptions {
3
3
  rootDir: string;
4
4
  }
5
- declare function createFilesystemDataSource(opts: FilesystemDataSourceOptions): DataSource;
6
- interface FilesystemManifestStoreOptions {
5
+ export declare function createFilesystemDataSource(opts: FilesystemDataSourceOptions): DataSource;
6
+ export interface FilesystemManifestStoreOptions {
7
7
  path: string;
8
8
  }
9
- declare function createFilesystemManifestStore(opts: FilesystemManifestStoreOptions): ManifestStore;
10
- declare function filesystemStats(rootDir: string): Promise<{
9
+ export declare function createFilesystemManifestStore(opts: FilesystemManifestStoreOptions): ManifestStore;
10
+ export declare function filesystemStats(rootDir: string): Promise<{
11
11
  files: number;
12
12
  bytes: number;
13
- }>;
14
- export { FilesystemDataSourceOptions, FilesystemManifestStoreOptions, createFilesystemDataSource, createFilesystemManifestStore, filesystemStats };
13
+ }>;
@@ -1,15 +1,20 @@
1
1
  import { manifestEntryKey, matchesManifestEntryFilter, matchesSyncStateFilter, matchesWatermarkFilter, mergeSyncState, syncStateKey, watermarkKey } from "../manifest-store-utils.mjs";
2
- import { dirname, join, resolve } from "node:path";
3
- import { Buffer } from "node:buffer";
4
2
  import { randomBytes } from "node:crypto";
5
3
  import { mkdir, open, readFile, readdir, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
4
+ import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
5
+ import { Buffer } from "node:buffer";
6
+ import { normalize } from "pathe";
6
7
  import { lock } from "proper-lockfile";
8
+ function portablePath(path) {
9
+ return sep === "\\" ? normalize(path) : path;
10
+ }
7
11
  function createFilesystemDataSource(opts) {
8
12
  const root = resolve(opts.rootDir);
9
13
  const readyDirectories = /* @__PURE__ */ new Map();
10
14
  function pathFor(key) {
11
15
  const resolved = resolve(root, key);
12
- if (!resolved.startsWith(`${root}/`) && resolved !== root) throw new Error(`path escapes root: ${key}`);
16
+ const child = relative(root, resolved);
17
+ if (child === ".." || child.startsWith(`..${sep}`) || isAbsolute(child)) throw new Error(`path escapes root: ${key}`);
13
18
  return resolved;
14
19
  }
15
20
  async function ensureDirectory(path) {
@@ -72,11 +77,11 @@ function createFilesystemDataSource(opts) {
72
77
  const full = pathFor(prefix);
73
78
  const out = [];
74
79
  await walk(full, out);
75
- return out.map((p) => p.slice(root.length + 1));
80
+ return out.map((p) => portablePath(relative(root, p)));
76
81
  },
77
82
  async *streamList(prefix) {
78
83
  const full = pathFor(prefix);
79
- for await (const p of walkStream(full)) yield p.slice(root.length + 1);
84
+ for await (const p of walkStream(full)) yield portablePath(relative(root, p));
80
85
  },
81
86
  async head(key) {
82
87
  const path = pathFor(key);
@@ -86,7 +91,7 @@ function createFilesystemDataSource(opts) {
86
91
  });
87
92
  },
88
93
  uri(key) {
89
- return pathFor(key);
94
+ return portablePath(pathFor(key));
90
95
  }
91
96
  };
92
97
  }
@@ -1,9 +1,9 @@
1
- import { ParquetQueryFilter } from "../node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/types/index.mjs";
2
- import "../node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/types/node.mjs";
1
+ import { ParquetQueryFilter } from "../node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/types/index.mjs";
2
+ import "../node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/types/node.mjs";
3
3
  import { CodecCtx, DataSource, ParquetCodec, Row, TableName } from "../storage.mjs";
4
4
  import { ColumnDef } from "../schema.mjs";
5
- declare function encodeRowsToParquet(table: TableName, rows: readonly Row[]): Uint8Array;
6
- interface EncodeFlexOptions {
5
+ export declare function encodeRowsToParquet(table: TableName, rows: readonly Row[]): Uint8Array;
6
+ export interface EncodeFlexOptions {
7
7
  /** Columns defining the output schema + order. */
8
8
  columns: readonly ColumnDef[];
9
9
  /** Sort key columns (subset of `columns` by name). Empty = preserve input order. */
@@ -18,8 +18,8 @@ interface EncodeFlexOptions {
18
18
  * the canonical encoder so DuckDB `read_parquet(union_by_name = true)`
19
19
  * merges cleanly with fact-table reads.
20
20
  */
21
- declare function encodeRowsToParquetFlex(rows: readonly Row[], opts: EncodeFlexOptions): Uint8Array;
22
- interface DecodeParquetOptions {
21
+ export declare function encodeRowsToParquetFlex(rows: readonly Row[], opts: EncodeFlexOptions): Uint8Array;
22
+ export interface DecodeParquetOptions {
23
23
  /** First physical row to decode, inclusive. */
24
24
  rowStart?: number;
25
25
  /** Last physical row to decode, exclusive. */
@@ -44,8 +44,8 @@ interface DecodeParquetOptions {
44
44
  */
45
45
  columns?: readonly string[];
46
46
  }
47
- declare function decodeParquetToRows(bytes: Uint8Array, opts?: DecodeParquetOptions): Promise<Row[]>;
48
- interface HyparquetCodecOptions {
47
+ export declare function decodeParquetToRows(bytes: Uint8Array, opts?: DecodeParquetOptions): Promise<Row[]>;
48
+ export interface HyparquetCodecOptions {
49
49
  /**
50
50
  * Override `readRows`. Useful when reads should be delegated to a faster
51
51
  * engine (e.g. DuckDB-WASM via httpfs) while writes + compaction stay on
@@ -58,5 +58,4 @@ interface HyparquetCodecOptions {
58
58
  */
59
59
  compactionReadConcurrency?: number;
60
60
  }
61
- declare function createHyparquetCodec(options?: HyparquetCodecOptions): ParquetCodec;
62
- export { DecodeParquetOptions, EncodeFlexOptions, HyparquetCodecOptions, createHyparquetCodec, decodeParquetToRows, encodeRowsToParquet, encodeRowsToParquetFlex };
61
+ export declare function createHyparquetCodec(options?: HyparquetCodecOptions): ParquetCodec;
@@ -1,8 +1,8 @@
1
1
  import { TABLE_METADATA } from "../drizzle-schema.mjs";
2
2
  import { SCHEMAS } from "../schema.mjs";
3
- import { parquetMetadataAsync, parquetSchema } from "../node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/metadata.mjs";
4
- import { parquetReadObjects } from "../node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/read.mjs";
5
- import "../node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/node.mjs";
3
+ import { parquetMetadataAsync, parquetSchema } from "../node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/metadata.mjs";
4
+ import { parquetReadObjects } from "../node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/read.mjs";
5
+ import "../node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/node.mjs";
6
6
  import { ByteWriter } from "../node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/src/bytewriter.mjs";
7
7
  import { parquetWriteRows } from "../node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/src/write-rows.mjs";
8
8
  import "../node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/src/node.mjs";
@@ -124,14 +124,37 @@ function sortRowsByClusterKey(table, rows) {
124
124
  });
125
125
  return copy;
126
126
  }
127
- function naturalKeyFor(table, row) {
128
- const key = TABLE_METADATA[table].sortKey;
129
- let value = "";
130
- for (let index = 0; index < key.length; index++) {
131
- if (index > 0) value += "\0";
132
- value += `${row[key[index]] ?? ""}`;
127
+ function naturalKeyHash(key, row) {
128
+ let hash = 2166136261;
129
+ for (const column of key) {
130
+ const value = String(row[column] ?? "");
131
+ for (let i = 0; i < value.length; i++) hash = Math.imul(hash ^ value.charCodeAt(i), 16777619);
132
+ hash = Math.imul(hash, 16777619);
133
133
  }
134
- return value;
134
+ return hash & 1073741823;
135
+ }
136
+ function sameNaturalKey(key, a, b) {
137
+ return key.every((column) => String(a[column] ?? "") === String(b[column] ?? ""));
138
+ }
139
+ function naturalKeyTuple(key, row) {
140
+ return JSON.stringify(key.map((column) => String(row[column] ?? "")));
141
+ }
142
+ function indexRow(index, key, row) {
143
+ const hash = naturalKeyHash(key, row);
144
+ const existing = index.get(hash);
145
+ if (existing === void 0) index.set(hash, row);
146
+ else if (existing instanceof Map) existing.set(naturalKeyTuple(key, row), row);
147
+ else if (Array.isArray(existing)) {
148
+ const match = existing.findIndex((candidate) => sameNaturalKey(key, candidate, row));
149
+ if (match >= 0) existing[match] = row;
150
+ else if (existing.length < 8) existing.push(row);
151
+ else {
152
+ const bucket = new Map(existing.map((candidate) => [naturalKeyTuple(key, candidate), candidate]));
153
+ bucket.set(naturalKeyTuple(key, row), row);
154
+ index.set(hash, bucket);
155
+ }
156
+ } else if (sameNaturalKey(key, existing, row)) index.set(hash, row);
157
+ else index.set(hash, [existing, row]);
135
158
  }
136
159
  function encodeOrderedRows(rows, columns, rowGroupSize) {
137
160
  const schema = buildWriteSchema(columns);
@@ -189,44 +212,57 @@ function asyncBufferFromBytes(bytes) {
189
212
  };
190
213
  }
191
214
  async function decodeParquetToRows(bytes, opts = {}) {
192
- if (bytes.byteLength === 0) return [];
193
- const file = asyncBufferFromBytes(bytes);
194
- const projection = opts.columns ? await presentColumns(file, opts.columns) : null;
195
- return normalizeDecodedDates(await parquetReadObjects({
196
- file,
197
- ...opts.rowStart === void 0 ? {} : { rowStart: opts.rowStart },
198
- ...opts.rowEnd === void 0 ? {} : { rowEnd: opts.rowEnd },
199
- ...opts.rowStart !== void 0 || opts.rowEnd !== void 0 ? { useOffsetIndex: true } : {},
200
- ...projection ? {
201
- metadata: projection.metadata,
202
- columns: projection.columns
203
- } : {},
204
- ...opts.filter ? {
205
- filter: opts.filter,
206
- useBloomFilters: true,
207
- usePageIndex: true
208
- } : {}
209
- }));
215
+ const rows = [];
216
+ for await (const group of decodeParquetGroups(bytes, opts)) for (const row of group) rows.push(row);
217
+ return rows;
210
218
  }
211
- async function presentColumns(file, requested) {
219
+ async function* decodeParquetGroups(bytes, opts = {}) {
220
+ if (bytes.byteLength === 0) return;
221
+ const file = asyncBufferFromBytes(bytes);
212
222
  const metadata = await parquetMetadataAsync(file);
213
223
  const present = new Set(parquetSchema(metadata).children.map((child) => child.element.name));
214
- return {
215
- metadata,
216
- columns: requested.filter((name) => present.has(name))
217
- };
224
+ const columns = opts.columns?.filter((name) => present.has(name));
225
+ let groupStart = 0;
226
+ for (const group of metadata.row_groups) {
227
+ const groupEnd = groupStart + Number(group.num_rows);
228
+ const rowStart = Math.max(groupStart, opts.rowStart ?? 0);
229
+ const rowEnd = Math.min(groupEnd, opts.rowEnd ?? Infinity);
230
+ if (rowStart < rowEnd) yield normalizeDecodedDates(await parquetReadObjects({
231
+ file,
232
+ metadata: {
233
+ ...metadata,
234
+ row_groups: [group],
235
+ num_rows: group.num_rows
236
+ },
237
+ columns,
238
+ rowStart: rowStart - groupStart,
239
+ rowEnd: rowEnd - groupStart,
240
+ useOffsetIndex: rowStart > groupStart || rowEnd < groupEnd,
241
+ ...opts.filter ? {
242
+ filter: opts.filter,
243
+ useBloomFilters: true,
244
+ usePageIndex: true
245
+ } : {}
246
+ }));
247
+ groupStart = groupEnd;
248
+ }
218
249
  }
219
250
  function normalizeDecodedDates(rows) {
220
- if (rows.length === 0) return rows;
221
- const dateCols = [];
222
- const first = rows[0];
223
- for (const k in first) if (first[k] instanceof Date) dateCols.push(k);
224
- if (dateCols.length === 0) return rows;
251
+ const dates = /* @__PURE__ */ new Map();
225
252
  for (const row of rows) {
226
253
  const r = row;
227
- for (const k of dateCols) {
254
+ for (const k in r) {
228
255
  const v = r[k];
229
- if (v instanceof Date) r[k] = isoFromDate(v);
256
+ if (v instanceof Date) {
257
+ const day = Math.floor(v.getTime() / EPOCH_DAY_MS);
258
+ let iso = dates.get(day);
259
+ if (iso === void 0) {
260
+ iso = isoFromDate(v);
261
+ if (dates.size >= 1024) dates.clear();
262
+ dates.set(day, iso);
263
+ }
264
+ r[k] = iso;
265
+ }
230
266
  }
231
267
  }
232
268
  return rows;
@@ -256,16 +292,20 @@ function createHyparquetCodec(options = {}) {
256
292
  rowCount: 0
257
293
  };
258
294
  }
295
+ const key = TABLE_METADATA[ctx.table].sortKey;
259
296
  const byNaturalKey = /* @__PURE__ */ new Map();
260
297
  for (let offset = 0; offset < inputKeys.length; offset += compactionReadConcurrency) {
261
298
  const batch = inputKeys.slice(offset, offset + compactionReadConcurrency);
262
299
  const inputs = await Promise.all(batch.map((key) => dataSource.read(key)));
263
- for (const input of inputs) {
264
- const rows = await decodeParquetToRows(input);
265
- for (let i = 0; i < rows.length; i++) byNaturalKey.set(naturalKeyFor(ctx.table, rows[i]), rows[i]);
300
+ while (inputs.length > 0) {
301
+ const input = inputs.shift();
302
+ for await (const rows of decodeParquetGroups(input)) for (const row of rows) indexRow(byNaturalKey, key, row);
266
303
  }
267
304
  }
268
- const rows = [...byNaturalKey.values()];
305
+ const rows = [];
306
+ for (const entry of byNaturalKey.values()) if (entry instanceof Map || Array.isArray(entry)) for (const row of entry.values()) rows.push(row);
307
+ else rows.push(entry);
308
+ byNaturalKey.clear();
269
309
  const bytes = encodeRowsToParquet(ctx.table, rows);
270
310
  await dataSource.write(outputKey, bytes);
271
311
  return {
@@ -1,14 +1,14 @@
1
1
  import { DataSource, StorageEngine } from "../storage.mjs";
2
2
  import { Row, TableName, TenantCtx } from "@gscdump/contracts";
3
3
  import { SearchType } from "gscdump/query";
4
- interface NodeHarnessOptions {
4
+ export interface NodeHarnessOptions {
5
5
  dataDir: string;
6
6
  /** Tenant user id. Defaults to `'local'` for single-user CLI installs. */
7
7
  userId?: string;
8
8
  /** Name of the manifest file under `dataDir`. Defaults to `manifest.json`. */
9
9
  manifestFilename?: string;
10
10
  }
11
- interface NodeHarness {
11
+ export interface NodeHarness {
12
12
  engine: StorageEngine;
13
13
  /**
14
14
  * Underlying filesystem-backed DataSource. Exposed so commands that write
@@ -35,5 +35,4 @@ interface NodeHarness {
35
35
  keys: string[];
36
36
  }>;
37
37
  }
38
- declare function createNodeHarness(opts: NodeHarnessOptions): NodeHarness;
39
- export { NodeHarness, NodeHarnessOptions, createNodeHarness };
38
+ export declare function createNodeHarness(opts: NodeHarnessOptions): NodeHarness;