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

feat: added metadata column to files #170

Merged
merged 3 commits into from
Aug 16, 2023
Merged

feat: added metadata column to files #170

merged 3 commits into from
Aug 16, 2023

Conversation

dbarrosop
Copy link
Member

@dbarrosop dbarrosop commented Aug 16, 2023

Fixes #134 and #160

This basically introduces a new column metadata to the files table of type jsonb. The user can populate this with any data it wants by adding a metadata object to the metadata[] field in the multipart-form (metadata field when updating files). For instance:

curl http://localhost:8080/v1/files \
  -H "Content-Type: multipart/form-data" \
  -H "$AUTH" \
  -F "file[]=@client/testdata/alphabet.txt" \
  -F "metadata[]={\"metadata\":{\"num\":123,\"list\":[1,2,3]}};type=application/json"

In addition, we are moving away from the graphql client github.com/hasura/go-graphql-client to github.com/Yamashou/gqlgenc as I was running into some troubles dealing with jsonb objects. This has the side-effect the graphql code is much cleaner and easier to understand (this was long overdue to be honest).

@dbarrosop dbarrosop merged commit 996c8c2 into main Aug 16, 2023
5 checks passed
@dbarrosop dbarrosop deleted the dbarroso/metadata2 branch August 16, 2023 10:53
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.

Storage.files table should have a metadata column (like auth.users)
1 participant