cds mysql
MySQL
/MariaDB
adapter for CAP Framework, this module is heavily inspired by the cds-pg module.
Setup
firstly, install npm packages
npm i cds-mysql mysql2
setup the mysql
database driver for cds -> edit the package.json
> cds
node (or .cdsrc.json
)
{
"requires": {
"db": {
"kind": "mysql"
}
}
}
create an .env
file and put that into your local CDS project, then fill the database credential
CDS_REQUIRES_DB_CREDENTIALS_HOST=127.0.0.1
CDS_REQUIRES_DB_CREDENTIALS_PORT=3306
CDS_REQUIRES_DB_CREDENTIALS_DATABASE=
CDS_REQUIRES_DB_CREDENTIALS_USER=
CDS_REQUIRES_DB_CREDENTIALS_PASSWORD=
now, start the cds server (npx cds-serve
), everything is ready!
[!TIP]
read more about how to config database credential.
[!TIP]
read more about how to setup database user.
in addition, please check cap-mysql-sflight to get the mysql
version of official cap-sflight
example, and it works well.
please read the full long version Advanced Documentation to get more technical details.
Feature and RoadMap