@gscdump/engine 1.3.2 → 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} +22 -54
  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,172 @@
1
+ import { SearchType as SearchType$1, TableName as TableName$1 } from "../storage.mjs";
2
+ import { ComparisonFilter } from "./types.mjs";
3
+ import { BuilderState } from "gscdump/query";
4
+ import { Grain } from "@gscdump/contracts";
5
+ interface RunQueryCtx {
6
+ userId: string;
7
+ siteId: string;
8
+ table: TableName$1;
9
+ searchType?: SearchType$1;
10
+ /**
11
+ * Temporal granularity. `'day'` (default) drives `enumeratePartitions` to
12
+ * emit `daily/{date}` only; hourly partitions are skipped by construction.
13
+ * `'hour'` is reserved for hourly read paths and must use the dedicated
14
+ * hourly query surface (callers pass `partitions: [hourly/{date}]`
15
+ * directly through `runSQL`).
16
+ */
17
+ grain?: Grain;
18
+ }
19
+ interface RunSQLFn {
20
+ (opts: {
21
+ ctx: {
22
+ userId: string;
23
+ siteId: string;
24
+ };
25
+ table: TableName$1;
26
+ fileSets: Record<string, {
27
+ table: TableName$1;
28
+ partitions?: string[];
29
+ keys?: string[];
30
+ }>;
31
+ sql: string;
32
+ params: unknown[];
33
+ searchType?: SearchType$1;
34
+ }): Promise<{
35
+ rows: Array<Record<string, unknown>>;
36
+ }>;
37
+ }
38
+ interface CanonicalQueryDimSource {
39
+ /** Object keys for the versioned query_dim parquet. */
40
+ keys: string[];
41
+ normalizerVersion: number;
42
+ intentVersion?: number;
43
+ builtAt?: number;
44
+ }
45
+ interface PrimaryColumnarSource {
46
+ /** Pre-resolved compacted/Iceberg parquet object keys for the requested fact table. */
47
+ keys: string[];
48
+ /** Oldest covered date (`YYYY-MM-DD`). Omit to assert the source covers all older dates. */
49
+ coversFrom?: string;
50
+ /** Newest covered date (`YYYY-MM-DD`). Omit to assert the source covers the current tail. */
51
+ coversThrough?: string;
52
+ }
53
+ /**
54
+ * Optional overlay that serves a resolver extra (e.g. canonical-variant
55
+ * grouping, keyed `'canonicalExtras'`) from a precomputed source — typically a
56
+ * materialised rollup — instead of the live window-function SQL. Return the
57
+ * rows in the exact shape the live extra produces (`mergeExtras` consumes
58
+ * either source unchanged), or `null` to decline so the caller falls back to
59
+ * the live query. Pure seam: storage/tenant routing lives in the host's
60
+ * implementation, not here. See ADR-0017.
61
+ */
62
+ interface ResolveExtraFn {
63
+ (opts: {
64
+ key: string;
65
+ state: BuilderState;
66
+ ctx: RunQueryCtx;
67
+ dateRange: {
68
+ startDate: string;
69
+ endDate: string;
70
+ };
71
+ }): Promise<Array<Record<string, unknown>> | null>;
72
+ }
73
+ interface RunOptimizedQueryOptions {
74
+ /** Overlay tried per extra before the live SQL; absent → today's live path. */
75
+ resolveExtra?: ResolveExtraFn;
76
+ /**
77
+ * Versioned query dimension backing canonical reads over fact rows. Required
78
+ * whenever a query groups or filters by `queryCanonical`; a canonical rollup
79
+ * source may carry the same metadata/key set via `canonicalSource.queryDim`.
80
+ */
81
+ queryDim?: CanonicalQueryDimSource;
82
+ /**
83
+ * Primary fact-file source for consumer reads. Callers pass compacted or
84
+ * Iceberg data-file keys with explicit coverage metadata; raw daily
85
+ * partitions are only used when `primarySourceFallback: 'raw'` is set.
86
+ */
87
+ primarySource?: PrimaryColumnarSource;
88
+ /**
89
+ * Explicit compatibility escape hatch for raw daily shards. Default is
90
+ * strict: missing/empty/stale primary coverage fails with
91
+ * `QuerySourceCoverageError`.
92
+ */
93
+ primarySourceFallback?: 'raw';
94
+ /**
95
+ * Opt-in canonical-primary performance (ADR-0018 Gap 2): object keys of the
96
+ * `query_canonical_daily` rollup parquet(s). When supplied AND the query is
97
+ * coverable (`canonicalRollupCovers`) AND the window is within the rollup's
98
+ * coverage, the MAIN query reads these
99
+ * pre-summed `(query_canonical × date)` rows instead of re-aggregating raw
100
+ * partitions. Variant extras still need fact-grain rows, so they read
101
+ * `primarySource` when present and raw partitions only via
102
+ * `primarySourceFallback: 'raw'`.
103
+ *
104
+ * `coversThrough` (ISO `YYYY-MM-DD`, the rollup's newest covered date) gates
105
+ * staleness: the source is used only when `dateRange.endDate <= coversThrough`,
106
+ * else strict mode fails so the recent tail is never silently undercounted.
107
+ * Omit to assert full coverage (use with care).
108
+ */
109
+ canonicalSource?: {
110
+ keys: string[];
111
+ coversThrough?: string;
112
+ queryDim?: CanonicalQueryDimSource;
113
+ };
114
+ /** Optional version gates for the query dimension backing `canonicalSource`. */
115
+ canonicalRequirements?: {
116
+ normalizerVersion?: number;
117
+ intentVersion?: number;
118
+ };
119
+ }
120
+ type QuerySourceKind = 'canonical-rollup' | 'primary-columnar' | 'raw-partitions';
121
+ type QuerySourceFallbackKind = 'primary-source-missing' | 'primary-source-empty' | 'primary-source-missing-coverage' | 'primary-source-stale-coverage' | 'canonical-source-missing' | 'canonical-source-empty' | 'canonical-source-not-coverable' | 'canonical-source-stale-coverage' | 'query-dim-missing' | 'query-dim-empty' | 'query-dim-stale-version';
122
+ interface QuerySourceFallback {
123
+ kind: QuerySourceFallbackKind;
124
+ message: string;
125
+ }
126
+ interface QuerySourceDecision {
127
+ kind: QuerySourceKind;
128
+ fallback?: QuerySourceFallback;
129
+ fallbacks?: QuerySourceFallback[];
130
+ }
131
+ declare class QuerySourceCoverageError extends Error {
132
+ readonly fallback: QuerySourceFallback;
133
+ name: string;
134
+ constructor(fallback: QuerySourceFallback);
135
+ }
136
+ interface OptimizedQueryResult {
137
+ rows: Array<Record<string, unknown>>;
138
+ totalCount: number;
139
+ totals: {
140
+ clicks: number;
141
+ impressions: number;
142
+ ctr: number;
143
+ position: number;
144
+ };
145
+ extras: Array<{
146
+ key: string;
147
+ rows: Array<Record<string, unknown>>;
148
+ }>;
149
+ source: QuerySourceDecision;
150
+ extraSource?: QuerySourceDecision;
151
+ }
152
+ interface ComparisonQueryResult {
153
+ rows: Array<Record<string, unknown>>;
154
+ totalCount: number;
155
+ totals: Record<string, unknown>;
156
+ source: QuerySourceDecision;
157
+ }
158
+ declare function runOptimizedQuery(runSQL: RunSQLFn, ctx: RunQueryCtx, state: BuilderState, dateRange: {
159
+ startDate: string;
160
+ endDate: string;
161
+ }, options?: RunOptimizedQueryOptions): Promise<OptimizedQueryResult>;
162
+ declare function runComparisonQuery(runSQL: RunSQLFn, ctx: RunQueryCtx, current: BuilderState, previous: BuilderState, windows: {
163
+ current: {
164
+ startDate: string;
165
+ endDate: string;
166
+ };
167
+ previous: {
168
+ startDate: string;
169
+ endDate: string;
170
+ };
171
+ }, filter?: ComparisonFilter, options?: RunOptimizedQueryOptions): Promise<ComparisonQueryResult>;
172
+ export { CanonicalQueryDimSource, ComparisonQueryResult, OptimizedQueryResult, PrimaryColumnarSource, QuerySourceCoverageError, QuerySourceDecision, QuerySourceFallback, QuerySourceFallbackKind, QuerySourceKind, ResolveExtraFn, RunOptimizedQueryOptions, RunQueryCtx, RunSQLFn, runComparisonQuery, runOptimizedQuery };
@@ -0,0 +1,241 @@
1
+ import { enumeratePartitions } from "../compaction.mjs";
2
+ import "../planner.mjs";
3
+ import { canonicalRollupCovers } from "./canonical-source.mjs";
4
+ import { buildExtrasQueries, buildTotalsSql, resolveComparisonSQL, resolveToSQLOptimized } from "./compile.mjs";
5
+ import { createParquetResolverAdapter } from "./pg-adapter.mjs";
6
+ import { buildLogicalPlan } from "gscdump/query/plan";
7
+ var QuerySourceCoverageError = class extends Error {
8
+ fallback;
9
+ name = "QuerySourceCoverageError";
10
+ constructor(fallback) {
11
+ super(fallback.message);
12
+ this.fallback = fallback;
13
+ }
14
+ };
15
+ function canonicalSourceWithinCoverage(source, windowEnd) {
16
+ return source.coversThrough === void 0 || windowEnd <= source.coversThrough;
17
+ }
18
+ function querySourceDecision(kind, fallbacks = []) {
19
+ const first = fallbacks[0];
20
+ return {
21
+ kind,
22
+ ...first ? {
23
+ fallback: first,
24
+ fallbacks
25
+ } : {}
26
+ };
27
+ }
28
+ function canonicalFeatureRequested(state, capabilities) {
29
+ const plan = buildLogicalPlan(state, capabilities);
30
+ return plan.groupByDimensions.includes("queryCanonical") || plan.dimensionFilters.some((f) => f.dimension === "queryCanonical");
31
+ }
32
+ function fallback(kind, message) {
33
+ return {
34
+ kind,
35
+ message
36
+ };
37
+ }
38
+ function staleQueryDim(source, requirements) {
39
+ if (requirements?.normalizerVersion !== void 0 && source.normalizerVersion !== requirements.normalizerVersion) return fallback("query-dim-stale-version", `canonical query dimension normalizer v${source.normalizerVersion} does not match required v${requirements.normalizerVersion}`);
40
+ if (requirements?.intentVersion !== void 0 && source.intentVersion !== requirements.intentVersion) return fallback("query-dim-stale-version", `canonical query dimension intent v${source.intentVersion ?? "missing"} does not match required v${requirements.intentVersion}`);
41
+ }
42
+ function canonicalQueryDim(options) {
43
+ return options.queryDim ?? options.canonicalSource?.queryDim;
44
+ }
45
+ function queryDimMiss(source, requirements) {
46
+ if (!source) return fallback("query-dim-missing", "canonical query requires queryDim; fact tables do not carry query_canonical");
47
+ if (source.keys.length === 0) return fallback("query-dim-empty", "queryDim has no parquet keys; refusing to run canonical query from an empty dimension");
48
+ return staleQueryDim(source, requirements);
49
+ }
50
+ function decideCanonicalSource(state, capabilities, options, windowEnd) {
51
+ if (!canonicalFeatureRequested(state, capabilities)) return querySourceDecision("raw-partitions");
52
+ const dimMiss = queryDimMiss(canonicalQueryDim(options), options.canonicalRequirements);
53
+ if (dimMiss) throw new QuerySourceCoverageError(dimMiss);
54
+ const source = options.canonicalSource;
55
+ const miss = (() => {
56
+ if (!source) return fallback("canonical-source-missing", "canonical rollup source missing; falling back to primary facts joined through query_dim");
57
+ if (source.keys.length === 0) return fallback("canonical-source-empty", "canonicalSource has no parquet keys; falling back to primary facts joined through query_dim");
58
+ if (!canonicalSourceWithinCoverage(source, windowEnd)) return fallback("canonical-source-stale-coverage", `canonicalSource covers through ${source.coversThrough}, but query needs ${windowEnd}`);
59
+ if (!canonicalRollupCovers(state, capabilities)) return fallback("canonical-source-not-coverable", "canonicalSource only covers queryCanonical/date reads without raw-grain filters");
60
+ })();
61
+ if (!miss) return querySourceDecision("canonical-rollup");
62
+ return querySourceDecision("raw-partitions", [miss]);
63
+ }
64
+ function primarySourceMiss(source, dateRange) {
65
+ if (!source) return fallback("primary-source-missing", "primary columnar source is required; pass primarySourceFallback: \"raw\" to use raw daily partitions explicitly");
66
+ if (source.keys.length === 0) return fallback("primary-source-empty", "primarySource has no parquet keys; refusing to return partial or empty data implicitly");
67
+ if (source.coversFrom !== void 0 && dateRange.startDate < source.coversFrom) return fallback("primary-source-missing-coverage", `primarySource covers from ${source.coversFrom}, but query starts ${dateRange.startDate}`);
68
+ if (source.coversThrough !== void 0 && dateRange.endDate > source.coversThrough) return fallback("primary-source-stale-coverage", `primarySource covers through ${source.coversThrough}, but query needs ${dateRange.endDate}`);
69
+ }
70
+ function decidePrimarySource(options, dateRange, priorFallbacks = []) {
71
+ const miss = primarySourceMiss(options.primarySource, dateRange);
72
+ if (!miss) return querySourceDecision("primary-columnar", priorFallbacks);
73
+ const fallbacks = [...priorFallbacks, miss];
74
+ if (options.primarySourceFallback === "raw") return querySourceDecision("raw-partitions", fallbacks);
75
+ throw new QuerySourceCoverageError(miss);
76
+ }
77
+ function sourceFallbacks(source) {
78
+ if (source.fallbacks) return source.fallbacks;
79
+ return source.fallback ? [source.fallback] : [];
80
+ }
81
+ function runArgs(ctx, partitions) {
82
+ return {
83
+ ctx: {
84
+ userId: ctx.userId,
85
+ siteId: ctx.siteId
86
+ },
87
+ table: ctx.table,
88
+ fileSets: { FILES: {
89
+ table: ctx.table,
90
+ partitions
91
+ } },
92
+ ...ctx.searchType !== void 0 ? { searchType: ctx.searchType } : {}
93
+ };
94
+ }
95
+ function primaryRunArgs(ctx, keys) {
96
+ return {
97
+ ctx: {
98
+ userId: ctx.userId,
99
+ siteId: ctx.siteId
100
+ },
101
+ table: ctx.table,
102
+ fileSets: { FILES: {
103
+ table: ctx.table,
104
+ keys
105
+ } },
106
+ ...ctx.searchType !== void 0 ? { searchType: ctx.searchType } : {}
107
+ };
108
+ }
109
+ function withQueryDimFileSet(args, queryDim, enabled) {
110
+ if (!enabled || !queryDim) return args;
111
+ return {
112
+ ...args,
113
+ fileSets: {
114
+ ...args.fileSets,
115
+ QUERY_DIM: {
116
+ table: "queries",
117
+ keys: queryDim.keys
118
+ }
119
+ }
120
+ };
121
+ }
122
+ async function runOptimizedQuery(runSQL, ctx, state, dateRange, options = {}) {
123
+ const base = runArgs(ctx, enumeratePartitions(dateRange.startDate, dateRange.endDate));
124
+ const probe = createParquetResolverAdapter();
125
+ const canonicalRequested = canonicalFeatureRequested(state, probe.capabilities);
126
+ const canonicalDecision = decideCanonicalSource(state, probe.capabilities, options, dateRange.endDate);
127
+ const useCanonicalSource = canonicalDecision.kind === "canonical-rollup";
128
+ const source = useCanonicalSource ? canonicalDecision : decidePrimarySource(options, dateRange, sourceFallbacks(canonicalDecision));
129
+ const optimized = resolveToSQLOptimized(state, {
130
+ adapter: useCanonicalSource ? createParquetResolverAdapter({ queryCanonicalSource: "column" }) : probe,
131
+ siteId: void 0
132
+ });
133
+ const extras = buildExtrasQueries(state, {
134
+ adapter: probe,
135
+ siteId: void 0
136
+ });
137
+ const extraSource = extras.length > 0 ? useCanonicalSource ? decidePrimarySource(options, dateRange) : source : void 0;
138
+ const queryDim = canonicalQueryDim(options);
139
+ const mainArgs = withQueryDimFileSet(useCanonicalSource ? {
140
+ ...base,
141
+ fileSets: { FILES: {
142
+ table: ctx.table,
143
+ keys: options.canonicalSource.keys
144
+ } }
145
+ } : source.kind === "primary-columnar" ? primaryRunArgs(ctx, options.primarySource.keys) : base, queryDim, canonicalRequested && !useCanonicalSource);
146
+ const extraArgs = withQueryDimFileSet(extraSource?.kind === "primary-columnar" ? primaryRunArgs(ctx, options.primarySource.keys) : base, queryDim, extras.length > 0);
147
+ const resolveExtra = options.resolveExtra;
148
+ const [optRes, ...extrasRows] = await Promise.all([runSQL({
149
+ ...mainArgs,
150
+ sql: optimized.sql,
151
+ params: optimized.params
152
+ }), ...extras.map(async (e) => {
153
+ const overlaid = resolveExtra ? await resolveExtra({
154
+ key: e.key,
155
+ state,
156
+ ctx,
157
+ dateRange
158
+ }) : null;
159
+ return overlaid !== null ? { rows: overlaid } : runSQL({
160
+ ...extraArgs,
161
+ sql: e.sql,
162
+ params: e.params
163
+ });
164
+ })]);
165
+ const firstRow = optRes.rows[0];
166
+ const totalCount = Number(firstRow?.totalCount ?? 0);
167
+ const totals = {
168
+ clicks: Number(firstRow?.totalClicks ?? 0),
169
+ impressions: Number(firstRow?.totalImpressions ?? 0),
170
+ ctr: Number(firstRow?.totalCtr ?? 0),
171
+ position: Number(firstRow?.totalPosition ?? 0)
172
+ };
173
+ return {
174
+ rows: optRes.rows.map((r) => {
175
+ const { totalCount: _tc, totalClicks: _tcl, totalImpressions: _ti, totalCtr: _tr, totalPosition: _tp, ...rest } = r;
176
+ for (const key of Object.keys(rest)) if (key.startsWith("__order_")) delete rest[key];
177
+ return rest;
178
+ }),
179
+ totalCount,
180
+ totals,
181
+ extras: extras.map((e, i) => ({
182
+ key: e.key,
183
+ rows: extrasRows[i].rows
184
+ })),
185
+ source,
186
+ ...extraSource ? { extraSource } : {}
187
+ };
188
+ }
189
+ async function runComparisonQuery(runSQL, ctx, current, previous, windows, filter, options = {}) {
190
+ const probe = createParquetResolverAdapter();
191
+ const maxWindowEnd = windows.current.endDate > windows.previous.endDate ? windows.current.endDate : windows.previous.endDate;
192
+ const currentSource = decideCanonicalSource(current, probe.capabilities, options, maxWindowEnd);
193
+ const previousSource = decideCanonicalSource(previous, probe.capabilities, options, maxWindowEnd);
194
+ const startDate = windows.current.startDate < windows.previous.startDate ? windows.current.startDate : windows.previous.startDate;
195
+ const endDate = windows.current.endDate > windows.previous.endDate ? windows.current.endDate : windows.previous.endDate;
196
+ const comparisonRange = {
197
+ startDate,
198
+ endDate
199
+ };
200
+ const source = currentSource.kind === "canonical-rollup" && previousSource.kind === "canonical-rollup" ? querySourceDecision("canonical-rollup") : decidePrimarySource(options, comparisonRange, [...sourceFallbacks(currentSource), ...sourceFallbacks(previousSource)]);
201
+ const useCanonicalSource = source.kind === "canonical-rollup";
202
+ const adapter = useCanonicalSource ? createParquetResolverAdapter({ queryCanonicalSource: "column" }) : probe;
203
+ const comparison = resolveComparisonSQL(current, previous, {
204
+ adapter,
205
+ siteId: void 0
206
+ }, filter);
207
+ const totals = buildTotalsSql(current, {
208
+ adapter,
209
+ siteId: void 0
210
+ });
211
+ const partitions = enumeratePartitions(startDate, endDate);
212
+ const base = withQueryDimFileSet(useCanonicalSource ? {
213
+ ...runArgs(ctx, partitions),
214
+ fileSets: { FILES: {
215
+ table: ctx.table,
216
+ keys: options.canonicalSource.keys
217
+ } }
218
+ } : source.kind === "primary-columnar" ? primaryRunArgs(ctx, options.primarySource.keys) : runArgs(ctx, partitions), canonicalQueryDim(options), !useCanonicalSource && (canonicalFeatureRequested(current, probe.capabilities) || canonicalFeatureRequested(previous, probe.capabilities)));
219
+ const main = await runSQL({
220
+ ...base,
221
+ sql: comparison.sql,
222
+ params: comparison.params
223
+ });
224
+ const count = await runSQL({
225
+ ...base,
226
+ sql: comparison.countSql,
227
+ params: comparison.countParams
228
+ });
229
+ const totalsRow = await runSQL({
230
+ ...base,
231
+ sql: totals.sql,
232
+ params: totals.params
233
+ });
234
+ return {
235
+ rows: main.rows,
236
+ totalCount: Number(count.rows[0]?.total ?? 0),
237
+ totals: totalsRow.rows[0] ?? {},
238
+ source
239
+ };
240
+ }
241
+ export { QuerySourceCoverageError, runComparisonQuery, runOptimizedQuery };
@@ -0,0 +1,15 @@
1
+ import { TableName } from "@gscdump/contracts";
2
+ interface AssertSchemaInSyncOptions {
3
+ /** Label used in the thrown error (e.g. 'browser', 'sqlite'). */
4
+ label: string;
5
+ /** Drizzle schema keyed by table name. For sqlite, strip the `gsc_` prefix before passing. */
6
+ schema: Record<string, unknown>;
7
+ /**
8
+ * Map drizzle table key → canonical `TableName`. For browser this is identity;
9
+ * for sqlite this strips the `gsc_` prefix.
10
+ */
11
+ tableKeyToName: (key: string) => TableName;
12
+ mode: 'exact' | 'superset';
13
+ }
14
+ declare function assertSchemaInSync(options: AssertSchemaInSyncOptions): void;
15
+ export { AssertSchemaInSyncOptions, assertSchemaInSync };
@@ -0,0 +1,12 @@
1
+ import { SCHEMAS } from "../schema.mjs";
2
+ function assertSchemaInSync(options) {
3
+ const { label, schema, tableKeyToName, mode } = options;
4
+ for (const [key, table] of Object.entries(schema)) {
5
+ const sourceCols = SCHEMAS[tableKeyToName(key)].columns.map((c) => c.name).sort();
6
+ const drizzleCols = Object.keys(table[Symbol.for("drizzle:Columns")] ?? {}).sort();
7
+ const missing = sourceCols.filter((c) => !drizzleCols.includes(c));
8
+ const extra = mode === "exact" ? drizzleCols.filter((c) => !sourceCols.includes(c)) : [];
9
+ if (missing.length > 0 || extra.length > 0) throw new Error(`${label} drizzle schema for '${key}' drifted from SCHEMAS. Missing: [${missing.join(", ")}]. Extra: [${extra.join(", ")}].`);
10
+ }
11
+ }
12
+ export { assertSchemaInSync };
@@ -1,7 +1,7 @@
1
- import { DataSource, FileSetRef, Row as Row$1, TableName as TableName$1 } from "./_chunks/storage.mjs";
2
- import { ColumnDef } from "./_chunks/schema.mjs";
3
- import { EngineError } from "./_chunks/errors.mjs";
4
- import "./_chunks/contracts.mjs";
1
+ import { DataSource, FileSetRef, Row as Row$1, TableName as TableName$1 } from "./storage.mjs";
2
+ import { ColumnDef } from "./schema.mjs";
3
+ import { EngineError } from "./errors.mjs";
4
+ import "./contracts.mjs";
5
5
  import { SearchType } from "gscdump/query";
6
6
  import { TenantCtx } from "@gscdump/contracts";
7
7
  interface RollupCtx extends TenantCtx {
package/dist/rollups.mjs CHANGED
@@ -1,8 +1,9 @@
1
1
  import { engineErrors } from "./errors.mjs";
2
- import "./_chunks/layout.mjs";
2
+ import "./layout.mjs";
3
3
  import { inspectionParquetKey, sitemapUrlsIndexPrefix } from "./entity-keys.mjs";
4
4
  import { encodeRowsToParquetFlex } from "./adapters/hyparquet.mjs";
5
- import { createIndexingMetadataStore, createQueryDimStore, createSitemapStore } from "./_chunks/entities.mjs";
5
+ import { createQueryDimStore } from "./query-dim.mjs";
6
+ import { createIndexingMetadataStore, createSitemapStore } from "./entities.mjs";
6
7
  import { MS_PER_DAY } from "gscdump/dates";
7
8
  import { encodeJsonBigintSafe } from "@gscdump/lakehouse/bigint";
8
9
  function rollupPrefix(ctx, searchType) {
@@ -0,0 +1,100 @@
1
+ const DAY = 24 * (3600 * 1e3);
2
+ function isDue(state, now) {
3
+ return now >= state.nextAt;
4
+ }
5
+ function sitemapCadenceMs(consecutiveUnchanged) {
6
+ if (consecutiveUnchanged >= 7) return 30 * DAY;
7
+ if (consecutiveUnchanged >= 3) return 7 * DAY;
8
+ return DAY;
9
+ }
10
+ const SITEMAP_VERSION = 1;
11
+ const sitemapPolicy = {
12
+ version: SITEMAP_VERSION,
13
+ initial(now) {
14
+ return {
15
+ nextAt: now + DAY,
16
+ consecutiveUnchanged: 0,
17
+ policyVersion: SITEMAP_VERSION
18
+ };
19
+ },
20
+ observe(prev, evt) {
21
+ if (prev.policyVersion !== SITEMAP_VERSION) return {
22
+ nextAt: evt.at + sitemapCadenceMs(0),
23
+ consecutiveUnchanged: 0,
24
+ policyVersion: SITEMAP_VERSION
25
+ };
26
+ if (evt.changed) return {
27
+ nextAt: evt.at + DAY,
28
+ consecutiveUnchanged: 0,
29
+ policyVersion: SITEMAP_VERSION
30
+ };
31
+ const next = prev.consecutiveUnchanged + 1;
32
+ return {
33
+ nextAt: evt.at + sitemapCadenceMs(next),
34
+ consecutiveUnchanged: next,
35
+ policyVersion: SITEMAP_VERSION
36
+ };
37
+ },
38
+ isDue
39
+ };
40
+ const INSPECTION_VERSION = 1;
41
+ function inspectionCadenceMs(verdict) {
42
+ if (verdict === "PASS") return 30 * DAY;
43
+ if (verdict === "FAIL") return 7 * DAY;
44
+ return 14 * DAY;
45
+ }
46
+ function inspectionPolicy(verdict) {
47
+ const cadence = inspectionCadenceMs(verdict);
48
+ return {
49
+ version: INSPECTION_VERSION,
50
+ initial(now) {
51
+ return {
52
+ nextAt: now + cadence,
53
+ consecutiveUnchanged: 0,
54
+ policyVersion: INSPECTION_VERSION
55
+ };
56
+ },
57
+ observe(prev, evt) {
58
+ if (prev.policyVersion !== INSPECTION_VERSION) return {
59
+ nextAt: evt.at + cadence,
60
+ consecutiveUnchanged: 0,
61
+ policyVersion: INSPECTION_VERSION
62
+ };
63
+ const next = evt.changed ? 0 : prev.consecutiveUnchanged + 1;
64
+ return {
65
+ nextAt: evt.at + cadence,
66
+ consecutiveUnchanged: next,
67
+ policyVersion: INSPECTION_VERSION
68
+ };
69
+ },
70
+ isDue
71
+ };
72
+ }
73
+ const FIXED_VERSION = 1;
74
+ function fixedPolicy(intervalMs) {
75
+ return {
76
+ version: FIXED_VERSION,
77
+ initial(now) {
78
+ return {
79
+ nextAt: now + intervalMs,
80
+ consecutiveUnchanged: 0,
81
+ policyVersion: FIXED_VERSION
82
+ };
83
+ },
84
+ observe(prev, evt) {
85
+ if (prev.policyVersion !== FIXED_VERSION) return {
86
+ nextAt: evt.at + intervalMs,
87
+ consecutiveUnchanged: 0,
88
+ policyVersion: FIXED_VERSION
89
+ };
90
+ const next = evt.changed ? 0 : prev.consecutiveUnchanged + 1;
91
+ return {
92
+ nextAt: evt.at + intervalMs,
93
+ consecutiveUnchanged: next,
94
+ policyVersion: FIXED_VERSION
95
+ };
96
+ },
97
+ isDue
98
+ };
99
+ }
100
+ export { fixedPolicy, inspectionPolicy, sitemapPolicy };
package/dist/schema.d.mts CHANGED
@@ -1,2 +1,35 @@
1
- import { ColumnDef, ColumnType, DrizzleSchema, SCHEMAS, TABLE_METADATA, 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 } from "./_chunks/schema.mjs";
1
+ import { DrizzleSchema, TABLE_METADATA, countries, dates, drizzleSchema, hourly_pages, page_queries, pages, queries, search_appearance, search_appearance_page_queries, search_appearance_pages, search_appearance_queries } from "./drizzle-schema.mjs";
2
+ import { ColumnDef, ColumnType, Row, TableName, TableSchema, TableSchema as TableSchema$1 } from "@gscdump/contracts";
3
+ declare const SCHEMAS: Record<TableName, TableSchema$1>;
4
+ declare function currentSchemaVersion(table: TableName): number;
5
+ /**
6
+ * DATE column names for a table. The single schema-derived source every read
7
+ * path uses to build the legacy-VARCHAR date canonicalization (see
8
+ * `dateReplaceClause` in `./sql-fragments`), so the engine codec and the CLI
9
+ * `dump`/`export` commands agree on which columns to cast.
10
+ */
11
+ declare function dateColumnsFor(table: TableName): string[];
12
+ declare function allTables(): readonly TableName[];
13
+ declare function inferTable(dimensions: readonly string[]): TableName;
14
+ /**
15
+ * Natural-key columns for a table: the `sortKey` dimensions that uniquely
16
+ * identify a metric row (e.g. `['date', 'url']` for `pages`).
17
+ */
18
+ declare function naturalKeyColumns(table: TableName): readonly string[];
19
+ /**
20
+ * Collapse rows that share a natural key (see {@link naturalKeyColumns}) to a
21
+ * single survivor.
22
+ *
23
+ * Correct write and compaction inputs never collide on the natural key — each
24
+ * (date, dimension) tuple is produced exactly once per slice — so on healthy
25
+ * data this is a no-op. It exists as a recurrence guard: the 2026-04 monthly
26
+ * compaction corruption folded a complete month back on top of its own daily
27
+ * inputs, doubling every row. Absorbing duplicates at every write/compaction
28
+ * boundary keeps that class of bug from inflating impressions downstream.
29
+ *
30
+ * Last occurrence wins. Observed duplicates are byte-identical, so the choice
31
+ * of survivor is immaterial.
32
+ */
33
+ declare function dedupeByNaturalKey(table: TableName, rows: readonly Row[]): Row[];
34
+ declare function dimensionToColumn(dim: string, _table: TableName): string;
2
35
  export { type ColumnDef, type ColumnType, type DrizzleSchema, SCHEMAS, TABLE_METADATA, type 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 };