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

# Firebird as a data source

> Bring data from a Firebird database to Nekt.

Firebird is an open-source relational database management system used by many ERP and accounting systems. A common use case is the **SCI Sistemas Contábeis "Único"** ERP, which exposes its Firebird database for read access through its *BI Connection* module.

## Configuring Firebird as a Source

In the [Sources](https://app.nekt.ai/sources) tab, click on the "Add source" button located on the top right of your screen. Then, select the Firebird option from the list of connectors.

Click **Next** and you'll be prompted to add your access.

### 1. Add account access

You'll need the connection credentials for your Firebird database.

<Warning>
  The database user must have **read access** to the tables and views you want to extract. We recommend using a dedicated read-only user.
</Warning>

<Note>
  Because Nekt runs in the cloud, it needs network access to the Firebird port (default `3050`). If the database is on a private network, expose it securely, ideally through an **SSH tunnel** (see step 3), or a tightly firewalled port forward restricted to Nekt's egress IPs.
</Note>

### 2. Configuration Options

* **Host**: The hostname or IP address of your Firebird server. Use `127.0.0.1` when connecting through an SSH tunnel.
* **Port**: The port number for your database connection. The default port for Firebird is `3050`.
* **Database File Path**: The path to the database file on the server, for example `C:/SCI/BANCO/VSCI.SDB`.
* **User**: The username for authenticating with the database.
* **Password**: The password for the database user.

#### Advanced Settings

* **Charset**: The connection charset. SCI Único databases use `WIN1252` (the default).
* **Role** (optional): The Firebird role to connect with. Leave blank if not used.
* **Filter Tables** (optional): An allowlist of table/view names to discover (case-insensitive). **Strongly recommended for large databases**, an SCI Único base has around 3,600 tables, and discovering all of them is slow.
* **Filter Table Prefixes** (optional): A list of name prefixes to discover (case-insensitive), for example `TEMPRESAS`, `VSUC`, `VRH`. Combined with Filter Tables as a union.
* **Chunk Size**: The number of rows to fetch at a time. Default is `20000`. Set to `0` to fetch all rows at once (not recommended for large tables).
* **Use Batch Query**: Use keyset pagination with retry logic for large tables. Requires a primary key.

### 3. SSH Tunnel (optional)

If your Firebird database is behind a firewall or on a private network, you can connect through an SSH tunnel (bastion host).

<Accordion title="How to configure SSH Tunnel">
  <Steps>
    <Step title="Enable SSH Tunnel">
      Toggle the SSH Tunnel option to enabled.
    </Step>

    <Step title="Enter SSH Server Details">
      * **SSH Host**: The hostname of your bastion/jump server.
      * **SSH Port**: The SSH port (default: `22`).
      * **SSH Username**: Your SSH username.
    </Step>

    <Step title="Provide Authentication">
      Use either a password or a private key:

      * **SSH Password**: Password for the SSH server, OR
      * **SSH Private Key**: PEM-formatted private key for key-based authentication.
    </Step>
  </Steps>

  When tunneling, set **Host** to `127.0.0.1` so the connection is routed through the tunnel to the remote database.
</Accordion>

### 4. Select streams

After configuring your connection, Nekt will discover the available tables and views from your Firebird database (scoped by your table filters). Select the tables you want to sync.

<Tip>
  Selecting only the columns you need significantly speeds up extraction over remote connections, since Firebird transfers each row over the wire.
</Tip>

### 5. Configure data streams

For each selected table, you can configure:

* **Replication method**: Choose between **Full Table** (complete sync each run) or **Incremental** (only new/updated rows based on a replication key column).
* **Replication key**: For incremental sync, select the column that tracks changes (typically a timestamp or auto-incrementing ID column).

### 6. Verify and save

Review your configuration and click **Save**. Nekt will begin syncing data from your Firebird database on the configured schedule.

## Supported Data Types

Firebird data types are automatically mapped to the appropriate types in Nekt's Catalog:

| Firebird Type                                                 | Nekt Type            |
| ------------------------------------------------------------- | -------------------- |
| `SMALLINT`, `INTEGER`, `BIGINT`, `INT128`                     | Integer              |
| `FLOAT`, `DOUBLE PRECISION`, `DECFLOAT`, `NUMERIC`, `DECIMAL` | Number               |
| `CHAR`, `VARCHAR`, `BLOB SUB_TYPE TEXT`                       | String               |
| `DATE`                                                        | Date                 |
| `TIMESTAMP`, `TIMESTAMP WITH TIME ZONE`                       | DateTime             |
| `TIME`, `TIME WITH TIME ZONE`                                 | String               |
| `BOOLEAN`                                                     | Boolean              |
| `BLOB SUB_TYPE BINARY`                                        | String (hex-encoded) |
