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

# explore_database

> Explore database structure — generates a dataset of column metadata with statistics, relationships, and semantic descriptions. 

## Usage

The following shows how the step can be used in a recipe.

<Accordion title="Examples" icon="code" defaultOpen="true">
  <Tabs>
    <Tab title="Signature">
      General syntax for using the step in a recipe. Shows the inputs and outputs the step is expected to receive and will produce respectively. For futher details see sections below.

      ```stan theme={null}
      explore_database(, {
          "param": value,
          ...
      }) -> (ds_out: dataset)
      ```
    </Tab>
  </Tabs>
</Accordion>

## Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally
columns (`ds.first_name`), datasets (`ds` or `ds[["first_name", "last_name"]]`) or models (referenced
by name e.g. `"churn-clf"`).

<Accordion title="Inputs" icon="right-to-bracket" />

<Accordion title="Outputs" icon="right-from-bracket">
  <ParamField path="ds_out" type="dataset" required />
</Accordion>

## Configuration

The following parameters can be used to configure the behaviour of the step by including them in
a json object as the last "input" to the step, i.e. `step(..., {"param": "value", ...}) -> (output)`.

<Accordion title="Parameters" defaultOpen="true" icon="sliders">
  <ParamField path="integration" type="string" required>
    Database Integration.
    ID of your database integration containing the connection credentials.
  </ParamField>

  <ParamField path="schemas" type="string">
    Schemas to explore.
    Comma-separated list of schemas to inspect. If empty, all non-system schemas are explored automatically.
  </ParamField>

  <ParamField path="skip_per_column_stats" type="boolean" default="false">
    Skip per-column queries.
    Skip sample values and min/max/avg/stddev (faster for large databases).
  </ParamField>

  <ParamField path="generate_links" type="boolean" default="true">
    Generate graph link columns.
    Generate targets and weights columns encoding the database structure as a graph.
    Links include column-to-table, table-to-schema, and FK relationships (directed).
  </ParamField>

  <ParamField path="table_link_weight" type="number" default="1.0">
    Weight for column-to-table links.
    Weight assigned to directed links from column nodes to their table hub node. Set to 0 to disable.

    Values must be in the following range:

    ```javascript theme={null}
    0 ≤ table_link_weight < inf
    ```
  </ParamField>

  <ParamField path="schema_link_weight" type="number" default="0.5">
    Weight for table-to-schema links.
    Weight assigned to directed links from table hub nodes to their schema hub node. Set to 0 to disable.

    Values must be in the following range:

    ```javascript theme={null}
    0 ≤ schema_link_weight < inf
    ```
  </ParamField>

  <ParamField path="fk_link_weight" type="number" default="0.5">
    Weight for FK links.
    Weight assigned to directed links from FK columns to their target columns. Set to 0 to disable.

    Values must be in the following range:

    ```javascript theme={null}
    0 ≤ fk_link_weight < inf
    ```
  </ParamField>
</Accordion>
