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

# Customer DB: Materialize Free Customer Companies

> Pull companies from the shared company database with a SQL query and save them into your workspace's companies table. Customer DB Materialize Free Customer.

Pull companies from the shared company database with a SQL query and save them into your workspace's companies table.

> [!NOTE]
>
> Tool ID: `materialize_free_customer_companies`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'materialize_free_customer_companies',
  {
    "sql": "SELECT * FROM companies LIMIT 10"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute materialize_free_customer_companies --input '{
  "sql": "SELECT * FROM companies LIMIT 10"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "schema": "example",
  "processed": 123,
  "inserted": 123,
  "updated": 123,
  "sql": "SELECT * FROM companies LIMIT 10",
  "limit": 123
}
```

Use `deepline describe materialize_free_customer_companies --json` for the latest machine-readable contract.

## Input reference

Run a single read-only SQL statement against the shared free company corpus and upsert the returned company rows into enrichments.companies in the tenant customer DB. Only row-shaped company results are allowed.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.sql` | `string` | Yes | — | Single read-only SQL statement to execute against the shared free company corpus before upserting rows into enrichments.companies. SQL must include LIMIT, LIMIT must be \<= 100000, and the result columns must be limited to: domain, company\_name, industry, location, linkedin\_url, employee\_count, year\_founded. Aggregate-only shapes like count(\*) are rejected. Minimum length: 1. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Run a single read-only SQL statement against the shared free company corpus and upsert the returned company rows into enrichments.companies in the tenant customer DB. Only row-shaped company results are allowed.",
    "properties": {
      "sql": {
        "type": "string",
        "description": "Single read-only SQL statement to execute against the shared free company corpus before upserting rows into enrichments.companies. SQL must include LIMIT, LIMIT must be <= 100000, and the result columns must be limited to: domain, company_name, industry, location, linkedin_url, employee_count, year_founded. Aggregate-only shapes like count(*) are rejected.",
        "minLength": 1
      }
    },
    "required": [
      "sql"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.schema` | `string` | Yes | — | — |
| `result.processed` | `integer` | Yes | — | — |
| `result.inserted` | `integer` | Yes | — | — |
| `result.updated` | `integer` | Yes | — | — |
| `result.sql` | `string` | Yes | — | — |
| `result.limit` | `integer` | Yes | — | — |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "schema": {
        "type": "string"
      },
      "processed": {
        "type": "integer"
      },
      "inserted": {
        "type": "integer"
      },
      "updated": {
        "type": "integer"
      },
      "sql": {
        "type": "string"
      },
      "limit": {
        "type": "integer"
      }
    },
    "required": [
      "schema",
      "processed",
      "inserted",
      "updated",
      "sql",
      "limit"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.