# Writer

Records can be written into Langstack Entities or external data destinations using the settings defined in the ETL pipeline>Data Format>Writer tab.

## Data Destination as a Connector

If the Data destination is a connector, based on the Connector type selected in the Details tab, the writer stream can be CSV Stream, Database Stream, JSON Stream, FixedWidth Stream, or Text Stream.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_9/ch9etlwriterddconn.png" alt=""><figcaption></figcaption></figure>

## Data Destination as an Entity

The Writer mode allows the user to define the data to be written in any of the following ways:

* Append: This setting defines that the data in the source will be added to the destination without affecting the existing data in the destination. This option is selected by default.&#x20;
* Add & Update: This setting defines that if a record is not present according to the match key, the record should be added, and the destination data set is updated accordingly. If the record is found, then the record is updated to match the record in the Reader.&#x20;
* Update: This setting defines that the records are updated according to the match key. The updated records replace previous records of the same data source. The destination records remain the same if the data according to the match key is not found.&#x20;
* Delete: This setting defines that the data is deleted from the destination data source based on the match key.&#x20;
* Sync (Synchronize): This setting defines the data synchronization between source and destination according to the match key. \
  For example, if a record is present in the source file and not in the target destination, the target destination is updated to sync with the source file. Similarly, if a record is not present in the source file but is present in the target destination, the same record in the target destination will be deleted.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_9/ch9etlwriterddentity.png" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.langstack.com/welcome/get-started/learn-langstack/introduction-to-etl-pipeline/data-formats-in-etl-pipeline/writer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
