mysql / mysql-shell-plugins

Plugins for the MySQL Shell
Other
73 stars 14 forks source link

ERROR: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope' #47

Closed LimH0Kyun closed 6 months ago

LimH0Kyun commented 6 months ago

ERROR: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': (res) => { print(res); } could not be cloned. (Ln 1, Col 1)

Error when executing type script runSql. Please provide a solution.

I am Korean.

Thank you.

mike-lischke commented 6 months ago

Can you show us what you tried to execute? It looks like a JS/TS function was used in SQL code.

LimH0Kyun commented 6 months ago

https://dev.mysql.com/doc/mysql-shell-gui/en/mysql-shell-vscode-notebook-views-typescript.html

runSql ("SHOW TABLES LIKE 'AlbertaAddresses' ",
(ResultSetData) => { print(ResultSetData); } );

This code is an example. The same error occurs even if you proceed with the actual code.

mike-lischke commented 6 months ago

This is a documentation bug. The method runSql (with that callback function) has been renamed to runSqlWithCallback and a new runSql has been introduced which uses a promise and no callback. Sorry for the confusion.

With the renamed function you get:

screenshot

LimH0Kyun commented 6 months ago

Thank you so much. Thanks to you, the problem has been solved. I admire you.

So now it doesn't support runSql() function?

mike-lischke commented 6 months ago

As I wrote in my last comment, runSql exists and is now using a promise instead of a callback. So there are now 3 functions: runSql, runSqlWithCallback and runSqlIterative. Also check the code completion in JS/TS blocks, which lists available APIs:

runsql-help