Implementation
This handler was implemented using the existing MindsDB handlers for MySQL and PostgreSQL. The required arguments to establish a connection are as follows:host
: the host name or IP address of the Amazon Aurora DB cluster.port
: the TCP/IP port of the Amazon Aurora DB cluster.user
: the username used to authenticate with the Amazon Aurora DB cluster.password
: the password to authenticate the user with the Amazon Aurora DB cluster.database
: the database name to use when connecting with the Amazon Aurora DB cluster.
db_engine
: the database engine of the Amazon Aurora DB cluster. This can take one of two values: ‘mysql’ or ‘postgresql’. This parameter is optional, but if it is not provided,aws_access_key_id
andaws_secret_access_key
parameters must be provided.aws_access_key_id
: the access key for the AWS account. This parameter is optional and is only required to be provided if thedb_engine
parameter is not provided.aws_secret_access_key
: the secret key for the AWS account. This parameter is optional and is only required to be provided if thedb_engine
parameter is not provided.
If you installed MindsDB locally via pip, you need to install all handler dependencies manually. To do so, go to the handler’s folder (mindsdb/integrations/handlers/aurora_handler) and run this command:
pip install -r requirements.txt
.Usage
In order to make use of this handler and connect to an Amazon Aurora MySQL DB Cluster in MindsDB, the following syntax can be used:If you want to switch to different database, you can include it in your query as: