I'm following the course on Integration with Ballerina. I'm trying to create a mysql connection on a bal file, but I get an "undefined module" error. Mysql is not being suggested as shown in the screenshot. Have I missed to add something? Do I need to add an entry for MYSQL into the toml file?
I tried to add - import ballerinax/mysql; - it gives an error saying cannot resolve module 'ballerinax/mysql'
I'm following the course on Integration with Ballerina. I'm trying to create a mysql connection on a bal file, but I get an "undefined module" error. Mysql is not being suggested as shown in the screenshot. Have I missed to add something? Do I need to add an entry for MYSQL into the toml file?
I tried to add - import ballerinax/mysql; - it gives an error saying cannot resolve module 'ballerinax/mysql'
Share edited Feb 11 at 11:11 Yumna Albar asked Feb 11 at 9:36 Yumna AlbarYumna Albar 1491 gold badge2 silver badges6 bronze badges 02 Answers
Reset to default 1Only the packages in the local central repository are shown as a suggestion in the VS code. Since you did not pulled this package yet, you are not getting the suggestions. You could try the following approaches:
- Manually pull the package using the following command and restart the VSCode
bal pull ballerinax/mysql
- Simply add the import statement. This will show an
unresolved module
error if the package is not pulled before. You can click on theQuick Fix
in the VSCode to pull the package
import ballerinax/mysql;
This error occurs because you haven't added the import statement.
import ballerinax/mysql;