> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kosmoy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connections

> Learn how to create and manage database connections to power your data-driven applications.

# Working with Connections

The **Connections** subsection within Data Management allows you to securely store and manage credentials for accessing various databases. These connections serve as a foundation for registering data sources in the Data Catalog and building data-driven applications.

## Supported Database Types

Kosmoy Studio currently supports the following database types:

* **SQL Databases:**
  * PostgreSQL
* **Vector Databases:**
  * PGVector
  * Weaviate
  * Pinecone

## Creating a Connection

1. **Navigate to Connections:**
   * Click on the **"Data Management"** menu in the left-hand navigation bar.
   * Select **"Connections"** from the expanded menu.

2. **Add a New Connection:** Click the **"+ ADD"** button located in the upper right corner of the Connections section.

3. **Select Database Type:** Choose the type of database you want to connect to (SQL or Vector).

4. **Select Provider:** Choose the specific database provider from the dropdown menu (e.g., PostgreSQL for SQL, PGVector for Vector).

5. **Configure Connection Parameters:** Enter the required connection details for the selected database type and provider. These parameters will vary depending on the provider but typically include:
   * **Host:** The hostname or IP address of your database server.
   * **Port:** The port number used to connect to the database.
   * **Database Name:** The name of the database you want to connect to.
   * **Username:** Your database username.
   * **Password:** Your database password.
   * **(Other provider-specific parameters)**

6. **Click "Next":** Proceed to the next step.

7. **Name and Describe the Connection:** Give your connection a unique name and an optional description.

8. **Click "Review":** Review the connection details.

9. **Click "Create":** Create the connection.

## Connection Cards

The Connections section displays each created connection as a card. Each card shows:

* **Database Type Icon:** An icon representing the type of database (e.g., SQL, Vector).
* **Connection Name:** The name you assigned to the connection.
* **Description:** The description you provided for the connection.
* **Edit Icon (Pencil):** Click this icon to update the connection's parameters, name, or description (only if the connection is not in use).
* **Delete Icon (Trash Bin):** Click this icon to remove the connection (only if the connection is not in use).

## Connection Usage Restrictions

**You cannot edit or delete a connection if it is currently referenced by other entities within Kosmoy Studio. This includes being used in:**

* **Data Catalog** (Databases)
* **Any other Kosmoy Studio component that references connections.**

**Before attempting to edit or delete a connection, ensure it is not actively used in any of these areas. You may need to modify or remove the connection from those components first.**

## Updating a Connection

You can update the parameters, name, and description of a registered connection, **provided it is not currently referenced** by any other component.

1. **Navigate to Connections:**
   * Click on the **"Data Management"** icon in the left-hand navigation bar.
   * Select **"Connections"** from the expanded menu.

2. **Locate the Connection Card:** Find the card for the connection you want to update.

3. **Click the Edit (Pencil) Icon:** This will open the update dialog.

4. **Modify Connection Parameters:** Update the connection's parameters (host, port, database name, username, password, etc.) as needed. You can also modify the name and description.

5. **Click "Save":** Save the changes.

**If you attempt to edit a connection that is currently in use, a warning banner will be displayed at the top of the screen, preventing the modification.**

## Removing a Connection

You can remove a registered connection if it's no longer needed. **However, you cannot delete a connection that is currently referenced by any other component.**

1. **Navigate to Connections:**
   * Click on the **"Data Management"** icon in the left-hand navigation bar.
   * Select **"Connections"** from the expanded menu.

2. **Locate the Connection Card:** Find the card for the connection you want to remove.

3. **Click the Delete (Trash Bin) Icon:** This will trigger a confirmation prompt.

**If you attempt to delete a connection that is currently in use, a modal will appear, preventing the deletion and explaining that the connection is in use.**

4. **Confirm Deletion:** Confirm that you want to delete the connection.

**Warning:** Deleting a connection is a permanent action and cannot be undone. Ensure that the connection is not being referenced by any other component before proceeding.
