-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Handle SQL queries that are too large for a GET request #58
Comments
I am writing apparently GIANT queries that don't seem so giant to me. Is giant related to query execution time? Or length of the query in lines? Example:
|
GIANT here is purely based on the length of the SQL text, since that gets put in a |
The Cloud Run limit isn't documented on https://cloud.google.com/run/quotas but https://stackoverflow.com/questions/64097343/if-theres-any-limitation-of-query-parameter-length-in-cloud-run says that it's actually a limit of Google's load balancer, which https://cloud.google.com/load-balancing/docs/quotas#https-lb-header-limits says:
|
IE used to have a 2048 total URL limit. I'm going to borrow that one, since hopefully anyone else who built a system with a limit took it into account: https://support.microsoft.com/en-us/topic/maximum-url-length-is-2-083-characters-in-internet-explorer-174e7c8a-6666-f4e0-6fd6-908b53c12246 I'll actually go with "if the URL-encoded SQL query is longer than 1800 characters stick with POST rather than redirecting to a GET" because that gives me a bit of breathing room. |
Really good comprehensive answer at https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers via https://twitter.com/dracos/status/1386380086576926730
|
I don't think this will work correctly with named parameters in queries, because this bit only reads from django-sql-dashboard/django_sql_dashboard/views.py Lines 114 to 118 in 4e325ed
|
Sometimes it's useful to run GIANT queries - queries with a huge copy-pasted list of IDs in them for example.
Right now the POST works but the GET redirect may cause an error.
If this happens, you can instead create a saved dashboard and the query will execute fine. Some kind of utility mechanism for spotting this and automatically handling it might be nice.
The text was updated successfully, but these errors were encountered: