-
Couldn't load subscription status.
- Fork 17
Add Wasm support #90
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
base: main
Are you sure you want to change the base?
Add Wasm support #90
Conversation
| } | ||
| case HttpMethod::POST: | ||
| case HttpMethod::PUT: | ||
| throw IOException("POST or PUT not implemented"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
presume still have to implement these?
GET=read_gsheet()
POST=COPY TO
| SSL_library_init(); | ||
| SSL_load_error_strings(); | ||
| OpenSSL_add_all_algorithms(); | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need SSL at all now if we are using the duckdb util instead?
| #include "duckdb/main/database.hpp" | ||
| #include <chrono> | ||
| #include <openssl/ssl.h> | ||
| #include <openssl/err.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove SSL?
Hello!
This is basically implementing #35.
There are few logical part of this PRs:
This should be a NOP, does changes a bunch of signature and insulate the code a bit less, but should be safe to do
httpfsduckdb/duckdb#17464 for initial PR to duckdb/duckdb)This is the most fragile part, that might be worth some extra tests, since
duckdb_gsheetsmight be using some Openssl [implicit] parameters. I think I covered basics, but extra pair of eyes to review changes inperform_https_requestOR changes in behaviour are welcome.There are two big advantage in using HTTPUtils: better integration with the rest of the system, so that for example logging would come out of the box (I think
CALL enable_logging(level='trace', storage='stdout');should show all API calls after this PR, and second that one reuse existing infrastructure, so that improvements are shared everywhere. As part of this second bit, HTTPUtil has a Wasm implementation, so this makes possible to use ghsees from a browser.1 and 3 should be OK, 2 is where there are risks and rewards, so needs to be checked with care.
All put together you should then be able to do, within duckdb-wasm currently deployed at https://shell.duckdb.org (once you disable signed extension access, that do require to serve it yourself):
I have not looked at automatic secret (that currently succeed at SQL level but has no token), so maybe it would be handy to add a block like:
near https://github.com/evidence-dev/duckdb_gsheets/blob/main/src/gsheets_auth.cpp#L171