admin管理员组

文章数量:1302870

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 0
Add a comment  | 

2 Answers 2

Reset to default 1

Only 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:

  1. Manually pull the package using the following command and restart the VSCode
bal pull ballerinax/mysql
  1. Simply add the import statement. This will show an unresolved module error if the package is not pulled before. You can click on the Quick 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;

本文标签: mysqlUndefined Module MyslBallerinaStack Overflow