Skip to content

Commit e7fdbe1

Browse files
authored
docs: update key fields instruction and add example (#926)
1 parent f4e70ce commit e7fdbe1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

docs/docs/ops/sources.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,12 @@ The spec takes the following fields:
316316

317317
### Schema
318318

319-
The output is a [*KTable*](/docs/core/data_types#ktable) with fields derived from the table schema:
319+
The output is a [*KTable*](/docs/core/data_types#ktable) with straightforward 1 to 1 mapping from Postgres table columns to CocoIndex table fields:
320320

321-
* Key fields:
322-
* If the table has a single primary key column, that column appears as the key field with its name and type.
323-
* If the table has a composite primary key, a struct field named `_key` contains each PK component as a sub-field.
324-
* Value fields: All non-primary-key columns included by `included_columns` (or all when not specified) appear as value fields.
321+
* Key fields: All primary key columns in the Postgres table will be included automatically as key fields.
322+
* Value fields: All non-primary-key columns in the Postgres table (included by `included_columns` or all when not specified) appear as value fields.
323+
324+
### Example
325+
326+
You can find end-to-end example using Postgres source at:
327+
* [examples/postgres_source](https://github.com/cocoindex-io/cocoindex/tree/main/examples/postgres_source)

0 commit comments

Comments
 (0)