# TableStream

[Snowflake Documentation](https://docs.snowflake.com/en/sql-reference/sql/create-stream)

Represents a stream on a table in Snowflake, which allows for change data capture on the table.

## Examples

### Python

```python
stream = TableStream(
    name="some_stream",
    on_table="some_table",
    owner="SYSADMIN",
    copy_grants=True,
    at={"TIMESTAMP": "2022-01-01 00:00:00"},
    before={"STREAM": "some_other_stream"},
    append_only=False,
    show_initial_rows=True,
    comment="This is a sample stream."
)
```

### YAML

```yaml
streams:
  - name: some_stream
    on_table: some_table
    owner: SYSADMIN
    copy_grants: true
    at:
      TIMESTAMP: "2022-01-01 00:00:00"
    before:
      STREAM: some_other_stream
    append_only: false
    show_initial_rows: true
    comment: This is a sample stream.
```

## Fields

* `name` (string, required) - The name of the stream.
* `on_table` (string, required) - The name of the table the stream is based on.
* `owner` (string or [Role](/titan-core/resources/role.md)) - The role that owns the stream. Defaults to "SYSADMIN".
* `copy_grants` (bool) - Whether to copy grants from the source table to the stream.
* `at` (dict) - A dictionary specifying the point in time for the stream to start, using keys like TIMESTAMP, OFFSET, STATEMENT, or STREAM.
* `before` (dict) - A dictionary specifying the point in time for the stream to start, similar to 'at' but defining a point before the specified time.
* `append_only` (bool) - If set to True, the stream records only append operations.
* `show_initial_rows` (bool) - If set to True, the stream includes the initial rows of the table at the time of stream creation.
* `comment` (string) - An optional description for the stream.


---

# 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://titan-core.gitbook.io/titan-core/resources/table_stream.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.
