GithubHelp home page GithubHelp logo

Comments (10)

dbarrosop avatar dbarrosop commented on May 23, 2024 3

/cc @elitan @nunopato

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.

fungilation avatar fungilation commented on May 23, 2024 3

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.

dbarrosop avatar dbarrosop commented on May 23, 2024 1

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.

nunopato avatar nunopato commented on May 23, 2024

This looks good to me.

from hasura-storage.

stale avatar stale commented on May 23, 2024

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.

fungilation avatar fungilation commented on May 23, 2024

Not stale.

from hasura-storage.

stale avatar stale commented on May 23, 2024

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.

fungilation avatar fungilation commented on May 23, 2024

Not stale still wanted

from hasura-storage.

compiaffe avatar compiaffe commented on May 23, 2024

Is there any progress on this?

from hasura-storage.

dbarrosop avatar dbarrosop commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.