Regarding your issue related to the unknown module k6/x/sql: I would need more context to be able to help you with this issue. How did you install xk6? Which extensions have you compiled it with (were you able to, or do you run into the problem you mention at that point)? If you’re running into an issue when running a script directly, could hint at what the code looks like?
Also, while looking into it, we realized that the xk6 repository README page’s examples are somewhat outdated, and might be misleading. While we work to fix it, I’d like to point out our official listing of extensions, in case you haven’t found it yet: k6 Extensions.
Regarding your issue related to VSCode not finding the xk6 executable: I’m by no mean an expert, but here are some things to look into and verify that might help you:
VSCode should inherit your system’s environment, and therefore already have $PATH and $GOPATH set. If the xk6 command works in CMD, but not in VSCode, you could verify that you’re overriding neither your $PATH, nor $GOPATH in your VSCode config?
If you’ve installed xk6 using the go install command, the binary will be located in your $GOPATH/bin. Is $GOPATH/bin on your $PATH, and if so, have you tried setting the GOPATH manually in VSCode (if that’s possible)?
More general idea: the VSCode Go extension tends to set up good defaults; do you have the extension installed?