diff --git a/docs/docs/core/flow_def.mdx b/docs/docs/core/flow_def.mdx index 562099a2..b5b96132 100644 --- a/docs/docs/core/flow_def.mdx +++ b/docs/docs/core/flow_def.mdx @@ -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. @@ -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) @@ -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(...)) - ...... + ...... ``` @@ -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. diff --git a/src/ops/interface.rs b/src/ops/interface.rs index f217d056..59c10f40 100644 --- a/src/ops/interface.rs +++ b/src/ops/interface.rs @@ -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, }