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

# Discovery connections

> Connect Matcher to external databases and acquirer APIs, test each connection, browse the tables it exposes, and extract records into Matcher.

The **Discovery** screen in the Matcher module of Lerian Console manages your discovery connections. A discovery connection links Matcher to an external database or to an acquirer REST API. Matcher reads the tables and columns of the connection. An extraction then pulls records from the tables that you choose, and Matcher ingests them.

For the API workflow, see [Discovery](/en/products/matcher/integrations/matcher-discovery).

## Accessing the Discovery page

***

Navigate to **Settings → Discovery**.

The page header has two buttons:

* **New connection** opens the sheet to create a connection.
* **Refresh discovery** syncs all connections again. A message shows the number of synced connections.

Chips above the table show the number of connections and the health of the extraction engine.

## Connections table

***

| Column | Description |
| - | - |
| **Name** | The connection name |
| **Type** | The connector type, such as `POSTGRESQL` or `STRIPE` |
| **Status** | **Available**, **Unreachable**, or **Unknown**. The result of a test that you run on this page also shows here |
| **Schema** | **Discovered** when Matcher has read the tables of the connection, or **Pending** |
| **Actions** | The menu of actions for the connection |

## Creating a connection

***

1. Click **New connection**. The **New connection** sheet opens.
2. Enter the **Connection name**.
3. Select the **Connector type**. The fields below the select change with the type.
4. Fill in the fields of the type.
5. Click **Save**.

### Database connector types

The database types are **PostgreSQL**, **MySQL**, **Oracle**, **SQL Server**, and **MongoDB**.

| Field | Description |
| - | - |
| **Host** | The host name or address of the database server |
| **Port** | The port of the database server |
| **Database name** | The name of the database |
| **User name** | The database user |
| **Password** | The password of the database user (optional) |
| **Schema** | The schema in the database (optional) |

### REST connector types

Each REST type shows its own fields. All REST types also show an optional **Base URL** field, which sets the API address for this connection.

| Connector type | Fields |
| - | - |
| `PAGBANK` | **Establishment ID** and **EDI token** |
| `STRIPE` | **API key** |
| `PIX_BCB` | **Client ID**, **Client secret**, **Client certificate (PEM)**, and **Client private key (PEM)** |

## Editing a connection

***

Open the **Actions** menu of a row and click **Edit**. The **Edit connection** sheet opens.

* For a database type, you can change the name and the database fields.
* For a REST type, you can change only the **Connection name**. To change other values, delete the connection and create it again.

Click **Save** to apply the change.

## Testing a connection

***

Open the **Actions** menu of a row and click **Test connection**. The **Status** column shows the result:

* **Connection healthy** with the response time in milliseconds.
* **Connection failed**, with the reason when Matcher returns one.

## Viewing the schema

***

Open the **Actions** menu of a row and click **View schema**. The **Connection schema** sheet lists each table of the connection. For each table, it shows the **Column**, **Type**, and **Nullable** values.

If the sheet shows **No schema discovered yet**, click **Refresh discovery** when the connection is reachable.

The sheet can also show these markers:

| Marker | Meaning |
| - | - |
| **Last known map** | The connection is unreachable, or the tables are an archived version. The sheet shows the tables that Matcher read last, with the read date |
| **Not extractable yet** | Matcher has no confirmed columns for the tables. You cannot extract from them yet. The alert describes the possible causes |
| **Columns may be stale** | The columns of the table can be out of date |
| **Fewer columns than last read** | The last read returned fewer columns for the table than the read before it |

The **Earlier versions** section lists the archived versions of the schema. Each version shows the cause, the archive date, and the number of tables. Click a version to see its tables.

## Starting an extraction

***

1. Open the **Actions** menu of a row and click **Start extraction**. The **Start extraction** sheet opens.
2. In **Tables JSON**, enter a JSON object. Each key is a table name, exactly as the schema lists it. Use `{}` as the value to extract all columns. To extract only some columns, use `{"columns": ["id", "amount"]}`.
3. Click **Start extraction**.

The sheet then shows the extraction status, such as **Extracting** or **Complete**. When Matcher sends the records to ingestion, the sheet also shows the **Ingestion job**. If the extraction fails, the sheet shows the error.

Click **Run in background** to close the sheet while the extraction runs.

A source can also pull data on a schedule from a discovery connection. See [Context sources](/en/products/matcher/ui/context-sources).

## Deleting a connection

***

Open the **Actions** menu of a row and click **Delete**. In the **Delete discovery connection?** dialog, click **Delete connection**. Schema reads and extractions that depend on the connection can stop.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.