Skip to content

Commit 9027cef

Browse files
authored
Update the doc and comments related to setup_by_user. (#272)
1 parent 8fc0fdf commit 9027cef

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

docs/docs/core/flow_def.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The easiest way is to use the `@cocoindex.flow_def` decorator:
2323
```python
2424
@cocoindex.flow_def(name="DemoFlow")
2525
def demo_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataScope):
26-
...
26+
...
2727
```
2828

2929
This `@cocoindex.flow_def` decorator declares this function as a CocoIndex flow definition.
@@ -37,7 +37,7 @@ Alternatively, for more flexibility (e.g. you want to do this conditionally or g
3737

3838
```python
3939
def demo_flow_def(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataScope):
40-
...
40+
...
4141

4242
# Add the flow definition to the flow registry.
4343
demo_flow = cocoindex.flow.add_flow_def("DemoFlow", demo_flow_def)
@@ -66,7 +66,7 @@ Import must happen at the top level, and the field created by import must be in
6666
@cocoindex.flow_def(name="DemoFlow")
6767
def demo_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataScope):
6868
data_scope["documents"] = flow_builder.add_source(DemoSourceSpec(...))
69-
......
69+
......
7070
```
7171

7272
</TabItem>
@@ -261,6 +261,10 @@ Export must happen at the top level of a flow, i.e. not within any child scopes
261261
* `target_spec`: the storage spec as the export target.
262262
* `primary_key_fields` (optional): the fields to be used as primary key. Types of the fields must be supported as key fields. See [Key Types](data_types#key-types) for more details.
263263
* `vector_index` (optional): the fields to create vector index. Each item is a tuple of a field name and a similarity metric. See [Vector Type](data_types#vector-type) for more details about supported similarity metrics.
264+
* `setup_by_user` (optional):
265+
whether the export target is setup by user.
266+
By default, CocoIndex is managing the target setup (surfaced by the `cocoindex setup` CLI subcommand), e.g. create related tables/collections/etc. with compatible schema, and update them upon change.
267+
If `True`, the export target will be managed by users, and users are responsible for creating the target and updating it upon change.
264268

265269
<Tabs>
266270
<TabItem value="python" label="Python" default>

src/ops/interface.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,10 @@ pub enum SetupStateCompatibility {
148148
/// This means the resource can be updated to the desired state without any loss of data.
149149
Compatible,
150150
/// The resource is partially compatible with the desired state.
151-
/// This means some existing data will be lost after applying the setup change.
151+
/// This means data from some existing fields will be lost after applying the setup change.
152+
/// But at least their key fields of all rows are still preserved.
152153
PartialCompatible,
153-
/// The resource needs to be rebuilt
154+
/// The resource needs to be rebuilt. After applying the setup change, all data will be gone.
154155
NotCompatible,
155156
}
156157

0 commit comments

Comments
 (0)