lakeql 0.1.7 → 0.1.9

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.
@@ -1,8 +1,24 @@
1
- import { ObjectStore } from './index.js';
2
- export { AggregateExpr, AggregateGroupSnapshot, AggregateOp, AggregateOperatorState, AggregateOptions, AggregateParquetGroupTaskOptions, AggregateParquetGroupTasksOptions, AggregateParquetTaskOptions, AggregateParquetTasksOptions, AggregateResult, AggregateSnapshotValue, AggregateSpec, AggregateStateSnapshot, AggregationBuilder, ApplyIcebergDeletesOptions, ArithmeticExpr, BBox, BBoxIndex, Batch, BatchExprValues, BetweenExpr, Bookmark, BookmarkInit, BookmarkPosition, BookmarkQuery, BroadcastJoinOptions, CacheAdapter, CacheApiCache, CacheApiCacheOptions, CacheEntry, CachePolicy, CallExpr, CaseExpr, CaseWhenExpr, CheckpointAdapter, CheckpointStore, Clock, ColumnExpr, ColumnInput, CompareExpr, CompareOp, ConditionalObjectStore, ConditionalPutOptions, CreateParquetTableAsOptions, CreateParquetTableAsQuery, CreateParquetTableAsResult, CsvStreamOptions, DecodedIcebergDeletes, DecodedIcebergParquetDeletes, ERROR_CODES, EngineFilePlan, EngineTable, ErrorDetails, ExplainJson, ExplainResult, Expr, GeoBackend, GeoJsonGeometry, IcebergAppendFile, IcebergAppendOptions, IcebergAppendOutputManifestOptions, IcebergAppendResult, IcebergCatalog, IcebergCommitCatalog, IcebergCommitInput, IcebergCommitResult, IcebergDeleteFile, IcebergDeletionVector, IcebergEnginePlan, IcebergEngineTable, IcebergEqualityDelete, IcebergField, IcebergGlueCatalogOptions, IcebergNessieCatalogOptions, IcebergParquetDeleteFile, IcebergParquetDeleteFileContent, IcebergPartitionField, IcebergPartitionSpec, IcebergPlan, IcebergPositionDelete, IcebergReadMode, IcebergRestCatalog, IcebergRestCatalogOptions, IcebergRowBatch, IcebergSortOrder, IcebergTable, IcebergTableIdentifier, IcebergUnsupportedCatalog, IdGenerator, InExpr, InMemoryLakeOptions, InMemoryRowsScanner, InMemoryRowsStore, InMemoryTableOptions, IndexPruneResult, IndexValue, InsertValidationRules, JoinKey, JoinType, JsonExpr, JsonOrderByTerm, JsonQueryV1, Lake, LakeConfig, LakeqlError, LakeqlErrorCode, LikeExpr, ListOptions, LiteralExpr, LoadIcebergEngineTableOptions, LoadIcebergTableFromObjectStoreOptions, LoadIcebergTableFromRestOptions, LoadIcebergTableOptions, LoadParquetEngineTableOptions, LoadTableOptions, LockAdapter, LogHook, LogicalExpr, LookupJoinFunction, LookupJoinOptions, Manifest, ManifestDeleteFile, ManifestFile, MemoryCache, MemoryCheckpointAdapter, MemoryObjectStore, MemorySpillAdapter, MemorySpillAdapterOptions, MetadataFile, MetricsHook, MinMaxColumnIndex, NotExpr, NullCheckExpr, ObjectHead, ObjectInfo, ObjectStoreCacheOptions, ObjectStoreIcebergCommitCatalog, ObjectStoreReadControls, OperatorSnapshotValue, OrderByTerm, OutputManifest, OutputManifestEntry, PACKAGE, ParquetColumnBatch, ParquetEnginePlan, ParquetEngineTable, ParquetLakeConfig, ParquetMetadata, ParquetRowBatch, ParquetRowGroupPlan, ParquetScanAdapter, PartitionedParquetOutputEntryOptions, PathQueryInit, PlanIcebergFilesOptions, PlanParquetRowGroupsOptions, PlanParquetTaskWorkUnitsOptions, PlannedIcebergFile, PlannedParquetRowGroup, PredicatePlan, PredicatePlanOptions, ProjectIcebergRowOptions, PutOptions, QueryBudget, QueryBuilder, QueryPolicy, QueryPolicyContext, QueryResult, QueryRunOptions, QueryStats, QueueAdapter, ReadParquetBatchOptions, ReadParquetOptions, ResumableBatchOptions, ResumedQuery, Row, RuntimeSubstrate, Scalar, ScanAdapter, ScanBatch, ScanColumnBatch, ScanEngineOptions, ScanOptions, ScanParquetTaskOptions, ScanPlannedIcebergRowsOptions, ScanTaskPlan, ScanTaskPlanOptions, ScanVectorBatch, Selection, SharedCacheEntry, SharedCacheSetOptions, SharedMemoryCache, SidecarFileIndex, SliceOptions, SliceResult, Snapshot, SortOperatorState, SortOptions, SortResult, SortRunState, SpillAdapter, SpillRef, SpillUsage, SqlBoolean, TaskCheckpoint, TaskInput, TaskManifest, TaskManifestTask, TaskState, TaskTransitionInput, TimestampUnit, TimestampValue, TopKOperatorState, TopKOptions, TopKResult, ValueInput, Vector, VectorAggregateOptions, VectorAggregateSnapshotValue, VectorAggregateState, VectorAggregateStateSnapshot, VectorAggregateStateSnapshots, VectorAggregateStates, VectorAggregateValue, VectorGroup, VectorGroupByGroupSnapshot, VectorGroupByOptions, VectorGroupBySnapshotValue, VectorGroupByState, VectorGroupByStateSnapshot, VectorHashJoinOptions, VectorProjectionSpec, VectorTopKOptions, WorkUnitFanInOptions, WriteParquetOptions, WriteParquetRowsOptions, WritePartitionedParquetFile, WritePartitionedParquetResult, WritePartitionedParquetTaskOptions, WritePartitionedParquetTaskResult, add, advanceTaskCheckpoint, aggregateParquetGroupTask, aggregateParquetGroupTasks, aggregateParquetGroupTasksBatch, aggregateParquetTask, aggregateParquetTasks, and, applyIcebergDeletes, assertBookmarkMatches, asyncBufferFromStore, batchExprValues, batchFromColumns, batchFromVectors, bboxIntersects, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, cachedObjectStore, classifyPredicate, col, compareTimestampValues, concatBatches, createBookmark, createInMemoryLake, createLake, createOutputManifest, createOutputManifestFromCheckpoints, createLake as createParquetLake, createParquetTableAs, createTaskManifest, createVectorAggregateStates, createVectorGroupByState, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, div, encodeJsonLine, enforceVectorGroupByBudget, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, eq, evaluate, fanInWorkUnits, finalizeVectorAggregateStates, finalizeVectorGroupByBatch, finalizeVectorGroupByRows, fingerprint, fn, gatherBatch, getOrCreateVectorGroup, gt, gte, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, ilike, inMemoryRowsScanner, isIn, isLakeqlError, isNotNull, isNull, isTimestampValue, jsonSafeValue, jsonWorkUnitBoundary, like, lit, loadGeoBackend, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, lookupJoin, lt, lte, matches, materializeBatchRows, materializeSelectedBatchRows, memoryCache, memoryCheckpointAdapter, memorySpillAdapter, memoryStore, mergeVectorAggregateStateSnapshots, mergeVectorAggregateStates, mergeVectorGroupByStates, mod, mul, ne, not, notIn, or, parquetScanner, parseGeometry, parseHivePartitions, parseJsonQuery, partitionedParquetOutputEntries, planFiles, planParquetTaskWorkUnits, planRowGroups, planRowGroupsFromMetadata, predicateSelection, pruneFilesWithIndex, readControlSignal, readIcebergParquetDeletes, readOutputManifest, readParquetColumnBatches, readParquetMetadata, readParquetObjectBatches, readParquetObjects, rejectUnsupportedParquetSchema, requireGeoBackend, restoreVectorAggregateStates, restoreVectorGroupByState, rowGroupMayMatch, rowGroupMustMatch, scalarVectorValue, scanBatches, scanParquetTaskBatches, scanParquetTaskColumnBatches, scanPlannedIcebergRows, scanRows, selectedRowCount, selectedRowIndices, serializeAggregateOperatorState, serializeSortOperatorState, serializeTopKOperatorState, setGeoBackend, signPaginationToken, snapshotVectorAggregateStates, snapshotVectorGroupByState, stableStringify, sub, throwIfAborted, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry, transitionTaskCheckpoint, tryPredicateSelection, updateVectorAggregateStateValue, updateVectorAggregateStates, updateVectorGroupAggregateValue, updateVectorGroupByState, vectorAggregateBatch, vectorFromValues, vectorGroupByBatch, vectorHashJoin, vectorLength, vectorOrderByBatch, vectorProjectBatch, vectorSortIndices, vectorTopKBatch, vectorTopKIndices, vectorValue, verifyPaginationToken, withObjectStoreReadControls, writeOutputManifest, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './index.js';
1
+ import { CacheAdapter, ObjectStore } from './index.js';
2
+ export { AggregateExpr, AggregateGroupSnapshot, AggregateOp, AggregateOperatorState, AggregateOptions, AggregateParquetGroupTaskOptions, AggregateParquetGroupTasksOptions, AggregateParquetTaskOptions, AggregateParquetTasksOptions, AggregateResult, AggregateSnapshotValue, AggregateSpec, AggregateStateSnapshot, AggregationBuilder, ApplyIcebergDeletesOptions, ArithmeticExpr, BBox, BBoxIndex, Batch, BatchExprValues, BetweenExpr, Bookmark, BookmarkInit, BookmarkPosition, BookmarkQuery, BroadcastJoinOptions, CacheApiCache, CacheApiCacheOptions, CacheEntry, CachePolicy, CallExpr, CaseExpr, CaseWhenExpr, CheckpointAdapter, CheckpointStore, Clock, ColumnExpr, ColumnInput, CompareExpr, CompareOp, CompatibleWindowSortGroup, CompatibleWindowSortItem, ConditionalObjectStore, ConditionalPutOptions, CreateParquetTableAsOptions, CreateParquetTableAsQuery, CreateParquetTableAsResult, CsvStreamOptions, DecodedIcebergDeletes, DecodedIcebergParquetDeletes, ERROR_CODES, EngineFilePlan, EngineTable, ErrorDetails, ExplainJson, ExplainResult, Expr, GeoBackend, GeoJsonGeometry, IcebergAppendFile, IcebergAppendOptions, IcebergAppendOutputManifestOptions, IcebergAppendResult, IcebergCatalog, IcebergCommitCatalog, IcebergCommitInput, IcebergCommitResult, IcebergDeleteFile, IcebergDeletionVector, IcebergEnginePlan, IcebergEngineTable, IcebergEqualityDelete, IcebergField, IcebergGlueCatalogOptions, IcebergLoadTableOptions, IcebergNessieCatalogOptions, IcebergParquetDeleteFile, IcebergParquetDeleteFileContent, IcebergPartitionField, IcebergPartitionSpec, IcebergPlan, IcebergPositionDelete, IcebergReadMode, IcebergRestAccessDelegation, IcebergRestCatalog, IcebergRestCatalogConfig, IcebergRestCatalogOptions, IcebergRestLoadContext, IcebergRestLoadTableOptions, IcebergRestLoadTableResult, IcebergRestStorageCredential, IcebergRowBatch, IcebergSortOrder, IcebergTable, IcebergTableIdentifier, IcebergUnsupportedCatalog, IdGenerator, InExpr, InMemoryLakeOptions, InMemoryRowsScanner, InMemoryRowsStore, InMemoryTableOptions, IndexPruneResult, IndexValue, InsertValidationRules, IntervalValue, JoinKey, JoinType, JsonExpr, JsonOrderByTerm, JsonQueryV1, Lake, LakeConfig, LakeqlError, LakeqlErrorCode, LikeExpr, ListOptions, LiteralExpr, LoadIcebergEngineTableOptions, LoadIcebergTableFromObjectStoreOptions, LoadIcebergTableFromRestOptions, LoadIcebergTableOptions, LoadParquetEngineTableOptions, LoadTableOptions, LockAdapter, LogHook, LogicalExpr, LookupJoinFunction, LookupJoinOptions, Manifest, ManifestDeleteFile, ManifestFile, MemoryCache, MemoryCheckpointAdapter, MemoryObjectStore, MemorySpillAdapter, MemorySpillAdapterOptions, MetadataFile, MetricsHook, MinMaxColumnIndex, NotExpr, NullCheckExpr, ObjectHead, ObjectInfo, ObjectStoreCacheOptions, ObjectStoreIcebergCommitCatalog, ObjectStoreJsonCache, ObjectStoreJsonCacheOptions, ObjectStoreReadControls, ObjectStoreUriAuthority, OperatorSnapshotValue, OrderByTerm, OutputManifest, OutputManifestEntry, PACKAGE, ParquetColumnBatch, ParquetEnginePlan, ParquetEngineTable, ParquetLakeConfig, ParquetMetadata, ParquetRowBatch, ParquetRowGroupPlan, ParquetScanAdapter, PartitionedParquetOutputEntryOptions, PathQueryInit, PlanIcebergFilesOptions, PlanParquetRowGroupsOptions, PlanParquetTaskWorkUnitsOptions, PlannedIcebergFile, PlannedParquetRowGroup, PredicatePlan, PredicatePlanOptions, ProjectIcebergRowOptions, PutOptions, QueryBudget, QueryBuilder, QueryPolicy, QueryPolicyContext, QueryResult, QueryRunOptions, QueryStats, QueueAdapter, ReadParquetBatchOptions, ReadParquetOptions, ResumableBatchOptions, ResumedQuery, Row, RuntimeSubstrate, Scalar, ScanAdapter, ScanBatch, ScanColumnBatch, ScanEngineOptions, ScanOptions, ScanParquetTaskOptions, ScanPlannedIcebergRowsOptions, ScanTaskPlan, ScanTaskPlanOptions, ScanVectorBatch, Selection, SharedCacheEntry, SharedCacheSetOptions, SharedMemoryCache, SidecarFileIndex, SliceOptions, SliceResult, Snapshot, SortOperatorState, SortOptions, SortResult, SortRunState, SpillAdapter, SpillRef, SpillUsage, SqlBoolean, TaskCheckpoint, TaskInput, TaskManifest, TaskManifestTask, TaskState, TaskTransitionInput, TimestampUnit, TimestampValue, TopKOperatorState, TopKOptions, TopKResult, ValueInput, Vector, VectorAggregateOptions, VectorAggregateSnapshotValue, VectorAggregateState, VectorAggregateStateSnapshot, VectorAggregateStateSnapshots, VectorAggregateStates, VectorAggregateValue, VectorGroup, VectorGroupByGroupSnapshot, VectorGroupByOptions, VectorGroupBySnapshotValue, VectorGroupByState, VectorGroupByStateSnapshot, VectorHashJoinOptions, VectorProjectionSpec, VectorTopKOptions, WindowExecutionMode, WindowExplainPlan, WindowExpr, WindowFn, WindowFrame, WindowFrameBound, WindowOperatorState, WindowOptions, WindowOrderTerm, WindowParquetTasksOptions, WindowRankingFn, WindowReadColumnInput, WindowResult, WindowRunState, WindowSnapshotValue, WindowSpec, WindowTaskExecutionOptions, WindowTaskPlan, WindowValueFn, WindowWorkUnitBucket, WindowWorkUnitEvaluationOptions, WindowWorkUnitOrdinal, WindowWorkUnitPartial, WindowWorkUnitRow, WorkUnitFanInOptions, WriteParquetOptions, WriteParquetRowsOptions, WritePartitionedParquetFile, WritePartitionedParquetResult, WritePartitionedParquetTaskOptions, WritePartitionedParquetTaskResult, add, advanceTaskCheckpoint, aggregateParquetGroupTask, aggregateParquetGroupTasks, aggregateParquetGroupTasksBatch, aggregateParquetTask, aggregateParquetTasks, and, applyIcebergDeletes, applyIntervalToTimestamp, assertBookmarkMatches, asyncBufferFromStore, batchExprValues, batchFromColumns, batchFromVectors, bboxDistance, bboxIntersects, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, cachedObjectStore, classifyPredicate, col, collectExprColumns, collectWindowColumns, compareTimestampValues, compatibleWindowSortGroups, concatBatches, createBookmark, createInMemoryLake, createLake, createOutputManifest, createOutputManifestFromCheckpoints, createLake as createParquetLake, createParquetTableAs, createTaskManifest, createVectorAggregateStates, createVectorGroupByState, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, deserializeWindowOperatorState, div, encodeJsonLine, enforceVectorGroupByBudget, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, eq, evaluate, evaluateWindowWorkUnitPartials, fanInWorkUnits, finalizeVectorAggregateStates, finalizeVectorGroupByBatch, finalizeVectorGroupByRows, fingerprint, fn, gatherBatch, geometryDistance, getOrCreateVectorGroup, gt, gte, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, ilike, inMemoryRowsScanner, intervalToString, intervalValue, isIn, isIntervalValue, isLakeqlError, isNonNegativeInterval, isNotNull, isNull, isPrototypeMutationKey, isTimestampValue, jsonSafeValue, jsonWorkUnitBoundary, like, lit, loadGeoBackend, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, lookupJoin, lt, lte, matches, materializeBatchRow, materializeBatchRows, materializeSelectedBatchRows, memoryCache, memoryCheckpointAdapter, memorySpillAdapter, memoryStore, mergeVectorAggregateStateSnapshots, mergeVectorAggregateStates, mergeVectorGroupByStates, mod, mul, ne, not, notIn, objectStoreJsonCache, or, parquetScanner, parseGeometry, parseHivePartitions, parseJsonQuery, partitionWindowWorkUnitRows, partitionedParquetOutputEntries, planFiles, planParquetTaskWorkUnits, planRowGroups, planRowGroupsFromMetadata, predicateSelection, pruneFilesWithIndex, readControlSignal, readIcebergParquetDeletes, readOutputManifest, readParquetColumnBatches, readParquetMetadata, readParquetObjectBatches, readParquetObjects, rejectUnsupportedParquetSchema, requireGeoBackend, restoreVectorAggregateStates, restoreVectorGroupByState, rowGroupMayMatch, rowGroupMustMatch, scalarVectorValue, scanBatches, scanParquetTaskBatches, scanParquetTaskColumnBatches, scanPlannedIcebergRows, scanRows, selectedRowCount, selectedRowIndices, serializeAggregateOperatorState, serializeSortOperatorState, serializeTopKOperatorState, serializeWindowOperatorState, setGeoBackend, signPaginationToken, snapshotVectorAggregateStates, snapshotVectorGroupByState, stableStringify, sub, throwIfAborted, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry, transitionTaskCheckpoint, tryPredicateSelection, updateVectorAggregateStateValue, updateVectorAggregateStates, updateVectorGroupAggregateValue, updateVectorGroupByState, uriObjectStore, vectorAggregateBatch, vectorFromValues, vectorGroupByBatch, vectorHashJoin, vectorLength, vectorOrderByBatch, vectorProjectBatch, vectorSortIndices, vectorTopKBatch, vectorTopKIndices, vectorValue, verifyPaginationToken, windowExpressions, windowOperatorState, windowOperatorStateFromRuns, windowParquetTask, windowParquetTasks, windowPartitionBucket, windowReadColumns, windowRowsFromState, windowSortGroupCount, windowSortSpecsCompatible, windowTaskPlanForWindows, withObjectStoreReadControls, writeOutputManifest, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './index.js';
3
3
  import 'hyparquet-writer';
4
4
  import 'hyparquet';
5
5
 
6
+ interface D1DatabaseLike {
7
+ prepare(query: string): D1PreparedStatementLike;
8
+ }
9
+ interface D1PreparedStatementLike {
10
+ bind(...values: unknown[]): D1PreparedStatementLike;
11
+ first<T = unknown>(column?: string): Promise<T | null>;
12
+ run(): Promise<unknown>;
13
+ }
14
+ interface CloudflareD1JsonCacheOptions {
15
+ db: D1DatabaseLike;
16
+ table?: string;
17
+ prefix?: string;
18
+ ttlMs?: number;
19
+ now?: () => number;
20
+ createTable?: boolean;
21
+ }
6
22
  interface R2ObjectBody {
7
23
  key: string;
8
24
  size: number;
@@ -39,5 +55,6 @@ interface R2BucketLike {
39
55
  }>;
40
56
  }
41
57
  declare function r2Store(bucket: R2BucketLike): ObjectStore;
58
+ declare function cloudflareD1JsonCache<T = unknown>(options: CloudflareD1JsonCacheOptions): CacheAdapter<T>;
42
59
 
43
- export { ObjectStore, r2Store };
60
+ export { CacheAdapter, ObjectStore, cloudflareD1JsonCache, r2Store };
@@ -1,12 +1,81 @@
1
- export { IcebergRestCatalog, IcebergTable, IcebergUnsupportedCatalog, InMemoryRowsScanner, InMemoryRowsStore, ObjectStoreIcebergCommitCatalog, PACKAGE, applyIcebergDeletes, createInMemoryLake, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, inMemoryRowsScanner, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, planFiles, scanBatches, scanPlannedIcebergRows, scanRows, vectorHashJoin } from './chunk-BFLGC6Y5.js';
2
- export { AggregationBuilder, CacheApiCache, Lake, MemoryCache, MemoryCheckpointAdapter, MemoryObjectStore, MemorySpillAdapter, ParquetScanAdapter, QueryBuilder, QueryResult, ResumedQuery, SharedMemoryCache, add, advanceTaskCheckpoint, aggregateParquetGroupTask, aggregateParquetGroupTasks, aggregateParquetGroupTasksBatch, aggregateParquetTask, aggregateParquetTasks, and, assertBookmarkMatches, asyncBufferFromStore, batchExprValues, batchFromColumns, batchFromVectors, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, cachedObjectStore, classifyPredicate, col, concatBatches, createBookmark, createParquetLake as createLake, createOutputManifest, createOutputManifestFromCheckpoints, createParquetLake, createParquetTableAs, createTaskManifest, createVectorAggregateStates, createVectorGroupByState, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, div, enforceVectorGroupByBudget, eq, fanInWorkUnits, finalizeVectorAggregateStates, finalizeVectorGroupByBatch, finalizeVectorGroupByRows, fingerprint, fn, gatherBatch, getOrCreateVectorGroup, gt, gte, ilike, isIn, isNotNull, isNull, jsonWorkUnitBoundary, like, lit, lookupJoin, lt, lte, materializeBatchRows, materializeSelectedBatchRows, memoryCache, memoryCheckpointAdapter, memorySpillAdapter, memoryStore, mergeVectorAggregateStateSnapshots, mergeVectorAggregateStates, mergeVectorGroupByStates, mod, mul, ne, not, notIn, or, parquetScanner, parseHivePartitions, parseJsonQuery, partitionedParquetOutputEntries, planParquetTaskWorkUnits, planRowGroups, planRowGroupsFromMetadata, predicateSelection, pruneFilesWithIndex, readControlSignal, readIcebergParquetDeletes, readOutputManifest, readParquetColumnBatches, readParquetMetadata, readParquetObjectBatches, readParquetObjects, rejectUnsupportedParquetSchema, restoreVectorAggregateStates, restoreVectorGroupByState, rowGroupMayMatch, rowGroupMustMatch, scalarVectorValue, scanParquetTaskBatches, scanParquetTaskColumnBatches, selectedRowCount, selectedRowIndices, serializeAggregateOperatorState, serializeSortOperatorState, serializeTopKOperatorState, signPaginationToken, snapshotVectorAggregateStates, snapshotVectorGroupByState, stableStringify, sub, throwIfAborted, transitionTaskCheckpoint, tryPredicateSelection, updateVectorAggregateStateValue, updateVectorAggregateStates, updateVectorGroupAggregateValue, updateVectorGroupByState, vectorAggregateBatch, vectorFromValues, vectorGroupByBatch, vectorLength, vectorOrderByBatch, vectorProjectBatch, vectorSortIndices, vectorTopKBatch, vectorTopKIndices, vectorValue, verifyPaginationToken, withObjectStoreReadControls, writeOutputManifest, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './chunk-RZL45ZSN.js';
3
- import { LakeqlError } from './chunk-TFD5RFKB.js';
4
- export { ERROR_CODES, LakeqlError, TimestampValue, bboxIntersects, compareTimestampValues, encodeJsonLine, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, evaluate, isLakeqlError, isTimestampValue, jsonSafeValue, loadGeoBackend, matches, parseGeometry, requireGeoBackend, setGeoBackend, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry } from './chunk-TFD5RFKB.js';
1
+ export { IcebergRestCatalog, IcebergTable, IcebergUnsupportedCatalog, InMemoryRowsScanner, InMemoryRowsStore, ObjectStoreIcebergCommitCatalog, ObjectStoreJsonCache, PACKAGE, applyIcebergDeletes, createInMemoryLake, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, inMemoryRowsScanner, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, objectStoreJsonCache, planFiles, scanBatches, scanPlannedIcebergRows, scanRows, vectorHashJoin } from './chunk-2XZJK7EF.js';
2
+ export { AggregationBuilder, CacheApiCache, Lake, MemoryCache, MemoryObjectStore, MemorySpillAdapter, ParquetScanAdapter, QueryBuilder, QueryResult, ResumedQuery, SharedMemoryCache, add, aggregateParquetGroupTask, aggregateParquetGroupTasks, aggregateParquetGroupTasksBatch, aggregateParquetTask, aggregateParquetTasks, and, asyncBufferFromStore, batchExprValues, batchFromColumns, batchFromVectors, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, cachedObjectStore, classifyPredicate, col, concatBatches, createParquetLake as createLake, createParquetLake, createParquetTableAs, createVectorAggregateStates, createVectorGroupByState, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, deserializeWindowOperatorState, div, enforceVectorGroupByBudget, eq, evaluateWindowWorkUnitPartials, fanInWorkUnits, finalizeVectorAggregateStates, finalizeVectorGroupByBatch, finalizeVectorGroupByRows, fn, gatherBatch, getOrCreateVectorGroup, gt, gte, ilike, isIn, isNotNull, isNull, jsonWorkUnitBoundary, like, lit, lookupJoin, lt, lte, materializeBatchRow, materializeBatchRows, materializeSelectedBatchRows, memoryCache, memorySpillAdapter, memoryStore, mergeVectorAggregateStateSnapshots, mergeVectorAggregateStates, mergeVectorGroupByStates, mod, mul, ne, not, notIn, or, parquetScanner, parseHivePartitions, parseJsonQuery, partitionWindowWorkUnitRows, partitionedParquetOutputEntries, planParquetTaskWorkUnits, planRowGroups, planRowGroupsFromMetadata, predicateSelection, pruneFilesWithIndex, readControlSignal, readIcebergParquetDeletes, readParquetColumnBatches, readParquetMetadata, readParquetObjectBatches, readParquetObjects, rejectUnsupportedParquetSchema, restoreVectorAggregateStates, restoreVectorGroupByState, rowGroupMayMatch, rowGroupMustMatch, scalarVectorValue, scanParquetTaskBatches, scanParquetTaskColumnBatches, selectedRowCount, selectedRowIndices, serializeAggregateOperatorState, serializeSortOperatorState, serializeTopKOperatorState, serializeWindowOperatorState, snapshotVectorAggregateStates, snapshotVectorGroupByState, sub, throwIfAborted, tryPredicateSelection, updateVectorAggregateStateValue, updateVectorAggregateStates, updateVectorGroupAggregateValue, updateVectorGroupByState, uriObjectStore, vectorAggregateBatch, vectorFromValues, vectorGroupByBatch, vectorLength, vectorOrderByBatch, vectorProjectBatch, vectorSortIndices, vectorTopKBatch, vectorTopKIndices, vectorValue, windowOperatorState, windowOperatorStateFromRuns, windowParquetTask, windowParquetTasks, windowPartitionBucket, windowRowsFromState, withObjectStoreReadControls, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './chunk-6XXXYVXT.js';
3
+ export { MemoryCheckpointAdapter, advanceTaskCheckpoint, assertBookmarkMatches, collectExprColumns, collectWindowColumns, compatibleWindowSortGroups, createBookmark, createOutputManifest, createOutputManifestFromCheckpoints, createTaskManifest, fingerprint, isPrototypeMutationKey, memoryCheckpointAdapter, readOutputManifest, signPaginationToken, stableStringify, transitionTaskCheckpoint, verifyPaginationToken, windowExpressions, windowReadColumns, windowSortGroupCount, windowSortSpecsCompatible, windowTaskPlanForWindows, writeOutputManifest } from './chunk-ZVHJD6R3.js';
4
+ import { LakeqlError } from './chunk-4VJQ56HF.js';
5
+ export { ERROR_CODES, LakeqlError, TimestampValue, applyIntervalToTimestamp, bboxDistance, bboxIntersects, compareTimestampValues, encodeJsonLine, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, evaluate, geometryDistance, intervalToString, intervalValue, isIntervalValue, isLakeqlError, isNonNegativeInterval, isTimestampValue, jsonSafeValue, loadGeoBackend, matches, parseGeometry, requireGeoBackend, setGeoBackend, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry } from './chunk-4VJQ56HF.js';
5
6
 
6
7
  // ../r2/dist/index.js
7
8
  function r2Store(bucket) {
8
9
  return new R2ObjectStore(bucket);
9
10
  }
11
+ function cloudflareD1JsonCache(options) {
12
+ return new CloudflareD1JsonCache(options);
13
+ }
14
+ var CloudflareD1JsonCache = class {
15
+ db;
16
+ table;
17
+ prefix;
18
+ ttlMs;
19
+ now;
20
+ createTable;
21
+ ensurePromise;
22
+ constructor(options) {
23
+ this.db = options.db;
24
+ this.table = validatedD1Identifier(options.table ?? "lakeql_cache");
25
+ this.prefix = options.prefix ?? "lakeql";
26
+ this.ttlMs = options.ttlMs;
27
+ this.now = options.now ?? Date.now;
28
+ this.createTable = options.createTable ?? true;
29
+ }
30
+ async get(key) {
31
+ await this.ensureTable();
32
+ const cacheKey = this.cacheKey(key);
33
+ const row = await this.db.prepare(`select value, expires_at from ${this.table} where key = ?1`).bind(cacheKey).first();
34
+ if (row === null)
35
+ return void 0;
36
+ const expiresAt = row.expires_at ?? void 0;
37
+ if (expiresAt !== void 0 && expiresAt <= this.now()) {
38
+ await this.delete(key);
39
+ return void 0;
40
+ }
41
+ const value = JSON.parse(row.value);
42
+ const entry = { value };
43
+ if (expiresAt !== void 0)
44
+ entry.expiresAt = expiresAt;
45
+ return entry;
46
+ }
47
+ async set(key, entry) {
48
+ await this.ensureTable();
49
+ const json = jsonCacheValue(entry.value, key);
50
+ const expiresAt = entry.expiresAt ?? (this.ttlMs === void 0 ? void 0 : this.now() + this.ttlMs);
51
+ await this.db.prepare(`insert into ${this.table} (key, value, expires_at, updated_at)
52
+ values (?1, ?2, ?3, ?4)
53
+ on conflict(key) do update set
54
+ value = excluded.value,
55
+ expires_at = excluded.expires_at,
56
+ updated_at = excluded.updated_at`).bind(this.cacheKey(key), json, expiresAt ?? null, this.now()).run();
57
+ }
58
+ async delete(key) {
59
+ await this.ensureTable();
60
+ await this.db.prepare(`delete from ${this.table} where key = ?1`).bind(this.cacheKey(key)).run();
61
+ }
62
+ cacheKey(key) {
63
+ return `${this.prefix}:${key}`;
64
+ }
65
+ async ensureTable() {
66
+ if (!this.createTable)
67
+ return;
68
+ if (this.ensurePromise === void 0) {
69
+ this.ensurePromise = this.db.prepare(`create table if not exists ${this.table} (
70
+ key text primary key,
71
+ value text not null,
72
+ expires_at integer,
73
+ updated_at integer not null
74
+ )`).run().then(() => void 0);
75
+ }
76
+ await this.ensurePromise;
77
+ }
78
+ };
10
79
  var R2ObjectStore = class {
11
80
  bucket;
12
81
  constructor(bucket) {
@@ -77,5 +146,36 @@ function r2Info(object) {
77
146
  info.lastModified = object.uploaded;
78
147
  return info;
79
148
  }
149
+ function validatedD1Identifier(value) {
150
+ if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(value)) {
151
+ throw new LakeqlError("LAKEQL_VALIDATION_ERROR", "D1 cache table name is invalid", {
152
+ table: value
153
+ });
154
+ }
155
+ return value;
156
+ }
157
+ function jsonCacheValue(value, key) {
158
+ if (value === void 0) {
159
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", "D1 JSON cache value is not JSON serializable", {
160
+ key
161
+ });
162
+ }
163
+ try {
164
+ const json = JSON.stringify(value);
165
+ if (json === void 0) {
166
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", "D1 JSON cache value is not JSON serializable", {
167
+ key
168
+ });
169
+ }
170
+ return json;
171
+ } catch (cause) {
172
+ if (cause instanceof LakeqlError)
173
+ throw cause;
174
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", "D1 JSON cache value is not JSON serializable", {
175
+ key,
176
+ cause
177
+ });
178
+ }
179
+ }
80
180
 
81
- export { r2Store };
181
+ export { cloudflareD1JsonCache, r2Store };
@@ -1,4 +1,4 @@
1
- import { setGeoBackend } from './chunk-TFD5RFKB.js';
1
+ import { setGeoBackend } from './chunk-4VJQ56HF.js';
2
2
  import { booleanContains } from '@turf/boolean-contains';
3
3
  import { booleanIntersects } from '@turf/boolean-intersects';
4
4
  import { latLngToCell, isValidCell, gridDisk, cellToParent } from 'h3-js';