# MariaDB MariaDB API

Source: https://userguide.qualytics.io/source-datastore/datastore/jdbc/maria-db/how-tos/api/

## Creating a Datastore

This section provides a sample payload for creating a datastore. Replace the placeholder values with actual data relevant to your setup.

### Endpoint (Post)

`/api/datastores` *(post)*

**Tab: Creating a datastore with a new connection**

```json
    {
        "name": "your_datastore_name",
        "teams": ["Public"],
        "database": "mariadb_database",
        "enrichment_only": false,
        "trigger_sync": true,
        "connection": {
            "name": "your_connection_name",
            "type": "mariadb",
            "host": "mariadb_host",
            "port": 3306,
            "username": "mariadb_username",
            "password": "mariadb_password"
        }
    }
```

**Tab: Creating a datastore with an existing connection**

```json
    {
        "name": "your_datastore_name",
        "teams": ["Public"],
        "database": "mariadb_database",
        "enrichment_only": false,
        "trigger_sync": true,
        "connection_id": 123
    }
```

**Tab: Create a Source Datastore using the CLI**

```bash
# Step 1: Create a Connection
qualytics connections create \
    --type mariadb \
    --name "your_connection_name" \
    --host ${DB_HOST} \
    --port 3306 \
    --username ${DB_USER} \
    --password ${DB_PASSWORD}

# Step 2: Create a Source Datastore
qualytics datastores create \
    --name "your_datastore_name" \
    --connection-name "your_connection_name" \
    --database your_database \
    --schema your_database
```

## Create an Enrichment Datastore

### Endpoint (Post)

`/api/datastores` *(post)*

This section provides a sample payload for creating an enrichment datastore. Replace the placeholder values with actual data relevant to your setup.

**Tab: Creating an enrichment datastore with a new connection**

```json
    {
        "name": "your_datastore_name",
        "teams": ["Public"],
        "database": "mariadb_database",
        "enrichment_only": true,
        "connection": {
            "name": "your_connection_name",
            "type": "mariadb",
            "host": "mariadb_host",
            "port": 3306,
            "username": "mariadb_username",
            "password": "mariadb_password"
        }
    }
```

**Tab: Creating an enrichment datastore with an existing connection**

```json
    {
        "name": "your_datastore_name",
        "teams": ["Public"],
        "database": "mariadb_database",
        "enrichment_only": true,
        "connection_id": 123
    }
```

**Tab: Create an Enrichment Datastore using the CLI**

```bash
# Step 1: Create a Connection
qualytics connections create \
    --type mariadb \
    --name "your_connection_name" \
    --host ${DB_HOST} \
    --port 3306 \
    --username ${DB_USER} \
    --password ${DB_PASSWORD}

# Step 2: Create an Enrichment Datastore
qualytics datastores create \
    --name "your_datastore_name" \
    --connection-name "your_connection_name" \
    --database your_enrichment_database \
    --schema your_enrichment_database \
    --enrichment-only
```

## Link an Enrichment Destination

### Endpoint (Patch)

`/api/datastores/{datastore-id}/enrichment/{enrichment-id}` *(patch)*

*Last updated: November 16, 2026.*
