Skip to content

Support multipart upload#999

Merged
LeMikaelF merged 4 commits into
mainfrom
multipart-upload
Dec 11, 2025
Merged

Support multipart upload#999
LeMikaelF merged 4 commits into
mainfrom
multipart-upload

Conversation

@LeMikaelF

@LeMikaelF LeMikaelF commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

I used the opportunity to also add tests for v1 upload.

AI disclosure

Claude wrote most of the code, but I revised it and iterated on it.

@LeMikaelF LeMikaelF marked this pull request as ready for review December 10, 2025 03:22
@avinassh avinassh requested a review from Copilot December 11, 2025 14:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds multipart upload support for large database files to the Turso CLI, allowing efficient uploads of files over 100MB. The implementation includes comprehensive test coverage for both single-part (v1) and multipart (v2) upload flows, with proper progress tracking and error handling.

Key changes:

  • Added multipart upload implementation with automatic threshold-based selection (100MB)
  • Implemented comprehensive test suite for upload functionality with mock server
  • Added --multipart flag to force multipart upload mode

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/turso/tursoServer_test.go Comprehensive test suite with mock server, test helpers, and tests for single-part, multipart, and progress tracking functionality
internal/turso/tursoServer.go Core multipart upload implementation with chunk management, progress tracking, and file locking
internal/turso/turso.go Added PutBinary method and Content-Length header handling for chunk uploads
internal/turso/databases.go Integrated multipart upload logic with automatic threshold-based selection (100MB)
internal/cmd/group_flag.go Updated flag parsing functions to support multipart parameter
internal/cmd/db_create.go Added multipart flag parameter to database creation flow
internal/cmd/db_import.go Declared and registered --multipart flag for import command
go.mod Added testify dependency for improved test assertions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/turso/tursoServer.go
Comment thread internal/turso/tursoServer.go Outdated
Comment thread internal/cmd/group_flag.go
Comment thread internal/cmd/db_create.go
Comment thread internal/turso/databases.go
Comment thread internal/turso/databases.go Outdated
Comment thread internal/turso/turso.go Outdated
Comment thread internal/turso/tursoServer.go
Comment thread internal/turso/tursoServer.go
@LeMikaelF

Copy link
Copy Markdown
Contributor Author

This PR is good to go, but this error in CI prevents me from merging:

⣾ Creating group t74e5er2qqazsnbufj-aws-us-east-1 at aws-us-east-1...
Error: received response with status code 400: Input error: unable to register exclusive lock on node ["93595be9-ea47-11ed-9933-bed7d3860eaa"] (deletion must be in progress)

I'm investigating ⌛

@LeMikaelF LeMikaelF merged commit a6966e7 into main Dec 11, 2025
3 of 4 checks passed
@LeMikaelF LeMikaelF deleted the multipart-upload branch December 11, 2025 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants