@gscdump/engine 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (366) hide show
  1. package/dist/adapters/duckdb-node.d.mts +7 -0
  2. package/dist/adapters/duckdb-node.mjs +94 -0
  3. package/dist/adapters/filesystem.d.mts +1 -1
  4. package/dist/adapters/filesystem.mjs +1 -1
  5. package/dist/adapters/hyparquet.d.mts +4 -3
  6. package/dist/adapters/hyparquet.mjs +7 -3
  7. package/dist/adapters/node-harness.d.mts +38 -0
  8. package/dist/adapters/node-harness.mjs +47 -0
  9. package/dist/adapters/node.d.mts +4 -100
  10. package/dist/adapters/node.mjs +4 -240
  11. package/dist/adapters/parquet-attach.d.mts +23 -0
  12. package/dist/adapters/parquet-attach.mjs +21 -0
  13. package/dist/adapters/r2-manifest.d.mts +82 -0
  14. package/dist/adapters/r2-manifest.mjs +364 -0
  15. package/dist/adapters/r2.d.mts +1 -1
  16. package/dist/adapters/read-optional.mjs +15 -0
  17. package/dist/adapters/snapshot-attach.d.mts +38 -0
  18. package/dist/adapters/snapshot-attach.mjs +85 -0
  19. package/dist/analysis-types.d.mts +56 -1
  20. package/dist/analyzer/define.d.mts +48 -0
  21. package/dist/analyzer/define.mjs +60 -0
  22. package/dist/analyzer/dispatch.d.mts +17 -0
  23. package/dist/analyzer/index.d.mts +4 -14
  24. package/dist/analyzer/index.mjs +4 -112
  25. package/dist/analyzer/registry.d.mts +33 -0
  26. package/dist/analyzer/registry.mjs +49 -0
  27. package/dist/analyzer/types.d.mts +95 -0
  28. package/dist/analyzer/types.mjs +5 -0
  29. package/dist/coerce.d.mts +4 -0
  30. package/dist/compaction.d.mts +14 -0
  31. package/dist/{_chunks/parquet-plan.mjs → compaction.mjs} +2 -138
  32. package/dist/contracts.d.mts +1 -2
  33. package/dist/{_chunks/schema.d.mts → drizzle-schema.d.mts} +2 -34
  34. package/dist/{_chunks/schema.mjs → drizzle-schema.mjs} +2 -78
  35. package/dist/{_chunks/snapshot.d.mts → duckdb.d.mts} +1 -14
  36. package/dist/duckdb.mjs +207 -0
  37. package/dist/engine.d.mts +4 -0
  38. package/dist/engine.mjs +385 -0
  39. package/dist/entities.d.mts +3 -52
  40. package/dist/entities.mjs +867 -2
  41. package/dist/errors.d.mts +114 -1
  42. package/dist/gc.mjs +92 -0
  43. package/dist/iceberg/append-sink.d.mts +14 -0
  44. package/dist/iceberg/append-sink.mjs +142 -0
  45. package/dist/iceberg/catalog.d.mts +71 -0
  46. package/dist/iceberg/catalog.mjs +109 -0
  47. package/dist/iceberg/index.d.mts +4 -13
  48. package/dist/iceberg/index.mjs +3 -244
  49. package/dist/iceberg/overwrite-writer.d.mts +161 -0
  50. package/dist/iceberg/overwrite-writer.mjs +102 -0
  51. package/dist/iceberg/pyiceberg-runtime.mjs +34 -0
  52. package/dist/iceberg/schema.d.mts +69 -0
  53. package/dist/{_chunks/schema2.mjs → iceberg/schema.mjs} +3 -2
  54. package/dist/index.d.mts +14 -190
  55. package/dist/index.mjs +10 -645
  56. package/dist/ingest-accumulator.d.mts +1 -1
  57. package/dist/ingest.d.mts +1 -1
  58. package/dist/layout.d.mts +31 -0
  59. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.bitreader.mjs +88 -0
  60. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.blocks.mjs +120 -0
  61. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.context.mjs +1805 -0
  62. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.contextmap.mjs +49 -0
  63. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.dictionary.mjs +984 -0
  64. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.huffman.mjs +266 -0
  65. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.mjs +340 -0
  66. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.prefix.mjs +109 -0
  67. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.streams.mjs +21 -0
  68. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.transform.mjs +190 -0
  69. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/compressors.mjs +7 -0
  70. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/gzip.huffman.mjs +121 -0
  71. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/gzip.mjs +176 -0
  72. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/index.mjs +7 -0
  73. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/lz4.mjs +52 -0
  74. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/bloom.mjs +93 -0
  75. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/bytewriter.mjs +91 -0
  76. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/column.mjs +186 -0
  77. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/datapage.mjs +113 -0
  78. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/delta.mjs +111 -0
  79. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/dictionary.mjs +99 -0
  80. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/dremel.mjs +116 -0
  81. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/encoding.mjs +51 -0
  82. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/geospatial.mjs +84 -0
  83. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/index.mjs +7 -0
  84. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/indexes.mjs +31 -0
  85. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/metadata.mjs +138 -0
  86. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/node.mjs +8 -0
  87. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/parquet-writer.mjs +139 -0
  88. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/plain.mjs +68 -0
  89. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/schema.mjs +254 -0
  90. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/snappy.mjs +125 -0
  91. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/splitstream.mjs +38 -0
  92. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/thrift.mjs +79 -0
  93. package/dist/{_chunks/libs/hyparquet-writer.d.mts → node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/types.d.mts} +2 -2
  94. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/unconvert.mjs +247 -0
  95. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/variant.mjs +321 -0
  96. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/wkb.mjs +79 -0
  97. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/write-rows.mjs +122 -0
  98. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/write.mjs +5 -0
  99. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/bytewriter.d.mts +1 -0
  100. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/index.d.mts +10 -0
  101. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/node.d.mts +3 -0
  102. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/parquet-writer.d.mts +2 -0
  103. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/schema.d.mts +2 -0
  104. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/wkb.d.mts +1 -0
  105. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/write-rows.d.mts +1 -0
  106. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/write.d.mts +1 -0
  107. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/assemble.mjs +3 -0
  108. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/bloom.mjs +69 -0
  109. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/column.mjs +8 -0
  110. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/constants.mjs +80 -0
  111. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/convert.mjs +3 -0
  112. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/datapage.mjs +6 -0
  113. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/delta.mjs +2 -0
  114. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/encoding.mjs +2 -0
  115. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/filter.mjs +3 -0
  116. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/geoparquet.mjs +1 -0
  117. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/index.mjs +7 -0
  118. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/indexes.mjs +5 -0
  119. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/metadata.mjs +7 -0
  120. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/node.mjs +3 -0
  121. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/plain.mjs +1 -0
  122. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/plan.mjs +5 -0
  123. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/query.mjs +3 -0
  124. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/read.mjs +6 -0
  125. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/rowgroup.mjs +7 -0
  126. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/schema.mjs +54 -0
  127. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/snappy.mjs +1 -0
  128. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/thrift.mjs +1 -0
  129. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/types.d.mts +1 -0
  130. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/utils.mjs +19 -0
  131. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/variant.mjs +3 -0
  132. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/wkb.mjs +1 -0
  133. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/xxhash.mjs +68 -0
  134. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/index.d.mts +7 -0
  135. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/indexes.d.mts +1 -0
  136. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/metadata.d.mts +1 -0
  137. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/node.d.mts +2 -0
  138. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/query.d.mts +1 -0
  139. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/read.d.mts +1 -0
  140. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/snappy.d.mts +1 -0
  141. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/utils.d.mts +1 -0
  142. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/assemble.mjs +144 -0
  143. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/bloom.mjs +124 -0
  144. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/column.mjs +127 -0
  145. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/constants.mjs +75 -0
  146. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/convert.mjs +118 -0
  147. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/datapage.mjs +144 -0
  148. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/delta.mjs +65 -0
  149. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/encoding.mjs +76 -0
  150. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/filter.mjs +98 -0
  151. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/geoparquet.mjs +24 -0
  152. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/index.mjs +7 -0
  153. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/indexes.mjs +16 -0
  154. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/metadata.mjs +235 -0
  155. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/node.mjs +7 -0
  156. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/plain.mjs +78 -0
  157. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/plan.mjs +147 -0
  158. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/query.mjs +3 -0
  159. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/read.mjs +106 -0
  160. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/rowgroup.mjs +154 -0
  161. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/schema.mjs +75 -0
  162. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/snappy.mjs +70 -0
  163. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/thrift.mjs +86 -0
  164. package/dist/{_chunks/libs/hyparquet.d.mts → node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/types.d.mts} +6 -8
  165. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/utils.mjs +31 -0
  166. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/variant.mjs +225 -0
  167. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/wkb.mjs +94 -0
  168. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/xxhash.mjs +68 -0
  169. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/index.d.mts +10 -0
  170. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/indexes.d.mts +1 -0
  171. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/metadata.d.mts +1 -0
  172. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/node.d.mts +3 -0
  173. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/query.d.mts +1 -0
  174. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/read.d.mts +1 -0
  175. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/snappy.d.mts +1 -0
  176. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/utils.d.mts +1 -0
  177. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/avro/avro.metadata.mjs +1 -0
  178. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/avro/avro.read.mjs +4 -0
  179. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/avro/avro.write.mjs +2 -0
  180. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/catalog/file.mjs +1 -0
  181. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/catalog/loadTable.mjs +3 -0
  182. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/catalog/rest.mjs +73 -0
  183. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/create.mjs +67 -0
  184. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/delete.mjs +2 -0
  185. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/fetch.mjs +8 -0
  186. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/index.mjs +13 -0
  187. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/json.mjs +147 -0
  188. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/manifest.mjs +2 -0
  189. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/metadata.mjs +3 -0
  190. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/prune.mjs +4 -0
  191. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/puffin/deletion-vector.mjs +2 -0
  192. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/puffin/puffin.mjs +2 -0
  193. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/puffin/roaring.mjs +1 -0
  194. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/read.mjs +9 -0
  195. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/s3.mjs +3 -0
  196. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/schema.mjs +76 -0
  197. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sigv4.mjs +2 -0
  198. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sql/icebergDataSource.mjs +8 -0
  199. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sql/icebergQuery.mjs +5 -0
  200. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sql/whereFilter.mjs +1 -0
  201. package/dist/{_chunks/libs/icebird.d.mts → node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/types.d.mts} +5 -33
  202. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/utils.mjs +8 -0
  203. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/commit.mjs +5 -0
  204. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/conversions.mjs +19 -0
  205. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/delete-file.mjs +3 -0
  206. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/geospatial.mjs +1 -0
  207. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/manifest-list.mjs +2 -0
  208. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/manifest.mjs +3 -0
  209. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/parquet.mjs +5 -0
  210. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/partition.mjs +75 -0
  211. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/rewrite.mjs +10 -0
  212. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/serde.mjs +2 -0
  213. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/snapshot.mjs +5 -0
  214. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/sort.mjs +3 -0
  215. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stage-deletion-vector.mjs +11 -0
  216. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stage-position-delete.mjs +8 -0
  217. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stage.mjs +10 -0
  218. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stats.mjs +4 -0
  219. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/transform.mjs +60 -0
  220. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/write.mjs +45 -0
  221. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/catalog/file.d.mts +1 -0
  222. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/catalog/rest.d.mts +1 -0
  223. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/create.d.mts +1 -0
  224. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/fetch.d.mts +1 -0
  225. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/index.d.mts +13 -0
  226. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/manifest.d.mts +1 -0
  227. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/metadata.d.mts +1 -0
  228. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/read.d.mts +2 -0
  229. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/s3.d.mts +1 -0
  230. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/sql/icebergDataSource.d.mts +2 -0
  231. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/sql/icebergQuery.d.mts +2 -0
  232. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/write/write.d.mts +32 -0
  233. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/ast.d.mts +1 -0
  234. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/backend/dataSource.mjs +1 -0
  235. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/accumulator.mjs +2 -0
  236. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/aggregates.mjs +10 -0
  237. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/execute.mjs +15 -0
  238. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/join.mjs +5 -0
  239. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/scanColumn.mjs +1 -0
  240. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/sort.mjs +5 -0
  241. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/streamingAggregate.mjs +9 -0
  242. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/utils.mjs +1 -0
  243. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/window.mjs +5 -0
  244. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/yield.mjs +17 -0
  245. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/alias.mjs +1 -0
  246. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/binary.mjs +1 -0
  247. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/date.mjs +1 -0
  248. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/evaluate.mjs +15 -0
  249. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/math.mjs +1 -0
  250. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/regexp.mjs +2 -0
  251. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/strings.mjs +3 -0
  252. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/index.d.mts +1 -0
  253. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/index.mjs +9 -0
  254. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/expression.mjs +6 -0
  255. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/extractTables.mjs +1 -0
  256. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/functions.mjs +5 -0
  257. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/joins.mjs +7 -0
  258. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/parse.mjs +10 -0
  259. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/primary.mjs +8 -0
  260. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/state.mjs +2 -0
  261. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/tokenize.mjs +3 -0
  262. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/types.d.mts +1 -0
  263. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/plan/columns.mjs +3 -0
  264. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/plan/plan.mjs +7 -0
  265. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/plan/types.d.mts +1 -0
  266. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/bbox.mjs +2 -0
  267. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/equality.mjs +2 -0
  268. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/operations.mjs +5 -0
  269. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/pointRelations.mjs +2 -0
  270. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/primitives.mjs +2 -0
  271. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/segments.mjs +2 -0
  272. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/spatial.mjs +6 -0
  273. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/wkt.mjs +1 -0
  274. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/types.d.mts +3 -0
  275. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/aggregates.mjs +3 -0
  276. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/executionErrors.mjs +2 -0
  277. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/functions.mjs +2 -0
  278. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/keywords.mjs +1 -0
  279. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/parseErrors.mjs +2 -0
  280. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/tables.mjs +2 -0
  281. package/dist/parquet-plan.d.mts +15 -0
  282. package/dist/parquet-plan.mjs +139 -0
  283. package/dist/parquet-pushdown.mjs +58 -0
  284. package/dist/period/index.d.mts +52 -1
  285. package/dist/planner.d.mts +2 -14
  286. package/dist/planner.mjs +2 -1
  287. package/dist/profile.d.mts +21 -0
  288. package/dist/profile.mjs +27 -0
  289. package/dist/query-dim.d.mts +54 -0
  290. package/dist/query-dim.mjs +91 -0
  291. package/dist/report/define.d.mts +8 -0
  292. package/dist/report/define.mjs +15 -0
  293. package/dist/report/hash.d.mts +13 -0
  294. package/dist/report/hash.mjs +29 -0
  295. package/dist/report/index.d.mts +4 -170
  296. package/dist/report/index.mjs +3 -55
  297. package/dist/report/registry.d.mts +18 -0
  298. package/dist/report/registry.mjs +14 -0
  299. package/dist/report/types.d.mts +139 -0
  300. package/dist/resolver/adapter.d.mts +13 -0
  301. package/dist/resolver/adapter.mjs +27 -0
  302. package/dist/resolver/canonical-source.d.mts +5 -0
  303. package/dist/resolver/canonical-source.mjs +14 -0
  304. package/dist/resolver/compile.d.mts +15 -0
  305. package/dist/resolver/compile.mjs +396 -0
  306. package/dist/resolver/datasets.d.mts +16 -0
  307. package/dist/resolver/datasets.mjs +159 -0
  308. package/dist/resolver/extras-overlay.d.mts +37 -0
  309. package/dist/resolver/extras-overlay.mjs +17 -0
  310. package/dist/resolver/filter-utils.d.mts +10 -0
  311. package/dist/resolver/filter-utils.mjs +59 -0
  312. package/dist/resolver/fragments.d.mts +60 -0
  313. package/dist/resolver/fragments.mjs +206 -0
  314. package/dist/resolver/index.d.mts +11 -371
  315. package/dist/resolver/index.mjs +10 -1
  316. package/dist/resolver/pg-adapter.d.mts +56 -0
  317. package/dist/resolver/pg-adapter.mjs +110 -0
  318. package/dist/resolver/run-query.d.mts +172 -0
  319. package/dist/resolver/run-query.mjs +241 -0
  320. package/dist/resolver/schema-drift.d.mts +15 -0
  321. package/dist/resolver/schema-drift.mjs +12 -0
  322. package/dist/rollups.d.mts +4 -4
  323. package/dist/rollups.mjs +3 -2
  324. package/dist/schedule.mjs +100 -0
  325. package/dist/schema.d.mts +34 -1
  326. package/dist/schema.mjs +78 -1
  327. package/dist/sink-node.d.mts +1 -159
  328. package/dist/sink-node.mjs +1 -133
  329. package/dist/sink.d.mts +125 -0
  330. package/dist/sinks/in-memory-sink.d.mts +25 -0
  331. package/dist/sinks/in-memory-sink.mjs +61 -0
  332. package/dist/sinks/index.d.mts +2 -0
  333. package/dist/sinks/index.mjs +2 -0
  334. package/dist/snapshot.d.mts +14 -0
  335. package/dist/source/attached-table.d.mts +45 -0
  336. package/dist/source/attached-table.mjs +55 -0
  337. package/dist/source/create-sql-query-source.d.mts +24 -0
  338. package/dist/source/create-sql-query-source.mjs +28 -0
  339. package/dist/source/index.d.mts +6 -66
  340. package/dist/source/index.mjs +9 -82
  341. package/dist/source/source-types.d.mts +49 -0
  342. package/dist/{_chunks/storage.d.mts → storage.d.mts} +4 -14
  343. package/dist/sync-config.d.mts +36 -0
  344. package/dist/sync-config.mjs +98 -0
  345. package/dist/vendor/hysnappy-purejs.mjs +12 -1
  346. package/package.json +4 -4
  347. package/dist/_chunks/analysis-types.d.mts +0 -57
  348. package/dist/_chunks/contracts.d.mts +0 -1
  349. package/dist/_chunks/engine.mjs +0 -731
  350. package/dist/_chunks/entities.mjs +0 -967
  351. package/dist/_chunks/errors.d.mts +0 -115
  352. package/dist/_chunks/index.d.mts +0 -53
  353. package/dist/_chunks/libs/hyparquet-compressors.mjs +0 -2796
  354. package/dist/_chunks/libs/hyparquet-writer.mjs +0 -2524
  355. package/dist/_chunks/libs/hyparquet.mjs +0 -2596
  356. package/dist/_chunks/libs/icebird.mjs +0 -564
  357. package/dist/_chunks/registry.d.mts +0 -213
  358. package/dist/_chunks/resolver.mjs +0 -1220
  359. package/dist/_chunks/sink.d.mts +0 -257
  360. /package/dist/{_chunks → analyzer}/dispatch.mjs +0 -0
  361. /package/dist/{_chunks/coerce.mjs → coerce.mjs} +0 -0
  362. /package/dist/{_chunks/layout.mjs → layout.mjs} +0 -0
  363. /package/dist/{_chunks/manifest-store-utils.mjs → manifest-store-utils.mjs} +0 -0
  364. /package/dist/{_chunks/libs/fzstd.mjs → node_modules/.pnpm/fzstd@0.1.1/node_modules/fzstd/esm/index.mjs} +0 -0
  365. /package/dist/{_chunks → resolver}/types.d.mts +0 -0
  366. /package/dist/{_chunks/schedule.d.mts → schedule.d.mts} +0 -0
@@ -0,0 +1,48 @@
1
+ import { AnalysisParams } from "../analysis-types.mjs";
2
+ import { FileSet } from "../source/source-types.mjs";
3
+ import { Analyzer, BuildContext, RequiredCapability, SqlExtraQuery } from "./types.mjs";
4
+ import { BuilderState } from "gscdump/query";
5
+ interface SqlPlanSpec {
6
+ sql: string;
7
+ params: unknown[];
8
+ current: FileSet;
9
+ previous?: FileSet;
10
+ extraFiles?: Record<string, FileSet>;
11
+ extraQueries?: SqlExtraQuery[];
12
+ }
13
+ interface ReduceCtx<InputRow> {
14
+ /** Extra SQL-query results keyed by `SqlExtraQuery.name` (SQL path only). */
15
+ extras?: Record<string, InputRow[]>;
16
+ }
17
+ type Reducer<Params, InputRow, Result> = (rows: InputRow[] | Record<string, InputRow[]>, params: Params, ctx: ReduceCtx<InputRow>) => {
18
+ results: Result;
19
+ meta?: Record<string, unknown>;
20
+ };
21
+ interface DefineAnalyzerOptions<Params extends AnalysisParams, InputRow, Result> {
22
+ id: string;
23
+ /**
24
+ * Shared reducer used by both SQL and row paths. Use this when the
25
+ * post-aggregation row count is small and filter/sort/derive can live in
26
+ * one place. Mutually exclusive with `reduceSql` / `reduceRows`.
27
+ */
28
+ reduce?: Reducer<Params, InputRow, Result>;
29
+ /** SQL-only reducer. Required when `buildSql` is set without `reduce`. */
30
+ reduceSql?: Reducer<Params, InputRow, Result>;
31
+ /** Row-only reducer. Required when `buildRows` is set without `reduce`. */
32
+ reduceRows?: Reducer<Params, InputRow, Result>;
33
+ /** SQL plan builder. Omit if the analyzer has no SQL path. */
34
+ buildSql?: (params: Params, ctx: BuildContext) => SqlPlanSpec;
35
+ /** Row plan builder. Omit if the analyzer has no row path. */
36
+ buildRows?: (params: Params, ctx: BuildContext) => Record<string, BuilderState>;
37
+ /** Capabilities required by the SQL plan. Defaults to `['executeSql', 'fileSets']`. */
38
+ sqlRequires?: readonly RequiredCapability[];
39
+ /** Capabilities required by the row plan. Defaults to `[]`. */
40
+ rowsRequires?: readonly RequiredCapability[];
41
+ }
42
+ interface DefinedAnalyzer {
43
+ id: string;
44
+ sql?: Analyzer;
45
+ rows?: Analyzer;
46
+ }
47
+ declare function defineAnalyzer<Params extends AnalysisParams, InputRow, Result>(opts: DefineAnalyzerOptions<Params, InputRow, Result>): DefinedAnalyzer;
48
+ export { DefineAnalyzerOptions, DefinedAnalyzer, ReduceCtx, Reducer, SqlPlanSpec, defineAnalyzer };
@@ -0,0 +1,60 @@
1
+ const DEFAULT_SQL_REQUIRES = ["executeSql", "fileSets"];
2
+ function defineAnalyzer(opts) {
3
+ const { id, reduce, reduceSql, reduceRows, buildSql, buildRows, sqlRequires = DEFAULT_SQL_REQUIRES, rowsRequires = [] } = opts;
4
+ const sqlReducer = reduceSql ?? reduce;
5
+ const rowsReducer = reduceRows ?? reduce;
6
+ if (buildSql && !sqlReducer) throw new Error(`defineAnalyzer(${id}): buildSql requires reduce or reduceSql`);
7
+ if (buildRows && !rowsReducer) throw new Error(`defineAnalyzer(${id}): buildRows requires reduce or reduceRows`);
8
+ const wrap = (fn) => (rows, params, ctx) => {
9
+ return fn(Array.isArray(rows) ? rows : pickSingle(rows) ?? rows, params, ctx);
10
+ };
11
+ return {
12
+ id,
13
+ sql: buildSql && sqlReducer ? {
14
+ id,
15
+ requires: sqlRequires,
16
+ build(params, ctx = {}) {
17
+ const spec = buildSql(params, ctx);
18
+ return {
19
+ kind: "sql",
20
+ sql: spec.sql,
21
+ params: spec.params,
22
+ current: spec.current,
23
+ previous: spec.previous,
24
+ extraFiles: spec.extraFiles,
25
+ extraQueries: spec.extraQueries
26
+ };
27
+ },
28
+ reduce(rows, ctx) {
29
+ const { results, meta } = wrap(sqlReducer)(rows, ctx.params, { extras: ctx.extras });
30
+ return {
31
+ results,
32
+ meta
33
+ };
34
+ }
35
+ } : void 0,
36
+ rows: buildRows && rowsReducer ? {
37
+ id,
38
+ requires: rowsRequires,
39
+ build(params, ctx = {}) {
40
+ const queries = buildRows(params, ctx);
41
+ return {
42
+ kind: "rows",
43
+ queries: Object.fromEntries(Object.entries(queries).map(([k, state]) => [k, { state }]))
44
+ };
45
+ },
46
+ reduce(rows, ctx) {
47
+ const { results, meta } = wrap(rowsReducer)(rows, ctx.params, {});
48
+ return {
49
+ results,
50
+ meta
51
+ };
52
+ }
53
+ } : void 0
54
+ };
55
+ }
56
+ function pickSingle(rows) {
57
+ const keys = Object.keys(rows);
58
+ return keys.length === 1 ? rows[keys[0]] : void 0;
59
+ }
60
+ export { defineAnalyzer };
@@ -0,0 +1,17 @@
1
+ import { AnalysisParams, AnalysisResult } from "../analysis-types.mjs";
2
+ import { AnalysisQuerySource } from "../source/source-types.mjs";
3
+ import { RequiredCapability } from "./types.mjs";
4
+ import { EngineError } from "../errors.mjs";
5
+ import { AnalyzerRegistry } from "./registry.mjs";
6
+ declare class AnalyzerCapabilityError extends Error {
7
+ readonly tool: string;
8
+ readonly missing: readonly RequiredCapability[];
9
+ readonly engineError: EngineError;
10
+ constructor(tool: string, missing: readonly RequiredCapability[]);
11
+ }
12
+ /**
13
+ * Run an analyzer against a generic `AnalysisQuerySource`. The registry is
14
+ * an explicit parameter — callers build one via `createAnalyzerRegistry`.
15
+ */
16
+ declare function runAnalyzerFromSource(source: AnalysisQuerySource, params: AnalysisParams, registry: AnalyzerRegistry): Promise<AnalysisResult>;
17
+ export { AnalyzerCapabilityError, runAnalyzerFromSource };
@@ -1,15 +1,5 @@
1
- import { AnalysisParams, AnalysisResult } from "../_chunks/analysis-types.mjs";
2
- import { AnalysisQuerySource, Analyzer, AnalyzerRegistry, AnalyzerRegistryInit, AnalyzerVariants, BuildContext, DefineAnalyzerOptions, DefinedAnalyzer, Plan, ReduceContext, ReduceCtx, Reducer, RequiredCapability, RowQueriesPlan, SqlExtraQuery, SqlPlan, SqlPlanSpec, TypedRowQuery, createAnalyzerRegistry, defineAnalyzer, requireAdapter } from "../_chunks/registry.mjs";
3
- import { EngineError } from "../_chunks/errors.mjs";
4
- declare class AnalyzerCapabilityError extends Error {
5
- readonly tool: string;
6
- readonly missing: readonly RequiredCapability[];
7
- readonly engineError: EngineError;
8
- constructor(tool: string, missing: readonly RequiredCapability[]);
9
- }
10
- /**
11
- * Run an analyzer against a generic `AnalysisQuerySource`. The registry is
12
- * an explicit parameter — callers build one via `createAnalyzerRegistry`.
13
- */
14
- declare function runAnalyzerFromSource(source: AnalysisQuerySource, params: AnalysisParams, registry: AnalyzerRegistry): Promise<AnalysisResult>;
1
+ import { Analyzer, BuildContext, Plan, ReduceContext, RequiredCapability, RowQueriesPlan, SqlExtraQuery, SqlPlan, TypedRowQuery, requireAdapter } from "./types.mjs";
2
+ import { DefineAnalyzerOptions, DefinedAnalyzer, ReduceCtx, Reducer, SqlPlanSpec, defineAnalyzer } from "./define.mjs";
3
+ import { AnalyzerRegistry, AnalyzerRegistryInit, AnalyzerVariants, createAnalyzerRegistry } from "./registry.mjs";
4
+ import { AnalyzerCapabilityError, runAnalyzerFromSource } from "./dispatch.mjs";
15
5
  export { type Analyzer, AnalyzerCapabilityError, type AnalyzerRegistry, type AnalyzerRegistryInit, type AnalyzerVariants, type BuildContext, type DefineAnalyzerOptions, type DefinedAnalyzer, type Plan, type ReduceContext, type ReduceCtx, type Reducer, type RequiredCapability, type RowQueriesPlan, type SqlExtraQuery, type SqlPlan, type SqlPlanSpec, type TypedRowQuery, createAnalyzerRegistry, defineAnalyzer, requireAdapter, runAnalyzerFromSource };
@@ -1,113 +1,5 @@
1
- import { AnalyzerCapabilityError, runAnalyzerFromSource } from "../_chunks/dispatch.mjs";
2
- const DEFAULT_SQL_REQUIRES = ["executeSql", "fileSets"];
3
- function defineAnalyzer(opts) {
4
- const { id, reduce, reduceSql, reduceRows, buildSql, buildRows, sqlRequires = DEFAULT_SQL_REQUIRES, rowsRequires = [] } = opts;
5
- const sqlReducer = reduceSql ?? reduce;
6
- const rowsReducer = reduceRows ?? reduce;
7
- if (buildSql && !sqlReducer) throw new Error(`defineAnalyzer(${id}): buildSql requires reduce or reduceSql`);
8
- if (buildRows && !rowsReducer) throw new Error(`defineAnalyzer(${id}): buildRows requires reduce or reduceRows`);
9
- const wrap = (fn) => (rows, params, ctx) => {
10
- return fn(Array.isArray(rows) ? rows : pickSingle(rows) ?? rows, params, ctx);
11
- };
12
- return {
13
- id,
14
- sql: buildSql && sqlReducer ? {
15
- id,
16
- requires: sqlRequires,
17
- build(params, ctx = {}) {
18
- const spec = buildSql(params, ctx);
19
- return {
20
- kind: "sql",
21
- sql: spec.sql,
22
- params: spec.params,
23
- current: spec.current,
24
- previous: spec.previous,
25
- extraFiles: spec.extraFiles,
26
- extraQueries: spec.extraQueries
27
- };
28
- },
29
- reduce(rows, ctx) {
30
- const { results, meta } = wrap(sqlReducer)(rows, ctx.params, { extras: ctx.extras });
31
- return {
32
- results,
33
- meta
34
- };
35
- }
36
- } : void 0,
37
- rows: buildRows && rowsReducer ? {
38
- id,
39
- requires: rowsRequires,
40
- build(params, ctx = {}) {
41
- const queries = buildRows(params, ctx);
42
- return {
43
- kind: "rows",
44
- queries: Object.fromEntries(Object.entries(queries).map(([k, state]) => [k, { state }]))
45
- };
46
- },
47
- reduce(rows, ctx) {
48
- const { results, meta } = wrap(rowsReducer)(rows, ctx.params, {});
49
- return {
50
- results,
51
- meta
52
- };
53
- }
54
- } : void 0
55
- };
56
- }
57
- function pickSingle(rows) {
58
- const keys = Object.keys(rows);
59
- return keys.length === 1 ? rows[keys[0]] : void 0;
60
- }
61
- function createAnalyzerRegistry(init = {}) {
62
- const byId = /* @__PURE__ */ new Map();
63
- for (const d of init.defined ?? []) {
64
- const entry = byId.get(d.id) ?? {};
65
- if (d.sql) entry.sql = d.sql;
66
- if (d.rows) entry.rows = d.rows;
67
- byId.set(d.id, entry);
68
- }
69
- for (const a of init.rows ?? []) {
70
- const entry = byId.get(a.id) ?? {};
71
- entry.rows = a;
72
- byId.set(a.id, entry);
73
- }
74
- for (const a of init.sql ?? []) {
75
- const entry = byId.get(a.id) ?? {};
76
- entry.sql = a;
77
- byId.set(a.id, entry);
78
- }
79
- const listAnalyzerIds = () => [...byId.keys()].sort();
80
- const getAnalyzerVariants = (id) => byId.get(id);
81
- const resolveAnalyzer = (id, sourceSupportsSql) => {
82
- const variants = byId.get(id);
83
- if (!variants) return void 0;
84
- if (sourceSupportsSql) return variants.sql ?? variants.rows;
85
- return variants.rows;
86
- };
87
- const listAnalyzersFor = (sourceSupportsSql) => {
88
- const out = [];
89
- for (const id of listAnalyzerIds()) {
90
- const a = resolveAnalyzer(id, sourceSupportsSql);
91
- if (a) out.push(a);
92
- }
93
- return out;
94
- };
95
- const listAnalyzerIdsFor = (source) => {
96
- const sourceSupportsSql = typeof source.executeSql === "function";
97
- const out = [];
98
- for (const id of listAnalyzerIds()) if (resolveAnalyzer(id, sourceSupportsSql)) out.push(id);
99
- return out;
100
- };
101
- return {
102
- listAnalyzerIds,
103
- getAnalyzerVariants,
104
- resolveAnalyzer,
105
- listAnalyzersFor,
106
- listAnalyzerIdsFor
107
- };
108
- }
109
- function requireAdapter(ctx, analyzerId) {
110
- if (!ctx.adapter) throw new Error(`analyzer "${analyzerId}": BuildContext.adapter missing — declare 'adapter' in sqlRequires/rowsRequires`);
111
- return ctx.adapter;
112
- }
1
+ import { defineAnalyzer } from "./define.mjs";
2
+ import { AnalyzerCapabilityError, runAnalyzerFromSource } from "./dispatch.mjs";
3
+ import { createAnalyzerRegistry } from "./registry.mjs";
4
+ import { requireAdapter } from "./types.mjs";
113
5
  export { AnalyzerCapabilityError, createAnalyzerRegistry, defineAnalyzer, requireAdapter, runAnalyzerFromSource };
@@ -0,0 +1,33 @@
1
+ import { Analyzer } from "./types.mjs";
2
+ import { DefinedAnalyzer } from "./define.mjs";
3
+ interface AnalyzerVariants {
4
+ sql?: Analyzer;
5
+ rows?: Analyzer;
6
+ }
7
+ interface AnalyzerRegistryInit {
8
+ /**
9
+ * Preferred for in-tree composition: pass `DefinedAnalyzer[]` directly so
10
+ * SQL/row variants can never drift apart from their `defineAnalyzer` site.
11
+ */
12
+ defined?: readonly DefinedAnalyzer[];
13
+ /** Flat-array path retained for narrow tree-shaken registry composition. */
14
+ rows?: readonly Analyzer[];
15
+ /** Flat-array path retained for narrow tree-shaken registry composition. */
16
+ sql?: readonly Analyzer[];
17
+ }
18
+ interface AnalyzerRegistry {
19
+ listAnalyzerIds: () => readonly string[];
20
+ getAnalyzerVariants: (id: string) => AnalyzerVariants | undefined;
21
+ resolveAnalyzer: (id: string, sourceSupportsSql: boolean) => Analyzer | undefined;
22
+ listAnalyzersFor: (sourceSupportsSql: boolean) => readonly Analyzer[];
23
+ listAnalyzerIdsFor: (source: {
24
+ executeSql?: unknown;
25
+ }) => readonly string[];
26
+ }
27
+ /**
28
+ * Build an immutable registry from collections of row / SQL analyzers.
29
+ * No global state; call this once per logical use (typically at startup
30
+ * or per-request in a worker).
31
+ */
32
+ declare function createAnalyzerRegistry(init?: AnalyzerRegistryInit): AnalyzerRegistry;
33
+ export { AnalyzerRegistry, AnalyzerRegistryInit, AnalyzerVariants, createAnalyzerRegistry };
@@ -0,0 +1,49 @@
1
+ function createAnalyzerRegistry(init = {}) {
2
+ const byId = /* @__PURE__ */ new Map();
3
+ for (const d of init.defined ?? []) {
4
+ const entry = byId.get(d.id) ?? {};
5
+ if (d.sql) entry.sql = d.sql;
6
+ if (d.rows) entry.rows = d.rows;
7
+ byId.set(d.id, entry);
8
+ }
9
+ for (const a of init.rows ?? []) {
10
+ const entry = byId.get(a.id) ?? {};
11
+ entry.rows = a;
12
+ byId.set(a.id, entry);
13
+ }
14
+ for (const a of init.sql ?? []) {
15
+ const entry = byId.get(a.id) ?? {};
16
+ entry.sql = a;
17
+ byId.set(a.id, entry);
18
+ }
19
+ const listAnalyzerIds = () => [...byId.keys()].sort();
20
+ const getAnalyzerVariants = (id) => byId.get(id);
21
+ const resolveAnalyzer = (id, sourceSupportsSql) => {
22
+ const variants = byId.get(id);
23
+ if (!variants) return void 0;
24
+ if (sourceSupportsSql) return variants.sql ?? variants.rows;
25
+ return variants.rows;
26
+ };
27
+ const listAnalyzersFor = (sourceSupportsSql) => {
28
+ const out = [];
29
+ for (const id of listAnalyzerIds()) {
30
+ const a = resolveAnalyzer(id, sourceSupportsSql);
31
+ if (a) out.push(a);
32
+ }
33
+ return out;
34
+ };
35
+ const listAnalyzerIdsFor = (source) => {
36
+ const sourceSupportsSql = typeof source.executeSql === "function";
37
+ const out = [];
38
+ for (const id of listAnalyzerIds()) if (resolveAnalyzer(id, sourceSupportsSql)) out.push(id);
39
+ return out;
40
+ };
41
+ return {
42
+ listAnalyzerIds,
43
+ getAnalyzerVariants,
44
+ resolveAnalyzer,
45
+ listAnalyzersFor,
46
+ listAnalyzerIdsFor
47
+ };
48
+ }
49
+ export { createAnalyzerRegistry };
@@ -0,0 +1,95 @@
1
+ import { Row } from "../storage.mjs";
2
+ import { AnalysisParams } from "../analysis-types.mjs";
3
+ import { ResolverAdapter } from "../resolver/types.mjs";
4
+ import { FileSet, SourceCapabilities } from "../source/source-types.mjs";
5
+ import { BuilderState } from "gscdump/query";
6
+ /**
7
+ * Capabilities a Plan may require of its host. Dispatch matches `requires`
8
+ * against the source's declared `capabilities` (and the presence of
9
+ * `executeSql`) and rejects mismatches.
10
+ *
11
+ * `'executeSql'` checks for the method on the source; the rest are flag keys
12
+ * on `SourceCapabilities`. Single source of truth — adding a new capability
13
+ * is one line in `SourceCapabilities`.
14
+ */
15
+ type RequiredCapability = 'executeSql' | keyof SourceCapabilities;
16
+ interface SqlExtraQuery {
17
+ name: string;
18
+ sql: string;
19
+ params: unknown[];
20
+ }
21
+ /**
22
+ * SQL-native plan: SQL string + placeholders, with optional extra file sets
23
+ * and follow-up queries.
24
+ */
25
+ interface SqlPlan {
26
+ kind: 'sql';
27
+ sql: string;
28
+ params: unknown[];
29
+ current: FileSet;
30
+ previous?: FileSet;
31
+ extraFiles?: Record<string, FileSet>;
32
+ extraQueries?: SqlExtraQuery[];
33
+ }
34
+ interface TypedRowQuery<T extends Row = Row> {
35
+ state: BuilderState;
36
+ /** Optional type tag for downstream narrowing. */
37
+ rowType?: (row: Row) => T;
38
+ }
39
+ /**
40
+ * Row-queries plan: a named set of typed `BuilderState` queries. A portable
41
+ * dispatcher runs each against a source's `queryRows` and hands the row
42
+ * collection to `reduce`.
43
+ */
44
+ interface RowQueriesPlan {
45
+ kind: 'rows';
46
+ queries: Record<string, TypedRowQuery>;
47
+ }
48
+ type Plan = SqlPlan | RowQueriesPlan;
49
+ /**
50
+ * Plan-build context. Surfaced from the source at dispatch time so analyzers
51
+ * that compose SQL from a typed `BuilderState` can pick up the right dialect
52
+ * adapter without importing one directly. Most SQL analyzers emit static SQL
53
+ * and ignore this; only the BuilderState-driven `data-query` / `data-detail`
54
+ * analyzers consume it today.
55
+ *
56
+ * `adapter` is optional on the type; analyzers that need it should call
57
+ * `requireAdapter(ctx, id)` rather than non-null-asserting. Capability
58
+ * declaration (`'adapter'` in `requires`) is the runtime guarantee; the
59
+ * helper makes the failure mode loud if the contract is broken.
60
+ */
61
+ interface BuildContext {
62
+ adapter?: ResolverAdapter<any>;
63
+ siteId?: string | number;
64
+ }
65
+ /**
66
+ * Throw a uniform error if a SQL analyzer declared the `'adapter'` capability
67
+ * but the dispatcher handed it a context without one. Centralizes the assert
68
+ * so analyzers don't repeat `ctx.adapter!` with explanatory comments.
69
+ */
70
+ declare function requireAdapter(ctx: BuildContext, analyzerId: string): ResolverAdapter<any>;
71
+ interface ReduceContext<TRow extends Row = Row> {
72
+ params: AnalysisParams;
73
+ /** Extra SQL-query results keyed by `SqlExtraQuery.name`. */
74
+ extras?: Record<string, TRow[]>;
75
+ }
76
+ /**
77
+ * Unified analyzer contract. `TRow` lets authors narrow from the default
78
+ * `Row = Record<string, unknown>` to a typed row shape (e.g. `QueriesRow`)
79
+ * when their reducer assumes specific columns exist — catches drift between
80
+ * `build` (SELECT list) and `reduce` (column access) at compile time.
81
+ */
82
+ interface Analyzer<P extends AnalysisParams = AnalysisParams, R = unknown, TRow extends Row = Row> {
83
+ /** Stable tool id (e.g. `striking-distance`, `opportunity`). */
84
+ id: string;
85
+ /** Capabilities a host source must provide. */
86
+ requires: readonly RequiredCapability[];
87
+ /** Pure: params → plan. Snapshot-testable. `ctx` carries the source's dialect adapter when one is available. */
88
+ build: (params: P, ctx?: BuildContext) => Plan;
89
+ /** Pure: rows + context → typed result + meta. */
90
+ reduce: (rows: TRow[] | Record<string, TRow[]>, ctx: ReduceContext<TRow>) => {
91
+ results: R;
92
+ meta?: Record<string, unknown>;
93
+ };
94
+ }
95
+ export { Analyzer, BuildContext, Plan, ReduceContext, RequiredCapability, RowQueriesPlan, SqlExtraQuery, SqlPlan, TypedRowQuery, requireAdapter };
@@ -0,0 +1,5 @@
1
+ function requireAdapter(ctx, analyzerId) {
2
+ if (!ctx.adapter) throw new Error(`analyzer "${analyzerId}": BuildContext.adapter missing — declare 'adapter' in sqlRequires/rowsRequires`);
3
+ return ctx.adapter;
4
+ }
5
+ export { requireAdapter };
@@ -0,0 +1,4 @@
1
+ import { Row } from "@gscdump/contracts";
2
+ declare function coerceRow(row: Row): Row;
3
+ declare function coerceRows(rows: readonly Row[]): Row[];
4
+ export { coerceRow, coerceRows };
@@ -0,0 +1,14 @@
1
+ import "./storage.mjs";
2
+ /**
3
+ * Per-tier age threshold in days. Default ladder collapses on these gates:
4
+ * - raw → d7 once a daily file is older than `raw` days (default 7).
5
+ * - d7 → d30 once the entire weekly bucket sits behind `d7` days (default 30).
6
+ * - d30 → d90 once the entire monthly bucket sits behind `d30` days (default 90).
7
+ */
8
+ interface CompactionThresholds {
9
+ raw?: number;
10
+ d7?: number;
11
+ d30?: number;
12
+ }
13
+ declare function enumeratePartitions(startDate: string, endDate: string): string[];
14
+ export { CompactionThresholds, enumeratePartitions };
@@ -1,8 +1,6 @@
1
1
  import { dayPartition, inferSearchType, mondayOfWeek, monthPartition, objectKey, quarterOfMonth, quarterPartition, weekPartition } from "./layout.mjs";
2
- import { currentSchemaVersion, dimensionToColumn } from "./schema.mjs";
3
- import { METRIC_EXPR, escapeLike, topLevelPagePredicateSql } from "../sql-fragments.mjs";
2
+ import { currentSchemaVersion } from "./schema.mjs";
4
3
  import { MS_PER_DAY } from "gscdump/dates";
5
- import { buildLogicalPlan } from "gscdump/query/plan";
6
4
  const DAILY_PARTITION_RE = /^daily\/(\d{4}-\d{2}-\d{2})$/;
7
5
  const WEEKLY_PARTITION_RE = /^weekly\/(\d{4}-\d{2}-\d{2})$/;
8
6
  const MONTHLY_PARTITION_RE = /^monthly\/(\d{4}-\d{2})$/;
@@ -247,138 +245,4 @@ function quarterEndMs(quarter) {
247
245
  const q = Number(qStr);
248
246
  return Date.UTC(y, q * 3, 0, 23, 59, 59, 999);
249
247
  }
250
- const FILES_PLACEHOLDER = "{{FILES}}";
251
- function buildDimensionWhere(filters, table) {
252
- const clauses = [];
253
- const params = [];
254
- for (const filter of filters) {
255
- const column = dimensionToColumn(filter.dimension, table);
256
- switch (filter.operator) {
257
- case "equals":
258
- clauses.push(`${column} = ?`);
259
- params.push(filter.expression);
260
- break;
261
- case "notEquals":
262
- clauses.push(`${column} != ?`);
263
- params.push(filter.expression);
264
- break;
265
- case "contains":
266
- clauses.push(`${column} LIKE ? ESCAPE '\\'`);
267
- params.push(`%${escapeLike(filter.expression)}%`);
268
- break;
269
- case "notContains":
270
- clauses.push(`${column} NOT LIKE ? ESCAPE '\\'`);
271
- params.push(`%${escapeLike(filter.expression)}%`);
272
- break;
273
- case "includingRegex":
274
- clauses.push(`regexp_matches(${column}, ?)`);
275
- params.push(filter.expression);
276
- break;
277
- case "excludingRegex":
278
- clauses.push(`NOT regexp_matches(${column}, ?)`);
279
- params.push(filter.expression);
280
- break;
281
- }
282
- }
283
- return {
284
- clause: clauses.join(" AND "),
285
- params
286
- };
287
- }
288
- function buildTopLevelWhere(plan, table) {
289
- if (!plan.specialFilters.topLevel) return "";
290
- return topLevelPagePredicateSql(dimensionToColumn("page", table));
291
- }
292
- function buildHaving(filters) {
293
- if (filters.length === 0) return {
294
- clause: "",
295
- params: []
296
- };
297
- const clauses = [];
298
- const params = [];
299
- for (const filter of filters) {
300
- const expr = METRIC_EXPR[filter.metric];
301
- switch (filter.operator) {
302
- case "metricGte":
303
- clauses.push(`${expr} >= ?`);
304
- params.push(filter.expression);
305
- break;
306
- case "metricGt":
307
- clauses.push(`${expr} > ?`);
308
- params.push(filter.expression);
309
- break;
310
- case "metricLte":
311
- clauses.push(`${expr} <= ?`);
312
- params.push(filter.expression);
313
- break;
314
- case "metricLt":
315
- clauses.push(`${expr} < ?`);
316
- params.push(filter.expression);
317
- break;
318
- case "metricBetween":
319
- clauses.push(`${expr} >= ? AND ${expr} <= ?`);
320
- params.push(filter.expression, filter.expression2 ?? filter.expression);
321
- break;
322
- }
323
- }
324
- return {
325
- clause: clauses.length > 0 ? `HAVING ${clauses.join(" AND ")}` : "",
326
- params
327
- };
328
- }
329
- function compileLogicalQueryPlan(plan, table = plan.dataset) {
330
- const partitions = enumeratePartitions(plan.dateRange.startDate, plan.dateRange.endDate);
331
- const metricSelects = plan.metrics.map((metric) => `${METRIC_EXPR[metric]} AS ${metric}`);
332
- const dimSelects = plan.groupByDimensions.map((dimension) => {
333
- const column = dimensionToColumn(dimension, table);
334
- return column !== dimension ? `${column} AS ${dimension}` : dimension;
335
- });
336
- const whereClauses = ["date >= ?", "date <= ?"];
337
- const whereParams = [plan.dateRange.startDate, plan.dateRange.endDate];
338
- const dimWhere = buildDimensionWhere(plan.dimensionFilters, table);
339
- if (dimWhere.clause) {
340
- whereClauses.push(dimWhere.clause);
341
- whereParams.push(...dimWhere.params);
342
- }
343
- const topLevelClause = buildTopLevelWhere(plan, table);
344
- if (topLevelClause) whereClauses.push(topLevelClause);
345
- const having = buildHaving(plan.metricFilters);
346
- const groupByCols = [...plan.groupByDimensions.map((dimension) => dimensionToColumn(dimension, table)), ...plan.hasDate ? ["date"] : []];
347
- const groupBy = groupByCols.length > 0 ? `GROUP BY ${groupByCols.join(", ")}` : "";
348
- const orderBy = plan.orderBy ? `ORDER BY ${plan.orderBy.column} ${plan.orderBy.dir.toUpperCase()}` : "ORDER BY clicks DESC";
349
- const limit = `LIMIT ${plan.rowLimit ?? 1e3}`;
350
- const offset = plan.startRow ? `OFFSET ${plan.startRow}` : "";
351
- return {
352
- sql: [
353
- `SELECT ${[
354
- ...dimSelects,
355
- ...plan.hasDate ? ["date"] : [],
356
- ...metricSelects
357
- ].join(", ")}`,
358
- `FROM read_parquet(${FILES_PLACEHOLDER}, union_by_name = true)`,
359
- `WHERE ${whereClauses.join(" AND ")}`,
360
- groupBy,
361
- having.clause,
362
- orderBy,
363
- limit,
364
- offset
365
- ].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(),
366
- params: [...whereParams, ...having.params],
367
- partitions,
368
- table,
369
- filesPlaceholder: FILES_PLACEHOLDER
370
- };
371
- }
372
- function resolveParquetSQL(state, table) {
373
- const plan = buildLogicalPlan(state, { regex: true });
374
- return compileLogicalQueryPlan(plan, table ?? plan.dataset);
375
- }
376
- function fileList(keys) {
377
- return keys.length === 0 ? "[]" : `[${keys.map((key) => `'${key.replace(/'/g, "''")}'`).join(", ")}]`;
378
- }
379
- function substituteNamedFiles(sql, sets) {
380
- let out = sql;
381
- for (const [name, keys] of Object.entries(sets)) out = out.replace(new RegExp(`\\{\\{${name}\\}\\}`, "g"), fileList(keys));
382
- return out;
383
- }
384
- export { FILES_PLACEHOLDER, compactTieredImpl, compileLogicalQueryPlan, dedupeOverlappingTiers, enumeratePartitions, resolveParquetSQL, splitOverlappingTiers, substituteNamedFiles };
248
+ export { compactTieredImpl, dedupeOverlappingTiers, enumeratePartitions, splitOverlappingTiers };
@@ -1,3 +1,2 @@
1
- import { CodecCtx, CompactionTier, DataSource, EngineOptions, FileSetRef, GcCtx, ListLiveFilter, LockScope, ManifestEntry, ManifestStore, ParquetCodec, QueryCtx, QueryExecuteOptions, QueryExecuteResult, QueryExecutor, QueryResult, Row, RunSQLOptions, SearchType, StorageEngine, SyncState, SyncStateDetail, SyncStateFilter, SyncStateKind, SyncStateScope, TableName, TenantCtx, Watermark, WatermarkFilter, WatermarkScope, WriteCtx, WriteResult } from "./_chunks/storage.mjs";
2
- import "./_chunks/contracts.mjs";
1
+ import { CodecCtx, CompactionTier, DataSource, EngineOptions, FileSetRef, GcCtx, ListLiveFilter, LockScope, ManifestEntry, ManifestStore, ParquetCodec, QueryCtx, QueryExecuteOptions, QueryExecuteResult, QueryExecutor, QueryResult, Row, RunSQLOptions, SearchType, StorageEngine, SyncState, SyncStateDetail, SyncStateFilter, SyncStateKind, SyncStateScope, TableName, TenantCtx, Watermark, WatermarkFilter, WatermarkScope, WriteCtx, WriteResult } from "./storage.mjs";
3
2
  export type { CodecCtx, CompactionTier, DataSource, EngineOptions, FileSetRef, GcCtx, ListLiveFilter, LockScope, ManifestEntry, ManifestStore, ParquetCodec, QueryCtx, QueryExecuteOptions, QueryExecuteResult, QueryExecutor, QueryResult, Row, RunSQLOptions, SearchType, StorageEngine, SyncState, SyncStateDetail, SyncStateFilter, SyncStateKind, SyncStateScope, TableName, TenantCtx, Watermark, WatermarkFilter, WatermarkScope, WriteCtx, WriteResult };
@@ -1,4 +1,4 @@
1
- import { ColumnDef, ColumnType, Row, TableName, TableSchema, TableSchema as TableSchema$1 } from "@gscdump/contracts";
1
+ import { TableName } from "@gscdump/contracts";
2
2
  declare const pages: import("drizzle-orm/pg-core").PgTableWithColumns<{
3
3
  name: "pages";
4
4
  schema: undefined;
@@ -2113,36 +2113,4 @@ declare const TABLE_METADATA: Record<TableName, {
2113
2113
  clusterKey: string[];
2114
2114
  version: number;
2115
2115
  }>;
2116
- declare const SCHEMAS: Record<TableName, TableSchema>;
2117
- declare function currentSchemaVersion(table: TableName): number;
2118
- /**
2119
- * DATE column names for a table. The single schema-derived source every read
2120
- * path uses to build the legacy-VARCHAR date canonicalization (see
2121
- * `dateReplaceClause` in `./sql-fragments`), so the engine codec and the CLI
2122
- * `dump`/`export` commands agree on which columns to cast.
2123
- */
2124
- declare function dateColumnsFor(table: TableName): string[];
2125
- declare function allTables(): readonly TableName[];
2126
- declare function inferTable(dimensions: readonly string[]): TableName;
2127
- /**
2128
- * Natural-key columns for a table: the `sortKey` dimensions that uniquely
2129
- * identify a metric row (e.g. `['date', 'url']` for `pages`).
2130
- */
2131
- declare function naturalKeyColumns(table: TableName): readonly string[];
2132
- /**
2133
- * Collapse rows that share a natural key (see {@link naturalKeyColumns}) to a
2134
- * single survivor.
2135
- *
2136
- * Correct write and compaction inputs never collide on the natural key — each
2137
- * (date, dimension) tuple is produced exactly once per slice — so on healthy
2138
- * data this is a no-op. It exists as a recurrence guard: the 2026-04 monthly
2139
- * compaction corruption folded a complete month back on top of its own daily
2140
- * inputs, doubling every row. Absorbing duplicates at every write/compaction
2141
- * boundary keeps that class of bug from inflating impressions downstream.
2142
- *
2143
- * Last occurrence wins. Observed duplicates are byte-identical, so the choice
2144
- * of survivor is immaterial.
2145
- */
2146
- declare function dedupeByNaturalKey(table: TableName, rows: readonly Row[]): Row[];
2147
- declare function dimensionToColumn(dim: string, _table: TableName): string;
2148
- export { type ColumnDef, type ColumnType, DrizzleSchema, SCHEMAS, TABLE_METADATA, type TableSchema$1 as TableSchema, allTables, countries, currentSchemaVersion, dateColumnsFor, dates, dedupeByNaturalKey, dimensionToColumn, drizzleSchema, hourly_pages, inferTable, naturalKeyColumns, page_queries, pages, queries, search_appearance, search_appearance_page_queries, search_appearance_pages, search_appearance_queries };
2116
+ export { DrizzleSchema, TABLE_METADATA, countries, dates, drizzleSchema, hourly_pages, page_queries, pages, queries, search_appearance, search_appearance_page_queries, search_appearance_pages, search_appearance_queries };