Comments (10)
Thanks for reporting this. Makes sense to fix this. I'd like to have a quick discussion on how to fix this because we can't simply change the type of the field as that'd change the API, potentially breaking user's code. Specially if we want to support >4GB files as that requires a custom scalar (64 bits numbers are not directly supported by the graphql spec)
My proposal is as follows:
Add new columns max_upload_file_size_unit
and min_upload_file_size_unit
of type strings. This fields could only be either b
, k
, m
or g
and basically would dictate whether the values in {min,max}_upload_file_size
are defined as bytes, kilobytes, megabytes or gigabytes. The fields would default to b
to keep the existing behavior.
Alternatively we could add new min/max columns where we allow representing file sizes as "50m"
, "4g"
but I think that complicates the migration path as we need to somehow sync old and new columns while users migrate (which we could do with triggers I guess). It may also be a bit more brittle as users could introduce values that can't be parsed so we'd need to account for that.
Thoughts?
from hasura-storage.
I like adding size unit. That should preserve backward compat, with default to bytes.
I'd suggest to KISS and add just a single column upload_file_size_unit
for both min and max. I see little use case where someone would need min and max to be different units. As a matter of fact, one would want unit the same for both for consistency: either all bytes or all mb, etc.
from hasura-storage.
Yeah, there are theoretical cases where that might not work (imagine wanting a very small minimum amount and a very large maximum amount) but they are probably unrealistic cases so I am leaning towards a single column like you suggested
from hasura-storage.
This looks good to me.
from hasura-storage.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from hasura-storage.
Not stale.
from hasura-storage.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from hasura-storage.
Not stale still wanted
from hasura-storage.
Is there any progress on this?
from hasura-storage.
No progress yet as this hasn't been a priority. If this is a must for you don't hesitate to reach out to us via discord/email so we can discuss it. Thanks!
from hasura-storage.
Related Issues (20)
- Manual migrations HOT 7
- How to handle secret injection HOT 9
- How to upload file using <input type=file />? HOT 1
- Add X-Hasura-Role in CORS headers HOT 1
- Storage.files table should have a metadata column (like auth.users) HOT 5
- Storage.buckets table should be enum HOT 4
- Image transformation (quality) does not seem to work properly HOT 4
- Allow admin role to create pre-signed URLs with arbitrary expirations HOT 2
- Documentation for using hasura-storage outside of nhost
- Compatibility with Hasura graphql-default naming convention HOT 1
- openapi docs: /presignedurl, not /presigned HOT 1
- Generate multiple presigned urls from a single request HOT 2
- investigate potential memory leak with image manipulation HOT 1
- Upgrading to v0.4.0 causes application panic HOT 3
- Forwarding Content-Length and Content-Type breaks upload flow HOT 1
- Migartions database name should be configurable HOT 2
- v0.5.0 - s3-endpoint breaking change HOT 3
- Image orientation metadata lost when transformations applied HOT 3
- Service unable to restart after crashing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hasura-storage.