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

# metadata

> Commands for exploring schema metadata for a connection.

The `metadata` command group lets you browse the schema structure of a connected data source — catalogs, schemas, tables, columns, stored procedures, and parameters.

All metadata commands require an active connection. See [connection create](./connection.mdx#connection-create) to set one up.

***

## metadata catalogs

Lists all catalogs available in the connection.

```bash theme={null}
cdatacli metadata catalogs --connection <connection-name> [--catalog <catalog>]
```

**Options**

| Option         | Description                  | Required |
| -------------- | ---------------------------- | -------- |
| `--connection` | Name of the saved connection | Yes      |
| `--catalog`    | Filter by catalog name       | No       |

**Output**

```json theme={null}
{
  "catalogs" : [ {
    "TABLE_CAT" : "CData"
  } ]
}
```

***

## metadata schemas

Lists all schemas in the connection, optionally filtered by catalog.

```bash theme={null}
cdatacli metadata schemas --connection <connection-name> [--catalog <catalog>] [--schema <schema>]
```

**Options**

| Option         | Description                  | Required |
| -------------- | ---------------------------- | -------- |
| `--connection` | Name of the saved connection | Yes      |
| `--catalog`    | Filter by catalog name       | No       |
| `--schema`     | Filter by schema name        | No       |

**Output**

```json theme={null}
{
  "schemas" : [ {
    "TABLE_SCHEM" : "Salesforce",
    "TABLE_CATALOG" : "CData"
  } ]
}
```

***

## metadata tables

Lists all tables available in the connection, optionally filtered by catalog and schema.

```bash theme={null}
cdatacli metadata tables --connection <connection-name> [--catalog <catalog>] [--schema <schema>] [--table <table>]
```

**Options**

| Option         | Description                  | Required |
| -------------- | ---------------------------- | -------- |
| `--connection` | Name of the saved connection | Yes      |
| `--catalog`    | Filter by catalog name       | No       |
| `--schema`     | Filter by schema name        | No       |
| `--table`      | Filter by table name pattern | No       |

**Output**

```json theme={null}
{
  "tables" : [ {
    "TABLE_CAT" : "CData",
    "TABLE_SCHEM" : "Salesforce",
    "TABLE_NAME" : "Account",
    "TABLE_TYPE" : "TABLE",
    "REMARKS" : null
  }, {
    "TABLE_CAT" : "CData",
    "TABLE_SCHEM" : "Salesforce",
    "TABLE_NAME" : "Contact",
    "TABLE_TYPE" : "TABLE",
    "REMARKS" : null
  } ]
}
```

***

## metadata columns

Lists all columns for a table, optionally filtered by catalog and schema.

```bash theme={null}
cdatacli metadata columns --connection <connection-name> --table <table> \
  [--column <column>] [--catalog <catalog>] [--schema <schema>]
```

**Options**

| Option         | Description                   | Required |
| -------------- | ----------------------------- | -------- |
| `--connection` | Name of the saved connection  | Yes      |
| `--table`      | Table name pattern            | Yes      |
| `--column`     | Filter by column name pattern | No       |
| `--catalog`    | Filter by catalog name        | No       |
| `--schema`     | Filter by schema name         | No       |

**Output**

Each column is described using JDBC metadata fields. Only the first column is shown in full below; the remaining columns follow the same structure.

```json theme={null}
{
  "columns" : [ {
    "TABLE_CAT" : "CData",
    "TABLE_SCHEM" : "Salesforce",
    "TABLE_NAME" : "Account",
    "COLUMN_NAME" : "Id",
    "DATA_TYPE" : 12,
    "TYPE_NAME" : "VARCHAR",
    "COLUMN_SIZE" : 18,
    "BUFFER_LENGTH" : 65535,
    "DECIMAL_DIGITS" : null,
    "NUM_PREC_RADIX" : 10,
    "NULLABLE" : "0",
    "REMARKS" : "The unique identifier of the account.",
    "COLUMN_DEF" : null,
    "SQL_DATA_TYPE" : null,
    "SQL_DATETIME_SUB" : null,
    "CHAR_OCTET_LENGTH" : 18,
    "ORDINAL_POSITION" : 1,
    "IS_NULLABLE" : "NO",
    "SCOPE_CATALOG" : null,
    "SCOPE_SCHEMA" : null,
    "SCOPE_TABLE" : null,
    "SOURCE_DATA_TYPE" : null,
    "IS_AUTOINCREMENT" : "NO",
    "IS_GENERATEDCOLUMN" : "NO"
  } ]
}
```

***

## metadata procedures

Lists all stored procedures available in the connection.

```bash theme={null}
cdatacli metadata procedures --connection <connection-name> [--catalog <catalog>] [--schema <schema>] [--procedure <procedure>]
```

**Options**

| Option         | Description                      | Required |
| -------------- | -------------------------------- | -------- |
| `--connection` | Name of the saved connection     | Yes      |
| `--catalog`    | Filter by catalog name           | No       |
| `--schema`     | Filter by schema name            | No       |
| `--procedure`  | Filter by procedure name pattern | No       |

**Output**

```json theme={null}
{
  "procedures" : [ {
    "PROCEDURE_CAT" : "CData",
    "PROCEDURE_SCHEM" : "Salesforce",
    "PROCEDURE_NAME" : "CreateCustomField",
    "reserved1" : null,
    "reserved2" : null,
    "reserved3" : null,
    "REMARKS" : "Creates a new custom field on a Salesforce object.",
    "PROCEDURE_TYPE" : 2,
    "SPECIFIC_NAME" : "CreateCustomField"
  } ]
}
```

***

## metadata parameters

Lists all parameters for a stored procedure.

```bash theme={null}
cdatacli metadata parameters --connection <connection-name> --procedure <procedure> \
  [--parameter <parameter>] [--catalog <catalog>] [--schema <schema>]
```

**Options**

| Option         | Description                      | Required |
| -------------- | -------------------------------- | -------- |
| `--connection` | Name of the saved connection     | Yes      |
| `--procedure`  | Procedure name pattern           | Yes      |
| `--parameter`  | Filter by parameter name pattern | No       |
| `--catalog`    | Filter by catalog name           | No       |
| `--schema`     | Filter by schema name            | No       |

**Output**

Each parameter is described using JDBC metadata fields. Only the first parameter is shown in full below; the remaining parameters follow the same structure.

```json theme={null}
{
  "parameters" : [ {
    "PROCEDURE_CAT" : "CData",
    "PROCEDURE_SCHEM" : "Salesforce",
    "PROCEDURE_NAME" : "CreateCustomField",
    "COLUMN_NAME" : "ObjectName",
    "COLUMN_TYPE" : 1,
    "DATA_TYPE" : 12,
    "TYPE_NAME" : "VARCHAR",
    "PRECISION" : "2000",
    "LENGTH" : 2000,
    "SCALE" : 0,
    "RADIX" : 10,
    "NULLABLE" : "1",
    "REMARKS" : "The API name of the Salesforce object to which the custom field will be added.",
    "COLUMN_DEF" : null,
    "SQL_DATA_TYPE" : null,
    "SQL_DATETIME_SUB" : null,
    "CHAR_OCTET_LENGTH" : null,
    "ORDINAL_POSITION" : 1,
    "IS_NULLABLE" : "YES",
    "SPECIFIC_NAME" : "CreateCustomField",
    "SUPPORTS_STREAMS" : false
  } ]
}
```
