Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions docs/docs/core/flow_def.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The easiest way is to use the `@cocoindex.flow_def` decorator:
```python
@cocoindex.flow_def(name="DemoFlow")
def demo_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataScope):
...
...
```

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

```python
def demo_flow_def(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataScope):
...
...

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

</TabItem>
Expand Down Expand Up @@ -261,6 +261,10 @@ Export must happen at the top level of a flow, i.e. not within any child scopes
* `target_spec`: the storage spec as the export target.
* `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.
* `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.
* `setup_by_user` (optional):
whether the export target is setup by user.
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.
If `True`, the export target will be managed by users, and users are responsible for creating the target and updating it upon change.

<Tabs>
<TabItem value="python" label="Python" default>
Expand Down
5 changes: 3 additions & 2 deletions src/ops/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ pub enum SetupStateCompatibility {
/// This means the resource can be updated to the desired state without any loss of data.
Compatible,
/// The resource is partially compatible with the desired state.
/// This means some existing data will be lost after applying the setup change.
/// This means data from some existing fields will be lost after applying the setup change.
/// But at least their key fields of all rows are still preserved.
PartialCompatible,
/// The resource needs to be rebuilt
/// The resource needs to be rebuilt. After applying the setup change, all data will be gone.
NotCompatible,
}

Expand Down