> ## 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.

# cubeSQL as a data source

> Bring data from cubeSQL to Nekt.

[cubeSQL](https://www.sqlabs.com/cubesql/) is a client/server SQL database engine from SQLabs, built on top of SQLite. It's commonly used to add multi-user, network access to SQLite data, and communicates over its own lightweight protocol rather than a standard database wire protocol. This connector is fully generic: it discovers a database's tables and columns at runtime, so it works against any cubeSQL server regardless of schema.

<Note>cubeSQL (SQLabs) is unrelated to [Cube](https://cube.dev), the semantic layer product supported by Nekt's separate **Cube** connector. The two share a name but nothing else — make sure you're picking the right one.</Note>

<img height="50" src="https://mintcdn.com/nekt/Sk_aFGV83P_uHyZt/assets/logo/logo-cubesql.png?fit=max&auto=format&n=Sk_aFGV83P_uHyZt&q=85&s=ac3acd6d96791ccac217bf5b43f4f97c" data-path="assets/logo/logo-cubesql.png" />

## Configuring cubeSQL 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 cubeSQL option from the list of connectors.

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

### 1. Add account access

The following configurations are available:

* **Host**: Hostname or IP address of the cubeSQL server.
* **Port**: (Optional, default `4430`) Port of the cubeSQL server.
* **User**: Username for the cubeSQL connection.
* **Password**: Password for the cubeSQL connection.
* **Database**: Name of the cubeSQL database to sync, as shown in the Admin app's Databases list.
* **Start Date**: (Optional) Earliest value to sync for streams using incremental replication (used as the lower bound before any bookmark exists). Only applies to streams whose replication key is selected in step 3.

Once you're done, click **Next**.

### 2. Select streams

The connector automatically discovers every table in the configured database. Choose which ones you want to sync.

Select the streams and click **Next**.

### 3. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired layer, a folder to organize it, a name for each table, and the type of sync.

* **Sync Type**: choose between INCREMENTAL and FULL TABLE.
  * Incremental: every time the extraction happens, only rows with a value greater than the last synced value of the chosen replication key are fetched.
  * Full table: every time the extraction happens, the current state of the table is fetched in full.

Once you are done configuring, click **Next**.

### 4. Configure data source

Describe your data source for easy identification within your organization.

Define your [Trigger](https://docs.nekt.com/runs/scheduling-and-triggers) based on how often you need data updated.

Once you are ready, click **Next** to finalize the setup.

### 5. Check your new source

You can view your new source on the [Sources](https://app.nekt.ai/sources) page. If needed, manually trigger the source extraction by clicking on the arrow button.

<Warning>For you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you need at least one successful source run.</Warning>

## Streams and Fields

cubeSQL is a database connector — streams are dynamically discovered from your database's own tables. Each table becomes a stream, with one field per column.

### Supported Data Types

Column types are inferred from cubeSQL's reported column type using SQLite's own type-affinity rules, plus a few common naming conventions:

| Declared column type contains                        | Mapped Type |
| ---------------------------------------------------- | ----------- |
| `BOOL`                                               | Boolean     |
| `DATE`, `DATETIME`, `TIMESTAMP`                      | DateTime    |
| `INT`                                                | Integer     |
| `CHAR`, `CLOB`, `TEXT`                               | String      |
| `REAL`, `FLOA`, `DOUB`                               | Number      |
| anything else (including `BLOB` or no declared type) | String      |

### Primary Keys and Replication

* **Primary key**: taken from the table's own primary key definition in cubeSQL.
* **Replication**: every stream defaults to full table sync. To sync a table incrementally, select a replication key column (typically an `updated_at`-style column) in step 3 of the source configuration.

## Known Limitations

* cubeSQL has no native change-data-capture mechanism, so log-based replication isn't available — only full table and incremental (via a replication key column).
* The connector requires a licensed (registered) cubeSQL server. Unregistered/demo cubeSQL servers reject all standard SQL statements (`SELECT`, `CREATE TABLE`, etc.), accepting only cubeSQL's own administrative commands, and won't work with this connector.
