Creating a Connection

Requirements for a SQL Connection

To set up a PostgreSQL/MySQL connection, you will need:

  • Hostname or IP address of the server

  • Database name

  • Username and password (read-only access is recommended)

  • Port number

Connection through SDK

Here’s how you can create a connection in PigeonsAI through the SDK:

# Postgres
res = client.data_connector.create_connector(
    connection_name="your_connection_name",
    connection_type="postgres",
    db_host='your-db-host.amazonaws.com',
    db_name="your_db_name",
    db_username="your_readonly_username",
    db_password="your_password",
    db_port=5432
)


# mysql
res = client.data_connector.create_connector(
    connection_name="demo_mysql_conn",
    connection_type="mysql",
    db_host='mysql-test.demo.us-east-2.rds.amazonaws.com',
    db_name="test1",
    db_username="mysql_demo",
    db_password="demo_password",
    db_port=3306
)

Example Output

Connector creation successful: 201 Created
Data connector URI: uri:data-connector:biraj_pigeonsai.com:caa6f2cb-efef-43ea-93bf-2a58af5a3ae3

The output URI from the connection will be used to create a train dataset below.

Security Best Practices

Read-Only Access

It is strongly recommended to use a read-only user for database connections. This minimizes risks and ensures that the operations performed by PigeonsAI are limited to data reading, without any modifications to your data.

Data Access

When pulling data from your database, PigeonsAI only accesses the columns specified in the training dataset creation. No other data is read or transferred, maintaining strict data privacy and minimization principles.

IP Address Whitelisting

If your database server requires IP whitelisting for external connections, please reach out via the provided scheduling link to obtain the IP addresses that need to be whitelisted. This ensures a secure and reliable connection between your database and PigeonsAI.

Data pulling your cloud/vpc

For enterprises that require data operations to be conducted within their cloud environment, or have specific security protocols that need bespoke configurations, PigeonsAI offers tailored solutions. Please schedule a meeting through our calendar link to discuss your specific requirements and setup.

Last updated