Bug #112817 | DB Notebook: runSql() complains function could not be cloned | ||
---|---|---|---|
Submitted: | 24 Oct 2023 17:47 | Modified: | 2 Dec 9:57 |
Reporter: | Kaiwang CHen (OCA) | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Shell VSCode Extension | Severity: | S3 (Non-critical) |
Version: | 1.13.5 | OS: | MacOS |
Assigned to: | CPU Architecture: | Any |
[24 Oct 2023 17:47]
Kaiwang CHen
[25 Oct 2023 6:02]
MySQL Verification Team
Hello Kaiwang, Thank you for the report and feedback. regards, Umesh
[2 Dec 9:57]
Mike Lischke
Posted by developer: This is not a bug. The API which was used (runSQL) does not take a callback, but returns the values in a promise. The correct use is: ``` const result = await runSql( "SELECT Name as name," + "District as district, Population as pop FROM world.city WHERE Name = 'Kabul' " ); print(result); ``` If you want to use a callback instead use "runSqlWithCallback". Both functions return the entire result set in one step. There's a third function "runSqlIterative", which works like "runSqlWithCallback" (same syntax), which calls the callback multiple times, for each batch of result rows (usually 1000). I added a specific check for these methods to refuse execution with a better error message, in case parameters were used that are incompatible.
[2 Dec 10:08]
Mike Lischke
In fact it is a bug - a documentation bug. I'll take care to get the web site updated.