Skip to content

Commit 3795b8c

Browse files
committed
updated docs
1 parent a4baa41 commit 3795b8c

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

docs/data-sources/stream.md

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ output "example_stream" {
3939

4040
- `columns` (Attributes List) The columns of the stream (see [below for nested schema](#nestedatt--columns))
4141
- `description` (String) A detailed text describes the stream
42+
- `mode` (String) The stream mode. Options: append, changelog, changelog_kv, versioned_kv. Default: "append"
4243

4344
<a id="nestedatt--columns"></a>
4445
### Nested Schema for `columns`
@@ -48,4 +49,6 @@ Read-Only:
4849
- `codec` (String) The codec for value encoding
4950
- `default` (String) The default value for the column
5051
- `name` (String) The column name
52+
- `primary_key` (Boolean) If set to `true`, this column will be used as the primary key, or part of the combined primary key if multiple columns are marked as primary keys.
5153
- `type` (String) The type name of the column
54+
- `use_as_event_time` (Boolean) If set to `true`, this column will be used as the event time column (by default ingest time will be used as event time). Only one column can be marked as the event time column in a stream.

docs/resources/stream.md

+23-4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,25 @@ resource "timeplus_stream" "retention_example" {
8383
retention_ms = 7 * 24 * 60 * 60 * 1000 // 7 days in ms
8484
history_ttl = "to_datetime(_tp_time) + INTERVAL 30 DAY"
8585
}
86+
87+
resource "timeplus_stream" "mode_example" {
88+
name = "mode_example"
89+
90+
description = "An example shows how to use different mode to create stream"
91+
92+
mode = "versioned_kv"
93+
94+
column {
95+
name = "id"
96+
type = "string"
97+
primary_key = true
98+
}
99+
100+
column {
101+
name = "value"
102+
type = "int32"
103+
}
104+
}
86105
```
87106

88107
<!-- schema generated by tfplugindocs -->
@@ -91,15 +110,13 @@ resource "timeplus_stream" "retention_example" {
91110
### Required
92111

93112
- `name` (String) The stream name
94-
<!--
95-
Due to the framework limitation, it's impossible to define a block attribute as `required`. Thus we need to manually move it to this `Required` section.
96-
-->
97-
- `column` (Block List) Define the columns of the stream (see [below for nested schema](#nestedblock--column))
98113

99114
### Optional
100115

116+
- `column` (Block List) Define the columns of the stream (see [below for nested schema](#nestedblock--column))
101117
- `description` (String) A detailed text describes the stream
102118
- `history_ttl` (String) A SQL expression defines the maximum age of data that are persisted in the historical store
119+
- `mode` (String) The stream mode. Options: append, changelog, changelog_kv, versioned_kv. Default: "append"
103120
- `retention_bytes` (Number) The retention size threadhold in bytes indicates how many data could be kept in the streaming store
104121
- `retention_ms` (Number) The retention period threadhold in millisecond indicates how long data could be kept in the streaming store
105122

@@ -115,3 +132,5 @@ Optional:
115132

116133
- `codec` (String) The codec for value encoding
117134
- `default` (String) The default value for the column
135+
- `primary_key` (Boolean) If set to `true`, this column will be used as the primary key, or part of the combined primary key if multiple columns are marked as primary keys.
136+
- `use_as_event_time` (Boolean) If set to `true`, this column will be used as the event time column (by default ingest time will be used as event time). Only one column can be marked as the event time column in a stream.

0 commit comments

Comments
 (0)