Hook the data fetch request. #1776
Answered
by
aszenz
GordonSmith
asked this question in
Q&A
-
Is there any way to hook an URL request so I can manually fetch and format the data? I want my user to be able to enter something like this: CREATE TABLE direct AS
SELECT * FROM 'xxx, yyy' Then I would like to intercept the fetch in my function: function fetchJson(url) {
// Call some API passing in xxx, yyy
// Filter and format the data for loading
// Return the data back into the AsyncDuckDB instance
} IOW I don't want to make the API call until the user specifically requests it. |
Beta Was this translation helpful? Give feedback.
Answered by
aszenz
Jun 26, 2024
Replies: 1 comment 1 reply
-
Yes u can use the function getTableNames to get the table names required to run a query and then load them before running the actual query. https://shell.duckdb.org/docs/classes/index.AsyncDuckDBConnection.html#getTableNames |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
GordonSmith
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes u can use the function getTableNames to get the table names required to run a query and then load them before running the actual query.
https://shell.duckdb.org/docs/classes/index.AsyncDuckDBConnection.html#getTableNames