Skip to content

Conversation

@mpetazzoni
Copy link
Member

@mpetazzoni mpetazzoni commented Jan 18, 2026

Summary

Adds support for the store capability from the SQL API, allowing query results to be stored in cloud storage instead of being returned directly over the WebSocket connection.

  • Add Store configuration class with for_download() convenience method
  • Add StorageFormat enum (parquet, csv, geojson)
  • Add StoreResult dataclass to capture the result URI and size
  • Add store parameter to cursor.execute()
  • Add cursor.get_store_result() method to retrieve store results
  • Reorganize internal types and models into dedicated modules (types.py, models.py)

Usage

from wherobots.db import connect, Store, StorageFormat

conn = connect(api_key=api_key, runtime=Runtime.TINY)
cursor = conn.cursor()

# Store results with a presigned URL for download
cursor.execute("SELECT * FROM my_table", store=Store.for_download())
store_result = cursor.get_store_result()
print(f"Results at: {store_result.result_uri} ({store_result.size} bytes)")

# Or with a specific format
cursor.execute("SELECT * FROM my_table", store=Store.for_download(StorageFormat.CSV))

@mpetazzoni mpetazzoni force-pushed the max/feature/store-results-support branch from 3468475 to 605dc8b Compare January 19, 2026 00:04
@mpetazzoni
Copy link
Member Author

Replaces #39.

@mpetazzoni mpetazzoni marked this pull request as ready for review January 19, 2026 00:10
@mpetazzoni mpetazzoni force-pushed the max/feature/store-results-support branch from a6d11c2 to 1126739 Compare January 19, 2026 04:44
- Move enums (ExecutionState, RequestKind, EventKind, etc.) from constants.py to types.py
- Move dataclasses (Store, StoreResult, ExecutionResult) from store.py/results.py to models.py
- Delete store.py and results.py
- Update all imports across the codebase
@mpetazzoni mpetazzoni force-pushed the max/feature/store-results-support branch from 1126739 to 3c57867 Compare January 19, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants