Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for file metadata, info and exists #694

Merged
merged 16 commits into from
Jan 15, 2025
Merged

Conversation

jan-tennert
Copy link
Collaborator

@jan-tennert jan-tennert commented Aug 21, 2024

What kind of change does this PR introduce?

Feature

What is the new behavior?

Support for the new user metadata and the new exists and info methods.

client.storage["my-bucket"].upload("file.png", data) {
    userMetadata {
        put("key", "value")
    }
    //Or:
    userMetadata(myCustomObject)
}

Additionally, the Storage plugin now also provides the ability to set a custom serializer.

Additional context

See supabase/storage-js#207

@jan-tennert jan-tennert added the enhancement New feature or request label Aug 21, 2024
@jan-tennert jan-tennert self-assigned this Aug 21, 2024
# Conflicts:
#	Storage/src/commonMain/kotlin/io/github/jan/supabase/storage/BucketApiImpl.kt
@jan-tennert jan-tennert marked this pull request as ready for review August 25, 2024 12:03
@github-actions github-actions bot added the tests label Aug 25, 2024
# Conflicts:
#	Storage/src/commonMain/kotlin/io/github/jan/supabase/storage/BucketApi.kt
#	Storage/src/commonMain/kotlin/io/github/jan/supabase/storage/BucketApiImpl.kt
#	Storage/src/commonMain/kotlin/io/github/jan/supabase/storage/FileObject.kt
#	Storage/src/commonMain/kotlin/io/github/jan/supabase/storage/FlowExt.kt
#	Storage/src/commonTest/kotlin/BucketApiTest.kt
@marcprux
Copy link

Is there hope for the PR? I'm working on a package that provides parity between supabase-swift and supabase-kt, and info() and exists() are the two big missing bits of functionality.

@jan-tennert
Copy link
Collaborator Author

Is there hope for the PR? I'm working on a package that provides parity between supabase-swift and supabase-kt, and info() and exists() are the two big missing bits of functionality.

The PR is ready, @grdsdev?

@grdsdev
Copy link
Contributor

grdsdev commented Jan 15, 2025

Approved as this implementation seems to work with latest Storage API, just make sure the info method is working and CI is passing.

@jan-tennert jan-tennert merged commit 34ce185 into master Jan 15, 2025
13 checks passed
@jan-tennert jan-tennert deleted the storage-metadata branch January 15, 2025 18:01
@jan-tennert
Copy link
Collaborator Author

@marcprux will be included in the next version!

@marcprux
Copy link

Fabulous! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request storage tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants