@@ -56,26 +56,10 @@ func NewTursoServerClient(baseURL *url.URL, token string, cliVersion string, org
5656 }, nil
5757}
5858
59- const multipartThresholdBytes = 100 * 1024 * 1024 // 100MB
60-
61- // UploadFile uploads a file to the turso server
62- func (i * TursoServerClient ) UploadFile (filepath string , onUploadProgress func (progressPct int , uploadedBytes int64 , totalBytes int64 , elapsedTime time.Duration , done bool )) error {
63- stat , err := os .Stat (filepath )
64- if err != nil {
65- return fmt .Errorf ("failed to stat file %s: %w" , filepath , err )
66- }
67-
68- if stat .Size () > multipartThresholdBytes {
69- return i .UploadFileMultipart (filepath , onUploadProgress )
70- }
71-
72- return i .uploadFileSinglePart (filepath , onUploadProgress )
73- }
74-
75- // uploadFileSinglePart uploads a database file to the Turso server using a single request.
59+ // UploadFileSinglePart uploads a database file to the Turso server using a single request.
7660// it assumes a SQLite file exists at 'filepath'.
7761// it streams the file to the server, and calls the onProgress callback with the progress of the upload.
78- func (i * TursoServerClient ) uploadFileSinglePart (filepath string , onUploadProgress func (progressPct int , uploadedBytes int64 , totalBytes int64 , elapsedTime time.Duration , done bool )) error {
62+ func (i * TursoServerClient ) UploadFileSinglePart (filepath string , onUploadProgress func (progressPct int , uploadedBytes int64 , totalBytes int64 , elapsedTime time.Duration , done bool )) error {
7963 file , err := os .Open (filepath )
8064 if err != nil {
8165 return fmt .Errorf ("failed to open file %s: %w" , filepath , err )
0 commit comments