@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,7 @@
1
+ import { DuckDBHandle } from "../duckdb.mjs";
2
+ interface NodeDuckDBOptions {
3
+ verbose?: boolean;
4
+ }
5
+ declare function createNodeDuckDBHandle(opts?: NodeDuckDBOptions): DuckDBHandle;
6
+ declare function resetNodeDuckDB(): void;
7
+ export { NodeDuckDBOptions, createNodeDuckDBHandle, resetNodeDuckDB };
@@ -0,0 +1,94 @@
1
+ import { arrowToRows } from "../arrow-utils.mjs";
2
+ import { createRequire } from "node:module";
3
+ import process from "node:process";
4
+ import { unlinkSync } from "node:fs";
5
+ import { tmpdir } from "node:os";
6
+ import { join } from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+ import { ConsoleLogger, NODE_RUNTIME, VoidLogger, createDuckDB } from "@duckdb/duckdb-wasm/dist/duckdb-node-blocking.cjs";
9
+ const require_ = createRequire(typeof __filename !== "undefined" ? __filename : typeof import.meta !== "undefined" ? fileURLToPath(import.meta.url) : process.cwd());
10
+ let singleton = null;
11
+ let singletonOpts = null;
12
+ function bundles() {
13
+ return {
14
+ mvp: {
15
+ mainModule: require_.resolve("@duckdb/duckdb-wasm/dist/duckdb-mvp.wasm"),
16
+ mainWorker: null
17
+ },
18
+ eh: {
19
+ mainModule: require_.resolve("@duckdb/duckdb-wasm/dist/duckdb-eh.wasm"),
20
+ mainWorker: null
21
+ }
22
+ };
23
+ }
24
+ async function initialize(opts) {
25
+ const logger = opts.verbose ? new ConsoleLogger() : new VoidLogger();
26
+ const db = await createDuckDB(bundles(), logger, NODE_RUNTIME);
27
+ await db.instantiate();
28
+ return {
29
+ db,
30
+ conn: db.connect()
31
+ };
32
+ }
33
+ function getSingleton(opts) {
34
+ if (!singleton) {
35
+ singleton = initialize(opts);
36
+ singletonOpts = opts;
37
+ }
38
+ return singleton;
39
+ }
40
+ function createNodeDuckDBHandle(opts = {}) {
41
+ if (singleton && opts.verbose !== void 0 && opts.verbose !== (singletonOpts?.verbose ?? false)) console.warn(`[gscdump] createNodeDuckDBHandle: ignoring verbose=${opts.verbose} — a shared DuckDB instance was already initialized with verbose=${singletonOpts?.verbose ?? false}. Call resetNodeDuckDB() before re-initializing to change it.`);
42
+ getSingleton(opts);
43
+ return {
44
+ async query(sql, params) {
45
+ const { conn } = await getSingleton(opts);
46
+ if (!params || params.length === 0) return arrowToRows(conn.query(sql));
47
+ const stmt = conn.prepare(sql);
48
+ try {
49
+ return arrowToRows(stmt.query(...params));
50
+ } finally {
51
+ stmt.close();
52
+ }
53
+ },
54
+ async registerFileBuffer(name, bytes) {
55
+ const { db } = await getSingleton(opts);
56
+ db.registerFileBuffer(name, bytes);
57
+ },
58
+ async copyFileToBuffer(name) {
59
+ const { db } = await getSingleton(opts);
60
+ return db.copyFileToBuffer(name);
61
+ },
62
+ async dropFiles(names) {
63
+ const { db } = await getSingleton(opts);
64
+ for (const name of names) {
65
+ try {
66
+ db.dropFile(name);
67
+ } catch (error) {
68
+ const message = error instanceof Error ? error.message : String(error);
69
+ if (!/not found|does not exist|unknown file/i.test(message)) throw error;
70
+ }
71
+ try {
72
+ unlinkSync(name);
73
+ } catch (error) {
74
+ if (error.code !== "ENOENT") throw error;
75
+ }
76
+ }
77
+ },
78
+ makeTempPath(ext) {
79
+ return join(tmpdir(), `gscdump-${Math.random().toString(36).slice(2, 10)}.${ext}`);
80
+ }
81
+ };
82
+ }
83
+ function resetNodeDuckDB() {
84
+ const pending = singleton;
85
+ singleton = null;
86
+ singletonOpts = null;
87
+ pending?.then(({ db, conn }) => {
88
+ conn.close();
89
+ db.reset();
90
+ }).catch((err) => {
91
+ console.warn("[gscdump] resetNodeDuckDB: failed to release DuckDB instance", err);
92
+ });
93
+ }
94
+ export { createNodeDuckDBHandle, resetNodeDuckDB };
@@ -1,4 +1,4 @@
1
- import { DataSource, ManifestStore } from "../_chunks/storage.mjs";
1
+ import { DataSource, ManifestStore } from "../storage.mjs";
2
2
  interface FilesystemDataSourceOptions {
3
3
  rootDir: string;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { manifestEntryKey, matchesManifestEntryFilter, matchesSyncStateFilter, matchesWatermarkFilter, mergeSyncState, syncStateKey, watermarkKey } from "../_chunks/manifest-store-utils.mjs";
1
+ import { manifestEntryKey, matchesManifestEntryFilter, matchesSyncStateFilter, matchesWatermarkFilter, mergeSyncState, syncStateKey, watermarkKey } from "../manifest-store-utils.mjs";
2
2
  import { dirname, join, resolve } from "node:path";
3
3
  import { Buffer } from "node:buffer";
4
4
  import { randomBytes } from "node:crypto";
@@ -1,6 +1,7 @@
1
- import { CodecCtx, DataSource, ParquetCodec, Row, TableName } from "../_chunks/storage.mjs";
2
- import { ParquetQueryFilter } from "../_chunks/libs/hyparquet.mjs";
3
- import { ColumnDef } from "../_chunks/schema.mjs";
1
+ import { ParquetQueryFilter } from "../node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/index.mjs";
2
+ import "../node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/node.mjs";
3
+ import { CodecCtx, DataSource, ParquetCodec, Row, TableName } from "../storage.mjs";
4
+ import { ColumnDef } from "../schema.mjs";
4
5
  declare function encodeRowsToParquet(table: TableName, rows: readonly Row[]): Uint8Array;
5
6
  interface EncodeFlexOptions {
6
7
  /** Columns defining the output schema + order. */
@@ -1,6 +1,10 @@
1
- import { SCHEMAS, TABLE_METADATA } from "../_chunks/schema.mjs";
2
- import { parquetReadObjects } from "../_chunks/libs/hyparquet.mjs";
3
- import { ByteWriter, parquetWriteRows } from "../_chunks/libs/hyparquet-writer.mjs";
1
+ import { TABLE_METADATA } from "../drizzle-schema.mjs";
2
+ import { SCHEMAS } from "../schema.mjs";
3
+ import { parquetReadObjects } from "../node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/read.mjs";
4
+ import "../node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/node.mjs";
5
+ import { ByteWriter } from "../node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/bytewriter.mjs";
6
+ import { parquetWriteRows } from "../node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/write-rows.mjs";
7
+ import "../node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/node.mjs";
4
8
  const ROW_GROUP_SIZE = 25e3;
5
9
  const DEFAULT_COMPACTION_READ_CONCURRENCY = 8;
6
10
  const MAX_COMPACTION_READ_CONCURRENCY = 32;
@@ -0,0 +1,38 @@
1
+ import { DataSource, StorageEngine } from "../storage.mjs";
2
+ import { SearchType } from "gscdump/query";
3
+ import { Row, TableName } from "@gscdump/contracts";
4
+ interface NodeHarnessOptions {
5
+ dataDir: string;
6
+ /** Tenant user id. Defaults to `'local'` for single-user CLI installs. */
7
+ userId?: string;
8
+ /** Name of the manifest file under `dataDir`. Defaults to `manifest.json`. */
9
+ manifestFilename?: string;
10
+ }
11
+ interface NodeHarness {
12
+ engine: StorageEngine;
13
+ /**
14
+ * Underlying filesystem-backed DataSource. Exposed so commands that write
15
+ * derivative artifacts (rollups, exports) don't have to re-instantiate it.
16
+ */
17
+ dataSource: DataSource;
18
+ dataDir: string;
19
+ userId: string;
20
+ siteIdFor: (siteUrl: string) => string;
21
+ runRawSql: (opts: {
22
+ sql: string;
23
+ siteUrl: string;
24
+ table: TableName;
25
+ params?: unknown[];
26
+ /**
27
+ * Restrict the underlying manifest lookup to a single GSC search-type
28
+ * slice. Undefined keeps the legacy cross-type union.
29
+ */
30
+ searchType?: SearchType;
31
+ }) => Promise<{
32
+ rows: Row[];
33
+ sql: string;
34
+ keys: string[];
35
+ }>;
36
+ }
37
+ declare function createNodeHarness(opts: NodeHarnessOptions): NodeHarness;
38
+ export { NodeHarness, NodeHarnessOptions, createNodeHarness };
@@ -0,0 +1,47 @@
1
+ import { createDuckDBCodec, createDuckDBExecutor } from "../duckdb.mjs";
2
+ import { createStorageEngine } from "../engine.mjs";
3
+ import { createNodeDuckDBHandle } from "./duckdb-node.mjs";
4
+ import { createFilesystemDataSource, createFilesystemManifestStore } from "./filesystem.mjs";
5
+ import path from "node:path";
6
+ import { encodeSiteId } from "gscdump/tenant";
7
+ function createNodeHarness(opts) {
8
+ const dataDir = opts.dataDir;
9
+ const userId = opts.userId ?? "local";
10
+ const manifestFilename = opts.manifestFilename ?? "manifest.json";
11
+ const handle = createNodeDuckDBHandle();
12
+ const factory = { getDuckDB: async () => handle };
13
+ const dataSource = createFilesystemDataSource({ rootDir: dataDir });
14
+ const engine = createStorageEngine({
15
+ dataSource,
16
+ manifestStore: createFilesystemManifestStore({ path: path.join(dataDir, manifestFilename) }),
17
+ codec: createDuckDBCodec(factory),
18
+ executor: createDuckDBExecutor(factory)
19
+ });
20
+ async function runRawSql(runOpts) {
21
+ const result = await engine.runSQL({
22
+ ctx: {
23
+ userId,
24
+ siteId: encodeSiteId(runOpts.siteUrl)
25
+ },
26
+ table: runOpts.table,
27
+ fileSets: { FILES: { table: runOpts.table } },
28
+ sql: runOpts.sql,
29
+ params: runOpts.params ?? [],
30
+ ...runOpts.searchType !== void 0 ? { searchType: runOpts.searchType } : {}
31
+ });
32
+ return {
33
+ rows: result.rows,
34
+ sql: result.sql,
35
+ keys: result.objectKeys
36
+ };
37
+ }
38
+ return {
39
+ engine,
40
+ dataSource,
41
+ dataDir,
42
+ userId,
43
+ siteIdFor: encodeSiteId,
44
+ runRawSql
45
+ };
46
+ }
47
+ export { createNodeHarness };
@@ -1,101 +1,5 @@
1
- import { DataSource, StorageEngine } from "../_chunks/storage.mjs";
2
- import { DuckDBHandle, SnapshotIndex } from "../_chunks/snapshot.mjs";
3
- import { SearchType } from "gscdump/query";
4
- import { Row, TableName } from "@gscdump/contracts";
5
- interface NodeDuckDBOptions {
6
- verbose?: boolean;
7
- }
8
- declare function createNodeDuckDBHandle(opts?: NodeDuckDBOptions): DuckDBHandle;
9
- declare function resetNodeDuckDB(): void;
10
- interface NodeHarnessOptions {
11
- dataDir: string;
12
- /** Tenant user id. Defaults to `'local'` for single-user CLI installs. */
13
- userId?: string;
14
- /** Name of the manifest file under `dataDir`. Defaults to `manifest.json`. */
15
- manifestFilename?: string;
16
- }
17
- interface NodeHarness {
18
- engine: StorageEngine;
19
- /**
20
- * Underlying filesystem-backed DataSource. Exposed so commands that write
21
- * derivative artifacts (rollups, exports) don't have to re-instantiate it.
22
- */
23
- dataSource: DataSource;
24
- dataDir: string;
25
- userId: string;
26
- siteIdFor: (siteUrl: string) => string;
27
- runRawSql: (opts: {
28
- sql: string;
29
- siteUrl: string;
30
- table: TableName;
31
- params?: unknown[];
32
- /**
33
- * Restrict the underlying manifest lookup to a single GSC search-type
34
- * slice. Undefined keeps the legacy cross-type union.
35
- */
36
- searchType?: SearchType;
37
- }) => Promise<{
38
- rows: Row[];
39
- sql: string;
40
- keys: string[];
41
- }>;
42
- }
43
- declare function createNodeHarness(opts: NodeHarnessOptions): NodeHarness;
44
- /**
45
- * Runs arbitrary SQL and returns rows as plain objects. Caller supplies
46
- * this so the function works with AsyncDuckDB (browser DuckDB-WASM) or
47
- * @duckdb/node-api (Node) without coupling to either.
48
- */
49
- type SnapshotQueryRunner = (sql: string) => Promise<Array<Record<string, unknown>>>;
50
- interface AttachSnapshotOptions {
51
- /** Index produced by the builder. */
52
- index: SnapshotIndex;
53
- /**
54
- * Map from filename (`cold-YYYY-MM.duckdb`, `hot.duckdb`) to an HTTPS
55
- * URL (typically a pre-signed R2 URL). Must contain an entry for every
56
- * cold month in `index.cold` and — if `index.hot` — for `hot.duckdb`.
57
- */
58
- attachUrls: Record<string, string>;
59
- /** Schema the unified views land under. Default `main`. */
60
- schema?: string;
61
- /**
62
- * DuckDB httpfs can error with "Server sent back more data than expected"
63
- * against some proxies; `force_download=true` sidesteps it. Default true.
64
- */
65
- forceDownload?: boolean;
66
- }
67
- interface AttachSnapshotResult {
68
- schema: string;
69
- /** Aliases we ATTACH'd — e.g. ['cold_2024_09', 'cold_2024_10', 'hot']. */
70
- aliases: string[];
71
- /** Table names with a UNION view created under `schema`. */
72
- tables: string[];
73
- }
74
- /**
75
- * Turns a filename like `cold-2024-09.duckdb` into a valid SQL identifier
76
- * `cold_2024_09`. `hot.duckdb` → `hot`.
77
- */
78
- declare function snapshotAlias(fileName: string): string;
79
- declare function attachSnapshotIndex(runner: SnapshotQueryRunner, opts: AttachSnapshotOptions): Promise<AttachSnapshotResult>;
80
- interface AttachParquetIndexOptions {
81
- /**
82
- * Map of table name → list of Parquet URLs. The URL list may mix monthly
83
- * compacted files and per-day files — DuckDB will scan all of them with
84
- * `union_by_name = true`. Empty lists are skipped (no view created).
85
- */
86
- tables: Record<string, string[]>;
87
- /** Schema the views land under. Default `main`. */
88
- schema?: string;
89
- /**
90
- * DuckDB httpfs can error with "Server sent back more data than expected"
91
- * against some proxies; `force_download=true` sidesteps it. Default true.
92
- */
93
- forceDownload?: boolean;
94
- }
95
- interface AttachParquetIndexResult {
96
- schema: string;
97
- /** Tables for which a view was created. */
98
- tables: string[];
99
- }
100
- declare function attachParquetIndex(runner: SnapshotQueryRunner, opts: AttachParquetIndexOptions): Promise<AttachParquetIndexResult>;
1
+ import { NodeDuckDBOptions, createNodeDuckDBHandle, resetNodeDuckDB } from "./duckdb-node.mjs";
2
+ import { NodeHarness, NodeHarnessOptions, createNodeHarness } from "./node-harness.mjs";
3
+ import { AttachSnapshotOptions, AttachSnapshotResult, SnapshotQueryRunner, attachSnapshotIndex, snapshotAlias } from "./snapshot-attach.mjs";
4
+ import { AttachParquetIndexOptions, AttachParquetIndexResult, attachParquetIndex } from "./parquet-attach.mjs";
101
5
  export { type AttachParquetIndexOptions, type AttachParquetIndexResult, type AttachSnapshotOptions, type AttachSnapshotResult, type NodeDuckDBOptions, type NodeHarness, type NodeHarnessOptions, type SnapshotQueryRunner, attachParquetIndex, attachSnapshotIndex, createNodeDuckDBHandle, createNodeHarness, resetNodeDuckDB, snapshotAlias };
@@ -1,241 +1,5 @@
1
- import { engineErrors } from "../errors.mjs";
2
- import { createDuckDBCodec, createDuckDBExecutor, createStorageEngine } from "../_chunks/engine.mjs";
3
- import { arrowToRows } from "../arrow-utils.mjs";
4
- import { createFilesystemDataSource, createFilesystemManifestStore } from "./filesystem.mjs";
5
- import { createRequire } from "node:module";
6
- import { err, ok, unwrapResult } from "gscdump/result";
7
- import process from "node:process";
8
- import { unlinkSync } from "node:fs";
9
- import { tmpdir } from "node:os";
10
- import path, { join } from "node:path";
11
- import { fileURLToPath } from "node:url";
12
- import { ConsoleLogger, NODE_RUNTIME, VoidLogger, createDuckDB } from "@duckdb/duckdb-wasm/dist/duckdb-node-blocking.cjs";
13
- import { encodeSiteId } from "gscdump/tenant";
14
- const require_ = createRequire(typeof __filename !== "undefined" ? __filename : typeof import.meta !== "undefined" ? fileURLToPath(import.meta.url) : process.cwd());
15
- let singleton = null;
16
- let singletonOpts = null;
17
- function bundles() {
18
- return {
19
- mvp: {
20
- mainModule: require_.resolve("@duckdb/duckdb-wasm/dist/duckdb-mvp.wasm"),
21
- mainWorker: null
22
- },
23
- eh: {
24
- mainModule: require_.resolve("@duckdb/duckdb-wasm/dist/duckdb-eh.wasm"),
25
- mainWorker: null
26
- }
27
- };
28
- }
29
- async function initialize(opts) {
30
- const logger = opts.verbose ? new ConsoleLogger() : new VoidLogger();
31
- const db = await createDuckDB(bundles(), logger, NODE_RUNTIME);
32
- await db.instantiate();
33
- return {
34
- db,
35
- conn: db.connect()
36
- };
37
- }
38
- function getSingleton(opts) {
39
- if (!singleton) {
40
- singleton = initialize(opts);
41
- singletonOpts = opts;
42
- }
43
- return singleton;
44
- }
45
- function createNodeDuckDBHandle(opts = {}) {
46
- if (singleton && opts.verbose !== void 0 && opts.verbose !== (singletonOpts?.verbose ?? false)) console.warn(`[gscdump] createNodeDuckDBHandle: ignoring verbose=${opts.verbose} — a shared DuckDB instance was already initialized with verbose=${singletonOpts?.verbose ?? false}. Call resetNodeDuckDB() before re-initializing to change it.`);
47
- getSingleton(opts);
48
- return {
49
- async query(sql, params) {
50
- const { conn } = await getSingleton(opts);
51
- if (!params || params.length === 0) return arrowToRows(conn.query(sql));
52
- const stmt = conn.prepare(sql);
53
- try {
54
- return arrowToRows(stmt.query(...params));
55
- } finally {
56
- stmt.close();
57
- }
58
- },
59
- async registerFileBuffer(name, bytes) {
60
- const { db } = await getSingleton(opts);
61
- db.registerFileBuffer(name, bytes);
62
- },
63
- async copyFileToBuffer(name) {
64
- const { db } = await getSingleton(opts);
65
- return db.copyFileToBuffer(name);
66
- },
67
- async dropFiles(names) {
68
- const { db } = await getSingleton(opts);
69
- for (const name of names) {
70
- try {
71
- db.dropFile(name);
72
- } catch (error) {
73
- const message = error instanceof Error ? error.message : String(error);
74
- if (!/not found|does not exist|unknown file/i.test(message)) throw error;
75
- }
76
- try {
77
- unlinkSync(name);
78
- } catch (error) {
79
- if (error.code !== "ENOENT") throw error;
80
- }
81
- }
82
- },
83
- makeTempPath(ext) {
84
- return join(tmpdir(), `gscdump-${Math.random().toString(36).slice(2, 10)}.${ext}`);
85
- }
86
- };
87
- }
88
- function resetNodeDuckDB() {
89
- const pending = singleton;
90
- singleton = null;
91
- singletonOpts = null;
92
- pending?.then(({ db, conn }) => {
93
- conn.close();
94
- db.reset();
95
- }).catch((err) => {
96
- console.warn("[gscdump] resetNodeDuckDB: failed to release DuckDB instance", err);
97
- });
98
- }
99
- function createNodeHarness(opts) {
100
- const dataDir = opts.dataDir;
101
- const userId = opts.userId ?? "local";
102
- const manifestFilename = opts.manifestFilename ?? "manifest.json";
103
- const handle = createNodeDuckDBHandle();
104
- const factory = { getDuckDB: async () => handle };
105
- const dataSource = createFilesystemDataSource({ rootDir: dataDir });
106
- const engine = createStorageEngine({
107
- dataSource,
108
- manifestStore: createFilesystemManifestStore({ path: path.join(dataDir, manifestFilename) }),
109
- codec: createDuckDBCodec(factory),
110
- executor: createDuckDBExecutor(factory)
111
- });
112
- async function runRawSql(runOpts) {
113
- const result = await engine.runSQL({
114
- ctx: {
115
- userId,
116
- siteId: encodeSiteId(runOpts.siteUrl)
117
- },
118
- table: runOpts.table,
119
- fileSets: { FILES: { table: runOpts.table } },
120
- sql: runOpts.sql,
121
- params: runOpts.params ?? [],
122
- ...runOpts.searchType !== void 0 ? { searchType: runOpts.searchType } : {}
123
- });
124
- return {
125
- rows: result.rows,
126
- sql: result.sql,
127
- keys: result.objectKeys
128
- };
129
- }
130
- return {
131
- engine,
132
- dataSource,
133
- dataDir,
134
- userId,
135
- siteIdFor: encodeSiteId,
136
- runRawSql
137
- };
138
- }
139
- const IDENT_RE = /^[A-Z_][\w$]*$/i;
140
- async function attachParquetIndex(runner, opts) {
141
- const schema = opts.schema ?? "main";
142
- const forceDownload = opts.forceDownload !== false;
143
- if (!IDENT_RE.test(schema)) throw new TypeError(`attachParquetIndex: invalid schema identifier ${JSON.stringify(schema)}`);
144
- for (const table of Object.keys(opts.tables)) if (!IDENT_RE.test(table)) throw new TypeError(`attachParquetIndex: invalid table identifier ${JSON.stringify(table)}`);
145
- await runner("LOAD httpfs").catch(() => void 0);
146
- if (forceDownload) await runner("SET force_download=true");
147
- await runner(`CREATE SCHEMA IF NOT EXISTS ${schema}`);
148
- const created = [];
149
- for (const [table, urls] of Object.entries(opts.tables)) {
150
- if (urls.length === 0) continue;
151
- await runner(`CREATE OR REPLACE VIEW ${schema}.${table} AS SELECT * FROM read_parquet([${urls.map((u) => `'${u.replace(/'/g, "''")}'`).join(", ")}], union_by_name = true)`);
152
- created.push(table);
153
- }
154
- return {
155
- schema,
156
- tables: created
157
- };
158
- }
159
- const YEAR_MONTH_RE = /^\d{4}-\d{2}$/;
160
- const SCHEMA_IDENT_RE = /^[A-Z_][\w$]*$/i;
161
- const COLD_FILENAME_RE = /^cold-(\d{4}-\d{2})\.duckdb$/;
162
- function snapshotAlias(fileName) {
163
- if (fileName === "hot.duckdb") return "hot";
164
- const m = fileName.match(COLD_FILENAME_RE);
165
- if (!m?.[1]) throw new TypeError(`snapshotAlias: unrecognised filename ${JSON.stringify(fileName)}`);
166
- return `cold_${m[1].replace("-", "_")}`;
167
- }
168
- const SNAPSHOT_TYPE_ERROR_KINDS = /* @__PURE__ */ new Set([
169
- "invalid-snapshot-filename",
170
- "unsupported-snapshot-index-version",
171
- "invalid-schema-identifier",
172
- "invalid-year-month"
173
- ]);
174
- function snapshotAttachErrorToException(error) {
175
- const exception = SNAPSHOT_TYPE_ERROR_KINDS.has(error.kind) ? new TypeError(error.message) : new Error(error.message);
176
- exception.engineError = error;
177
- return exception;
178
- }
179
- async function attachSnapshotIndexResult(runner, opts) {
180
- const { index, attachUrls } = opts;
181
- const schema = opts.schema ?? "main";
182
- const forceDownload = opts.forceDownload !== false;
183
- if (index?.version !== 1) return err(engineErrors.unsupportedSnapshotIndexVersion(index?.version));
184
- if (!SCHEMA_IDENT_RE.test(schema)) return err(engineErrors.invalidSchemaIdentifier(schema));
185
- for (const ym of index.cold) if (!YEAR_MONTH_RE.test(ym)) return err(engineErrors.invalidYearMonth(ym));
186
- await runner("LOAD httpfs").catch(() => void 0);
187
- if (forceDownload) await runner("SET force_download=true");
188
- const plan = [];
189
- for (const ym of index.cold) {
190
- const fileName = `cold-${ym}.duckdb`;
191
- const url = attachUrls[fileName];
192
- if (!url) return err(engineErrors.missingAttachUrl(fileName));
193
- plan.push({
194
- fileName,
195
- alias: snapshotAlias(fileName),
196
- url
197
- });
198
- }
199
- if (index.hot) {
200
- const fileName = "hot.duckdb";
201
- const url = attachUrls[fileName];
202
- if (!url) return err(engineErrors.missingAttachUrl(fileName));
203
- plan.push({
204
- fileName,
205
- alias: snapshotAlias(fileName),
206
- url
207
- });
208
- }
209
- const aliases = [];
210
- for (const { alias, url } of plan) {
211
- await runner(`ATTACH '${url.replace(/'/g, "''")}' AS ${alias} (READ_ONLY)`);
212
- aliases.push(alias);
213
- }
214
- const aliasSet = new Set(aliases);
215
- const tableRows = await runner("SELECT database_name, table_name FROM duckdb_tables()");
216
- const present = /* @__PURE__ */ new Map();
217
- for (const row of tableRows) {
218
- const db = String(row.database_name ?? "");
219
- const table = String(row.table_name ?? "");
220
- if (!aliasSet.has(db) || !table) continue;
221
- const list = present.get(table);
222
- if (list) list.push(db);
223
- else present.set(table, [db]);
224
- }
225
- const tables = [];
226
- for (const [table, dbs] of present) {
227
- if (!SCHEMA_IDENT_RE.test(table)) continue;
228
- const dbsSet = new Set(dbs);
229
- await runner(`CREATE OR REPLACE VIEW ${schema}.${table} AS ${aliases.filter((a) => dbsSet.has(a)).map((db) => `SELECT * FROM ${db}.${table}`).join(" UNION ALL BY NAME ")}`);
230
- tables.push(table);
231
- }
232
- return ok({
233
- schema,
234
- aliases,
235
- tables
236
- });
237
- }
238
- async function attachSnapshotIndex(runner, opts) {
239
- return unwrapResult(await attachSnapshotIndexResult(runner, opts), snapshotAttachErrorToException);
240
- }
1
+ import { createNodeDuckDBHandle, resetNodeDuckDB } from "./duckdb-node.mjs";
2
+ import { createNodeHarness } from "./node-harness.mjs";
3
+ import { attachParquetIndex } from "./parquet-attach.mjs";
4
+ import { attachSnapshotIndex, snapshotAlias } from "./snapshot-attach.mjs";
241
5
  export { attachParquetIndex, attachSnapshotIndex, createNodeDuckDBHandle, createNodeHarness, resetNodeDuckDB, snapshotAlias };
@@ -0,0 +1,23 @@
1
+ import { SnapshotQueryRunner } from "./snapshot-attach.mjs";
2
+ interface AttachParquetIndexOptions {
3
+ /**
4
+ * Map of table name → list of Parquet URLs. The URL list may mix monthly
5
+ * compacted files and per-day files — DuckDB will scan all of them with
6
+ * `union_by_name = true`. Empty lists are skipped (no view created).
7
+ */
8
+ tables: Record<string, string[]>;
9
+ /** Schema the views land under. Default `main`. */
10
+ schema?: string;
11
+ /**
12
+ * DuckDB httpfs can error with "Server sent back more data than expected"
13
+ * against some proxies; `force_download=true` sidesteps it. Default true.
14
+ */
15
+ forceDownload?: boolean;
16
+ }
17
+ interface AttachParquetIndexResult {
18
+ schema: string;
19
+ /** Tables for which a view was created. */
20
+ tables: string[];
21
+ }
22
+ declare function attachParquetIndex(runner: SnapshotQueryRunner, opts: AttachParquetIndexOptions): Promise<AttachParquetIndexResult>;
23
+ export { AttachParquetIndexOptions, AttachParquetIndexResult, attachParquetIndex };
@@ -0,0 +1,21 @@
1
+ const IDENT_RE = /^[A-Z_][\w$]*$/i;
2
+ async function attachParquetIndex(runner, opts) {
3
+ const schema = opts.schema ?? "main";
4
+ const forceDownload = opts.forceDownload !== false;
5
+ if (!IDENT_RE.test(schema)) throw new TypeError(`attachParquetIndex: invalid schema identifier ${JSON.stringify(schema)}`);
6
+ for (const table of Object.keys(opts.tables)) if (!IDENT_RE.test(table)) throw new TypeError(`attachParquetIndex: invalid table identifier ${JSON.stringify(table)}`);
7
+ await runner("LOAD httpfs").catch(() => void 0);
8
+ if (forceDownload) await runner("SET force_download=true");
9
+ await runner(`CREATE SCHEMA IF NOT EXISTS ${schema}`);
10
+ const created = [];
11
+ for (const [table, urls] of Object.entries(opts.tables)) {
12
+ if (urls.length === 0) continue;
13
+ await runner(`CREATE OR REPLACE VIEW ${schema}.${table} AS SELECT * FROM read_parquet([${urls.map((u) => `'${u.replace(/'/g, "''")}'`).join(", ")}], union_by_name = true)`);
14
+ created.push(table);
15
+ }
16
+ return {
17
+ schema,
18
+ tables: created
19
+ };
20
+ }
21
+ export { attachParquetIndex };