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

# Database

> The org PostgreSQL Database and its relationship to files, run datasets, and connected systems.

The Database is your org's PostgreSQL store for customer data. It can hold
working tables, stored files, managed source records, and Play Runtime Sheets.
Plays and agents can query this data through supported Database operations.

Deepline can also read a supplied file and export a run's rows. Connected
systems such as a CRM can supply source records or receive approved updates.
Each serves a different purpose.

| Data | Purpose | Example |
| - | - | - |
| File | Exchange inputs or results | A CSV of accounts to research |
| Run dataset | Inspect rows and computed columns from an execution | Accounts with research evidence and review status |
| Org Database | Keep working data across runs | Accepted observations, source events, and pending proposals |
| Connected destination | Apply an operational change | An approved CRM field update |

A Play can combine these sources. For example, it can compare a new CSV with
previous observations in the Database, retain its review results as a dataset,
and send approved changes to a CRM.

![Files, Database working state, and approved CRM records serve different purposes](https://mintcdn.com/deepline2/jbNrWuL_F2rDi05A/images/where-data-lives.svg?fit=max\&auto=format\&n=jbNrWuL_F2rDi05A\&q=85\&s=5c304ff574617fce624eb7d4d4d811ac)

## A file makes a bounded experiment concrete

A small CSV ties each input row to an output that a person can review. It works
well when testing a new criterion or handing a result to another team. It is
less suited to a process that must remember events, join several sources, or
coordinate concurrent writers.

For example, a first account-research pilot might end with a reviewed export.
That is a complete useful result. It need not become a database import or a CRM
write merely because those capabilities exist.

The transition to durable tables is justified when later work needs memory:
which accounts were researched, when an observation was made, or which rows
await review. Passing revised files between agents eventually makes identity
and history depend on filenames and human convention.

The Database also supports stored customer files. File content and SQL tables
remain different objects: storing a CSV does not automatically create a table
or run a Play. [CSV input](https://deepline.com/docs/sdk-v2/batch-csv.md) explains how a batch Play reads the
records in a supplied file.

## Runtime Sheets describe one run's row work

A Play dataset has named rows and recorded work. Its Runtime Sheet supplies
durable row storage for that execution. That is useful when inspecting a batch,
recovering retained outputs, or understanding which rows reached each step.
The [Datasets](https://deepline.com/docs/datasets.md) page explains columns, maps, row identity, and exports.

Durable does not mean it is the authoritative business table for every future
run. A research dataset may include provisional candidates and failed rows
that should never appear as approved account facts.

A result can also refer to dataset handles rather than inline arrays. The
compact run response and an exported row set serve different purposes: one
summarizes execution, while the other supplies row data. A caller should not
infer that a small status response contains every intermediate record.

## Customer tables carry the process's memory

The org Database stores customer records and supported event tables
independently of a single Play run. It supports questions such as which signals
arrived for an account, whether two sources agree, or which approved review
result a later process should reuse.

The Database is PostgreSQL. The web app provides a data view, and the SQL API
lets an application or agent query it. Supported ingestion and Monitors can
populate managed source tables. Customer tables can hold the working records
that your own Plays maintain. Available rows depend on what has been connected,
ingested, or written in that org.

Customer-authored working data belongs in permitted customer storage objects,
such as qualified `storage.*` tables or allowed customer-managed schemas.
Deepline-managed views and internal objects have separate protections. A query
interface does not grant unrestricted mutation of every visible relation.

The platform owns its own control state: Play definitions, Monitor lifecycle,
credentials, and billing. Editing customer data is not a way to change those
objects. Their API and CLI operations remain the control surface.

### Storage and cache reuse are different mechanisms

A workflow can persist accepted observations and decide when they are fresh
enough to reuse. That is an authored data policy. Deepline also has completed
runtime receipt reuse, governed by a call's cache identity and refresh behavior.

Neither mechanism makes a stored answer permanently correct. A person's role
can change after a successful lookup. Reusing a historical result without its
observation time may save work while weakening the current decision.

## The CRM carries approved operational meaning

A CRM field often has consequences beyond one workflow. Ownership affects
routing. Lifecycle stage affects reporting. Contact details affect outreach.
An enrichment candidate written into that field can therefore change another
team's work or reporting.

The workflow needs rules for accepting evidence and authorizing changes.
Approval may be automated or human, depending on the team's rules and the
field's consequences.

The CRM is therefore a poor default home for raw signals and unresolved
candidates. Keeping working evidence separately makes it possible to compare
sources without repeatedly changing the rep's record.

## Connect evidence across runs

Keep source identity, observation time, acceptance-rule version, and destination
record ID with accepted working data. A domain, profile URL, provider ID, and
CRM object ID can refer to related entities without being interchangeable. A
company domain change should not silently split its history or merge a
similarly named business.

For example, retain a pending job-title proposal in a working table while the
CRM shows its last accepted title. A later run can compare new evidence under
the same field-ownership and freshness policy before changing the CRM.

A Monitor supplies supported source events. A schedule starts recurring work.
Both can use the same durable customer state without requiring an open agent
chat. When repairing a failure, preserve the original input, Play version, and
run identity so recovery does not quietly become a new experiment. Use
[Integrate a Play into your app](https://deepline.com/docs/sdk-v2/production-integration.md) for execution recovery
and [Repair CRM records](https://deepline.com/docs/guides/crm-data-quality-automation.md) for field policy.

## Data can follow several valid paths

A Monitor can write directly to the Database. A Play can read a CSV and return
a reviewable result. Another Play can query durable state and write a small
approved update to a CRM. There is no requirement that every row pass through
all storage layers in sequence.

In an account-routing example, the posting remains source evidence, the
qualification decision is customer working state, and the assigned owner is a
CRM record. The same account identity connects them, but each answers a
different question and can require a different retention policy.

## Continue learning

* [Query a database](https://deepline.com/docs/database-access.md): supported reads, writes, and access boundaries.
* [Database reference](https://deepline.com/docs/features/postgresql-database.md): schemas and ownership rules.
* [Datasets](https://deepline.com/docs/datasets.md): row processing and retained Play results.
* [Integrations](https://deepline.com/docs/features/integrations.md): source connections and destination actions.
* [Batch CSV enrichment](https://deepline.com/docs/sdk-v2/batch-csv.md): pilot and export procedures.
* [CRM repair guide](https://deepline.com/docs/guides/crm-data-quality-automation.md): proposals, allowed fields, and verification.


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